【问题标题】:On Samsung Devices, Ripple and Reveal's fail if imageView animation is playing在三星设备上,如果正在播放 imageView 动画,Ripple 和 Reveal 会失败
【发布时间】:2017-03-23 21:51:14
【问题描述】:

这似乎只发生在三星设备上(在 S7 和 Tab S2 上测试)。

问题 如果正在播放任何动画,所有对话涟漪和显示效果都会受到阻碍、中途停止或根本不播放。

例如,这个imageview动画已经启动:

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);

然后我触摸对话框中的按钮或启动显示动画。 动画要么在随机点冻结,要么可怕地结结巴巴。 在我的代码中,一些显示是对话框,因此当对话框显示中途停止时,它会阻止用户执行任何操作。

编辑:当使用progressView(例如com.github.rahatarmanahmed.cpv.CircularProgressView)时也会发生这种情况,它会产生动画效果。

如何防止/解决此问题?这在非三星设备上运行良好。

示例项目位于:https://github.com/behelit/SamsungAnimationFailSample

下图有一个冻结的波纹,此时没有触摸

【问题讨论】:

    标签: android android-animation circularreveal


    【解决方案1】:

    我的解决方案是暂停所有动画 onPause 并在 onResume 中恢复。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多