Inside Card(extends ViewFlipper) constructor i tried to use the code below :
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.Card); nextCard = (Card)findViewById(a.getInteger(R.styleable.Card_nextCard,0)); a.recycle(); but unsuccessful. Anyone? On Thu, Nov 25, 2010 at 6:09 PM, Ramon Molossi <[email protected]>wrote: > How can I do a chain with n ViewFlippers, where one view flipper points to > the next one e the last one points to the first one? > > public MyFlipper extends ViewFlipper(){ > > private MyFlipper nextFlipper; > > } > > I can do it programatically, but i want to set who is the next in XML > layout... is that possible? > > I tried to use the attrs.xml and use the id in myFlipper > > <resources> > > > <declare-styleable name="Card" > > > <attr name="nextCard" format="integer"/> > > </declare-styleable> > > > </resources> > > > And the layout like this.. > > <AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android" > > xmlns:test="test" > > android:layout_width="fill_parent" > > android:layout_height="fill_parent"> > > <MyFlipper > > android:id="@+id/card01" > > android:layout_x="10px" > > android:layout_y="10px" > > android:layout_width="wrap_content" > > android:layout_height="wrap_content" > > test:nextCard="@id/card02" > > > > > <ImageView > > android:id="@+id/card01f" > > android:layout_width="wrap_content" > > android:layout_height="wrap_content" > > > > > </ImageView> > > <ImageView > > android:id="@+id/card01b" > > android:layout_width="wrap_content" > > android:layout_height="wrap_content" > > > > > </ImageView> > > </MyFlipper> > > <MyFlipper > > android:id="@+id/card02" > > android:layout_x="10px" > > android:layout_y="90px" > > android:layout_width="wrap_content" > > android:layout_height="wrap_content" > > test:nextCard="@id/card01" > > > > > <ImageView > > android:id="@+id/card02f" > > android:layout_width="fill_parent" > > android:layout_height="fill_parent" > > > > > </ImageView> > > <ImageView > > android:id="@+id/card02b" > > android:layout_width="fill_parent" > > android:layout_height="fill_parent" > > > > > </ImageView> > > </MyFlipper> > > </AbsolutLayout> > > > I tried to revovery the nextCard id in the MyFlipper constructor, but no > way... > > > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

