I'm trying to animate a set of views vertically in an RecyclerView.Adapter, the animation works well using android:clipChildren="false", android:clipToPadding="false" and viewHolder.linear.postInvalidate(), but the ClickListener does not work after animation ends. I'm using ObjectAnimator because I read this link Android Animation - Button stays clickable
Some code
@Override
public void onBindViewHolder(final TViewHolder viewHolder, int i) {
viewHolder.flGroupButtons.postInvalidate();
viewHolder.iv1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//not working
});
..... clicklisteners
viewHolder.iv4.setOnClickListener(new View.OnClickListener() {
PropertyValuesHolder scaleX = PropertyValuesHolder.ofFloat("scaleX", 1f);
PropertyValuesHolder scaleY = PropertyValuesHolder.ofFloat("scaleY", 1f);
PropertyValuesHolder pvTranslativ1 = PropertyValuesHolder.ofFloat("translationY", viewHolder.iv1.getY() - (measureHeight * 5));
ObjectAnimator animatoriv1 = ObjectAnimator.ofPropertyValuesHolder(viewHolder.iv1, scaleX, scaleY, pvTranslativ1);
animatoriv1.setInterpolator(new DecelerateInterpolator());
animatoriv1.setDuration(300);
....
......
AnimatorSet as = new AnimatorSet();
as.playTogether(animatoriv1, animatoriv2, animatoriv3, animatoriv4);
as.start();
});
}
Only iv1 clicklistener is working when is not collapsed. How can I get it work?