【问题标题】:Huawei animation is way faster than on other phones华为动画比其他手机快得多
【发布时间】:2020-02-03 15:01:27
【问题描述】:

我想为我的应用添加加载动画。相邻的两个点交替闪烁(类似于铁路道口灯)。它在其他手机上运行良好,但华为动画时长有问题,这两个点动画开始越来越不同步,突然它们开始同时闪烁。

以前有人遇到过这个问题吗?我可以确认我在 Razer Phone 2、小米 Mi A1 和三星 Galaxy S7 上对其进行了测试,它运行良好,没有出现故障。只有华为手机有这个问题。另外华为安卓版和小米A1版是一样的,所以和版本没有关系。

代码:

                val anim1 = ObjectAnimator.ofFloat(dotAnimView1, View.ALPHA, 1f, 0f).apply {
                    duration = 900
                    repeatMode = ValueAnimator.REVERSE
                    repeatCount = Animation.INFINITE
                }
                val anim2 = ObjectAnimator.ofFloat(dotAnimView2, View.ALPHA, 1f, 0f).apply {
                    duration = 900
                    repeatMode = ValueAnimator.REVERSE
                    repeatCount = Animation.INFINITE
                }
                if((anim1?.isRunning == false || anim2?.isRunning == false)){
                    anim1.start()
                    post(900){ anim2.start() }
                }

【问题讨论】:

  • 有趣。如果您有权访问此华为设备,请检查 Developer Options --> Animator Duration Scale。如果设置为0.5xAnimation off,您可能会看到这个奇怪的情况。如果是这种情况,请尝试将其设置为默认值 1x 并告诉我。
  • 这是一个长镜头,但在同一个菜单中,还要检查Window animation scaleTransition animation scale。如果它们也有奇怪的值,请将它们设置为 1x 并再次检查动画。
  • 这行得通。我什至不知道设置中存在动画速度之类的东西:)
  • 然后将其作为答案发布。请在那里接受。

标签: android android-animation


【解决方案1】:

检查开发者选项 --> Animator Duration Scale。如果它设置为 0.5 倍或关闭动画,您可能会看到这个奇怪的情况。如果是这种情况,请尝试将其设置为默认值 1x。

【讨论】:

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