Add IME switcher/hide button bar when IME showing

Bug: 180046394
Change-Id: Ic2bd919ab3d27e0a430b081c771ea8dc5827be81
This commit is contained in:
Vinit Nayak
2021-04-16 12:50:22 -07:00
parent 16fd85629d
commit 673faf59ee
10 changed files with 383 additions and 40 deletions

View File

@@ -44,7 +44,7 @@ public class TaskbarAnimationController {
private final AnimatedFloat mTaskbarVisibilityAlphaForLauncherState = new AnimatedFloat(
this::updateVisibilityAlpha);
private final AnimatedFloat mTaskbarVisibilityAlphaForIme = new AnimatedFloat(
this::updateVisibilityAlpha);
this::updateVisibilityAlphaForIme);
// Scale.
private final AnimatedFloat mTaskbarScaleForLauncherState = new AnimatedFloat(
@@ -110,16 +110,22 @@ public class TaskbarAnimationController {
// We use mTaskbarBackgroundAlpha as a proxy for whether Launcher is resumed/paused, the
// assumption being that Taskbar should always be visible regardless of the current
// LauncherState if Launcher is paused.
float alphaDueToIme = mTaskbarVisibilityAlphaForIme.value;
float alphaDueToLauncher = Math.max(mTaskbarBackgroundAlpha.value,
mTaskbarVisibilityAlphaForLauncherState.value);
float alphaDueToOther = mTaskbarVisibilityAlphaForIme.value;
float taskbarAlpha = alphaDueToLauncher * alphaDueToOther;
float taskbarAlpha = alphaDueToLauncher * alphaDueToIme;
mTaskbarCallbacks.updateTaskbarVisibilityAlpha(taskbarAlpha);
// Make the nav bar invisible if taskbar is visible.
setNavBarButtonAlpha(1f - taskbarAlpha);
}
private void updateVisibilityAlphaForIme() {
updateVisibilityAlpha();
float taskbarAlphaDueToIme = mTaskbarVisibilityAlphaForIme.value;
mTaskbarCallbacks.updateImeBarVisibilityAlpha(1f - taskbarAlphaDueToIme);
}
private void updateScale() {
// We use mTaskbarBackgroundAlpha as a proxy for whether Launcher is resumed/paused, the
// assumption being that Taskbar should always be at scale 1f regardless of the current