Merge "Show IME switcher only when physical keyboard is connected in 3 button nav (instead of also when virtual keyboard is visible)" into tm-qpr-dev
This commit is contained in:
@@ -108,8 +108,6 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
|
||||
private static final int FLAG_SCREEN_PINNING_ACTIVE = 1 << 11;
|
||||
private static final int FLAG_VOICE_INTERACTION_WINDOW_SHOWING = 1 << 12;
|
||||
|
||||
private static final int MASK_IME_SWITCHER_VISIBLE = FLAG_SWITCHER_SUPPORTED | FLAG_IME_VISIBLE;
|
||||
|
||||
private static final String NAV_BUTTONS_SEPARATE_WINDOW_TITLE = "Taskbar Nav Buttons";
|
||||
|
||||
public static final int ALPHA_INDEX_IMMERSIVE_MODE = 0;
|
||||
@@ -191,7 +189,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
|
||||
isThreeButtonNav ? mStartContextualContainer : mEndContextualContainer,
|
||||
mControllers.navButtonController, R.id.ime_switcher);
|
||||
mPropertyHolders.add(new StatePropertyHolder(imeSwitcherButton,
|
||||
flags -> ((flags & MASK_IME_SWITCHER_VISIBLE) != 0)
|
||||
flags -> ((flags & FLAG_SWITCHER_SUPPORTED) != 0)
|
||||
&& ((flags & FLAG_ROTATION_BUTTON_VISIBLE) == 0)));
|
||||
}
|
||||
|
||||
@@ -506,6 +504,13 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
|
||||
return (mState & FLAG_IME_VISIBLE) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if IME switcher is visible
|
||||
*/
|
||||
public boolean isImeSwitcherVisible() {
|
||||
return (mState & FLAG_SWITCHER_SUPPORTED) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the home button is disabled
|
||||
*/
|
||||
|
||||
@@ -464,6 +464,8 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
|
||||
fromInit);
|
||||
mControllers.taskbarViewController.setImeIsVisible(
|
||||
mControllers.navbarButtonsViewController.isImeVisible());
|
||||
mControllers.taskbarViewController.setIsImeSwitcherVisible(
|
||||
mControllers.navbarButtonsViewController.isImeSwitcherVisible());
|
||||
int shadeExpandedFlags = SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED
|
||||
| SYSUI_STATE_QUICK_SETTINGS_EXPANDED;
|
||||
onNotificationShadeExpandChanged((systemUiStateFlags & shadeExpandedFlags) != 0, fromInit);
|
||||
|
||||
@@ -68,7 +68,8 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
|
||||
public static final int ALPHA_INDEX_RECENTS_DISABLED = 3;
|
||||
public static final int ALPHA_INDEX_NOTIFICATION_EXPANDED = 4;
|
||||
public static final int ALPHA_INDEX_ASSISTANT_INVOKED = 5;
|
||||
private static final int NUM_ALPHA_CHANNELS = 6;
|
||||
public static final int ALPHA_INDEX_IME_BUTTON_NAV = 6;
|
||||
private static final int NUM_ALPHA_CHANNELS = 7;
|
||||
|
||||
private final TaskbarActivityContext mActivity;
|
||||
private final TaskbarView mTaskbarView;
|
||||
@@ -142,6 +143,14 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
|
||||
mTaskbarView.setTouchesEnabled(!isImeVisible);
|
||||
}
|
||||
|
||||
/**
|
||||
* Should be called when the IME switcher visibility changes.
|
||||
*/
|
||||
public void setIsImeSwitcherVisible(boolean isImeSwitcherVisible) {
|
||||
mTaskbarIconAlpha.getProperty(ALPHA_INDEX_IME_BUTTON_NAV).setValue(
|
||||
isImeSwitcherVisible ? 0 : 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Should be called when the recents button is disabled, so we can hide taskbar icons as well.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user