summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Adrian Roos <roosa@google.com> 2020-01-28 18:23:39 +0100
committer Adrian Roos <roosa@google.com> 2020-02-05 17:18:39 -0800
commitbbf42404b703a337600700c40ea7cae602b4e85c (patch)
treee8ab933b65c9ca55aebf60ff2d3443f1bb8f371d
parent08b29115c8a75c4aa89fdffc4d78262b9b61ce6f (diff)
IME: Dispatch onProgress directly during app-driven onReady
Fixes and issue where the initial frame of an app-driven transition would flicker because onProgress would only be called after the first frame had been rendered. Bug: 111084606 Test: atest WmTests Change-Id: I312ba27d95aaeb69c94bbdba39ee423ed38ffdac
-rw-r--r--core/java/android/view/InsetsController.java20
1 files changed, 4 insertions, 16 deletions
diff --git a/core/java/android/view/InsetsController.java b/core/java/android/view/InsetsController.java
index 22d6f37dbd95..54de1bb3739d 100644
--- a/core/java/android/view/InsetsController.java
+++ b/core/java/android/view/InsetsController.java
@@ -190,9 +190,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
onAnimationFinish();
}
});
- setStartingAnimation(true);
mAnimator.start();
- setStartingAnimation(false);
}
@Override
@@ -203,9 +201,6 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
}
}
- protected void setStartingAnimation(boolean startingAnimation) {
- }
-
protected void onAnimationFinish() {
mController.finish(mShow);
}
@@ -239,16 +234,6 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
final @AnimationType int type;
}
- private class DefaultAnimationControlListener extends InternalAnimationControlListener {
- DefaultAnimationControlListener(boolean show) {
- super(show);
- }
-
- @Override
- protected void setStartingAnimation(boolean startingAnimation) {
- mStartingAnimation = startingAnimation;
- }
- }
/**
* Represents a control request that we had to defer because we are waiting for the IME to
* process our show request.
@@ -822,7 +807,8 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
return;
}
- final DefaultAnimationControlListener listener = new DefaultAnimationControlListener(show);
+ final InternalAnimationControlListener listener =
+ new InternalAnimationControlListener(show);
// Show/hide animations always need to be relative to the display frame, in order that shown
// and hidden state insets are correct.
controlAnimationUnchecked(
@@ -878,7 +864,9 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
return true;
}
mViewRoot.mView.dispatchWindowInsetsAnimationStart(animation, bounds);
+ mStartingAnimation = true;
listener.onReady(controller, types);
+ mStartingAnimation = false;
return true;
}
});