android - CardView animation issue: no initial animation -


there 2 cardviews in recyclerview in framelayout. 1 cardview has android:visibility="gone" setting on it. when tapped, card flips 360 degrees, revealing 'gone' cardview. tapping again flips it, showing initial card. sounds simple now.

used objectanimator class this, so:

public static void flipview(view viewtoflip, int direction) {     objectanimator flipanimator;      if (direction == clockwise)     {         flipanimator = objectanimator.offloat(viewtoflip, "rotationy", 0f, 360f);         flipanimator.setduration(3500);         flipanimator.start();     }     else     {         flipanimator = objectanimator.offloat(viewtoflip, "rotationy", 360f, 0f);         flipanimator.setduration(3500);         flipanimator.start();     } } 

the issue when cardview shows initially, animation does not work, in there no flip. card gets replaced 'gone' card sans animation. on subsequent taps, animation works beautifully. questions are:

  • why animation not work word go? (in title of question, 'initial' means 'on first tap on cardview' when shows in fragment)
  • what fix?

please let me know if need examine more code.

thank expert advice!


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -