1

Please help on this issue.

I have a custom Class CardList

public class CardList extends AdapterView<ArrayAdapter>

There is a Player class which uses this custom view.

CardList have Touch,Drag event listener. TouchListner determines the View Click as well. When View is clicked, a callback it made to listener function in Player class. Player Class calls below function to animate CardClick. But animation does not work.

Surprisingly, if the function is called directly from View's Touch event listener, the animation works.

//Animate Function inside Custom View

public void animateTopCardClick(Animation animation) {
        ValueAnimator animator = ObjectAnimator.ofPropertyValuesHolder( this.getChildAt( getChildCount() - 1 ),
                PropertyValuesHolder.ofFloat( "alpha", 1.0f, 0 ),
                PropertyValuesHolder.ofFloat( "rotationY", -180.0f, 0 ),
                PropertyValuesHolder.ofFloat( "alpha", 0.0f, 1.0f )
        ).setDuration( 1000 );

        animator.setInterpolator( new AccelerateInterpolator() );
        animator.start();
    }

Any ideas why Animation does not work when called from Player Class? Any workaround for the issue.?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
i_quit
  • 11
  • 1

0 Answers0