2

im using the Android Library CardsLib to display an expandable list, my implementation should only have one item expanded at time and if i try to expand other card the the previous expanded one should collapse and then expand the new one.

I have already implemented a custom CardHeader and also a custom ExpandCard and it works like charm but im not sure how to close the others without going throw all of the cards array and set them the setExpanded attribute to false. is there any easiest way to do it?

geekkoz
  • 3,654
  • 4
  • 21
  • 19
  • Are you sure? You can see an example in the demo app: https://github.com/gabrielemariotti/cardslib/blob/master/demo/stock/src/main/java/it/gmariotti/cardslib/demo/fragment/nativeview/NativeListExpandCardFragment.java – Gabriele Mariotti Feb 14 '15 at 07:50
  • Hi, thanks for the reply and Yes, sorry it may be miss undesstood, the library actually supports to have multiple items expanded at once, it is actually my implementation which has to, but im not able to do it because the only way to do it is maybe go throw all the cards and set them as setExpanded(false), i was wondering if there were a mode of single expand in the library – geekkoz Feb 14 '15 at 22:06
  • Why not just use `AppCompatv7`'s `CardView` which is supported by Google? – Jared Burrows Feb 15 '15 at 02:56
  • @EkKoZ you can find all info here. https://github.com/gabrielemariotti/cardslib/blob/master/doc/EXPAND.md – Gabriele Mariotti Feb 15 '15 at 07:35
  • @JaredBurrows this lib is based on Google CardView. – Gabriele Mariotti Feb 15 '15 at 07:36
  • @GabrieleMariotti The library is amazing. I am just suggesting why not use App Compat's Card lib not that it is out. You made your library before AppCompat had CardView. – Jared Burrows Feb 15 '15 at 16:52

0 Answers0