2

When I toggle the expand by tapping on the card/expand button the whole card disappears for a very short time and reappears again. It happens at the end of the expand animation.

See the problem in action: https://dl.dropboxusercontent.com/u/10116108/Cardslib_flicker.gif

I have tried to use a standard expand instead with same results. So it can't be my CustomExpandCard (which is why I didn't post the code of that).

Here's my code to create the cards:

//Create a Card
Card card = new Card(getActivity(), R.layout.card_inner_content);

ViewToClickToExpand viewToClickToExpand =
        ViewToClickToExpand.builder()
                .highlightView(false)
                .setupCardElement(ViewToClickToExpand.CardElementUI.CARD);
card.setViewToClickToExpand(viewToClickToExpand);

//Set onClick listener
card.setOnClickListener(new Card.OnCardClickListener() {
    @Override
    public void onClick(Card card, View view) {
        card.doToogleExpand();
    }
});

//Create a CardHeader
CardHeader header = new CardHeader(getActivity());

header.setTitle(entry.getValue().toString());

//Set visible the expand/collapse button
header.setButtonExpandVisible(true);

CardExpand expand = new CustomExpandCard(getActivity());
card.addCardExpand(expand);

//Add Header to card
card.addCardHeader(header);

card.setTitle(quote);

//Card elevation
card.setCardElevation(getResources().getDimension(R.dimen.carddemo_shadow_elevation));

card.setId(String.valueOf(index));

cards.add(card);

Later on I update the recyclerView:

mCardArrayAdapter = new CardArrayRecyclerViewAdapter(getActivity(), cards);

mRecyclerView.setAdapter(mCardArrayAdapter);
Jonathan S
  • 491
  • 1
  • 5
  • 11

0 Answers0