Merge "Post insets update to handler" into rvc-dev

This commit is contained in:
Evan Rosky
2020-05-29 17:59:52 +00:00
committed by Android (Google) Code Review

View File

@@ -187,6 +187,7 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged
@Override @Override
public void insetsChanged(InsetsState insetsState) { public void insetsChanged(InsetsState insetsState) {
mHandler.post(() -> {
if (mInsetsState.equals(insetsState)) { if (mInsetsState.equals(insetsState)) {
return; return;
} }
@@ -200,6 +201,7 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged
if (DEBUG) Slog.d(TAG, "insetsChanged when IME showing, restart animation"); if (DEBUG) Slog.d(TAG, "insetsChanged when IME showing, restart animation");
startAnimation(mImeShowing, true /* forceRestart */); startAnimation(mImeShowing, true /* forceRestart */);
} }
});
} }
@Override @Override
@@ -232,7 +234,7 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged
return; return;
} }
if (DEBUG) Slog.d(TAG, "Got showInsets for ime"); if (DEBUG) Slog.d(TAG, "Got showInsets for ime");
startAnimation(true /* show */, false /* forceRestart */); mHandler.post(() -> startAnimation(true /* show */, false /* forceRestart */));
} }
@Override @Override
@@ -241,7 +243,7 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged
return; return;
} }
if (DEBUG) Slog.d(TAG, "Got hideInsets for ime"); if (DEBUG) Slog.d(TAG, "Got hideInsets for ime");
startAnimation(false /* show */, false /* forceRestart */); mHandler.post(() -> startAnimation(false /* show */, false /* forceRestart */));
} }
/** /**
@@ -269,7 +271,6 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged
if (newFrame.height() != 0) { if (newFrame.height() != 0) {
mImeFrame.set(newFrame); mImeFrame.set(newFrame);
} }
mHandler.post(() -> {
if (DEBUG) { if (DEBUG) {
Slog.d(TAG, "Run startAnim show:" + show + " was:" Slog.d(TAG, "Run startAnim show:" + show + " was:"
+ (mAnimationDirection == DIRECTION_SHOW ? "SHOW" + (mAnimationDirection == DIRECTION_SHOW ? "SHOW"
@@ -370,7 +371,6 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged
// can have a "flicker" of ime-provided insets. // can have a "flicker" of ime-provided insets.
setVisibleDirectly(true /* visible */); setVisibleDirectly(true /* visible */);
} }
});
} }
} }