Hide back button if IME shows in SUW

Fixes: 230830643
Test: Visually see no back button when IME
shows up on enter pin screen

Change-Id: Icdde92d39962c3891a56bb07de5b16a22635729e
This commit is contained in:
Vinit Nayak
2022-09-20 16:46:27 -07:00
parent c7295ee37a
commit 7523b94105

View File

@@ -126,7 +126,8 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
public static final int ALPHA_INDEX_IMMERSIVE_MODE = 0;
public static final int ALPHA_INDEX_KEYGUARD_OR_DISABLE = 1;
private static final int NUM_ALPHA_CHANNELS = 2;
public static final int ALPHA_INDEX_SUW = 2;
private static final int NUM_ALPHA_CHANNELS = 3;
private final ArrayList<StatePropertyHolder> mPropertyHolders = new ArrayList<>();
private final ArrayList<ImageView> mAllButtons = new ArrayList<>();
@@ -276,6 +277,11 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
navButtonsLayoutParams.gravity = Gravity.START;
mNavButtonContainer.requestLayout();
// Hide back button in SUW if keyboard is showing (IME draws its own back).
mPropertyHolders.add(new StatePropertyHolder(
mBackButtonAlpha.getProperty(ALPHA_INDEX_SUW),
flags -> (flags & FLAG_IME_VISIBLE) == 0));
// TODO(b/210906568) Dark intensity is currently not propagated during setup, so set
// it based on dark theme for now.
int mode = resources.getConfiguration().uiMode