1

I have CardViews which contain TextViews with large amount of Text and I want to make them expandable so that the content is just shown, when its needed. For example:

Variety 1 enter image description here

Variety 2 enter image description here

Any advise?

Ronaldo
  • 774
  • 3
  • 8
  • 29

1 Answers1

0

You just need to have a regular card with different ViewGroups. You can toggle the visibility of those ViewGroups (VISIBLE or INVISIBLE/GONE) when the user click the "expand/collapse" button.

You can try to animate those changes but it can cause you some problems if your CardView is withing a recyclerView (you'll need probably more than that one-liner in the xml to make the animations work well).

Sotti
  • 14,089
  • 2
  • 50
  • 43
  • I'll try that when I'm home. Thank you. Luckily enough I didn't put my cards into a recyclerView, instead of it I inserted them one by one into my nestedScrollView because I did not know how to put a RecyclerView into a NestedScrollView. – Ronaldo Dec 08 '15 at 11:27