David
David

Reputation: 9

How to visible TextView in CardView?

I have a cardView in recyclerView, so I need to push the button "Explore" and open the cardView and see TextView, it is like this example.

So, what should I use to do that?

Upvotes: 0

Views: 136

Answers (1)

Miravzal
Miravzal

Reputation: 2035

If you are just using CardView, do this in your on onClickListener of cardview:

TransitionManager.beginDelayedTransition(cardview);
detailsView.setVisibility(View.VISIBLE);

By default keep the visibility of your detailsView to be GONE in your xml.

If you are using CardViews inside a ListView or RecyclerView see answer for recommended way of doing it: RecyclerView expand/collapse items

Upvotes: 1

Related Questions