Search code examples
androidandroid-animationcircularreveal

On Samsung Devices, Ripple and Reveal's fail if imageView animation is playing


This only seems to occur on Samsung devices (tested on S7 and Tab S2).

Problem If any animation is playing, all dialog ripple and reveal affects are stunted, stop half way, or do not play at all.

For example, this imageview animation has been started:

RotateAnimation anim = new RotateAnimation(0.0f, 360.0f, Animation.RELATIVE_TO_SELF, 0.48f, Animation.RELATIVE_TO_SELF, 0.5f);
anim.setInterpolator(new LinearInterpolator());
anim.setRepeatCount(Animation.INFINITE);
anim.setDuration(2000);

ivStatus.startAnimation(anim);

Then I touch a button in a dialog or start a reveal animation. The animation either freezes at random points or stutters horribly. In my code, some reveals are dialogs so it blocks the user from doing anything when the dialog reveal stops half way.

Edit: This also occurs when using a progressView such as com.github.rahatarmanahmed.cpv.CircularProgressView, which animates.

How can this be prevented/fixed? This works perfectly fine on non-samsung devices.

Example project at: https://github.com/behelit/SamsungAnimationFailSample

The image below has a frozen ripple, no touch is occurring at this point Ripple death


Solution

  • My solution was to pause all animations onPause and resume in onResume.