Skip to content

Bug #12

Description

@Nullifier1571

image

你这一直在循环跑

Activity

  1. AndroidMsky commented on Jun 18, 2020

    @AndroidMsky
    Owner

    动画停止后 也在跑吗?

  2. Nullifier1571 commented on Jun 18, 2020

    @Nullifier1571
    Author

    ondraw里加上这个

    //当动画执行的时候才去走自己绘制逻辑
    if (animating) {
    drawNumber(canvas);
    }else {
    //动画结束后走父类的绘制
    super.onDraw(canvas);
    }

  3. Nullifier1571 commented on Jun 18, 2020

    @Nullifier1571
    Author

    是的啊,我打断点看了。
    这里动画结束的时候又调用了invalidate();

    if (autoOverLine == numLength * 2 - 1) {
                            stopAnimatorLoop();
                            invalidate();
                            animating = false;
                        }
    

    然后他就又到了drawNumber方法里,然后又走进了

    这个判断里
    overLine[j] = 1;
    然后就不断循环了

  4. Nullifier1571 commented on Jun 18, 2020

    @Nullifier1571
    Author

    有个小的想法,valueAnimator可以改成递归调用的方法,用postDelay控制速度。不知道可不可行

  5. AndroidMsky commented on Jun 19, 2020

    @AndroidMsky
    Owner

    好的,我看一下。可能是重构过程中引入的问题

  6. Nullifier1571 commented on Jun 19, 2020

    @Nullifier1571
    Author

    嗯嗯,还有我提了另一个UI卡死问题你可以也研究下,我的那个解决方案可能不完美因为我也不知道跟本原因

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions