Merge "Hide taskbar icons when recents button is disabled" into sc-v2-dev am: 8b07b8f6d0
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15684794 Change-Id: I7f351d14fd3224b6a11b12e715081612c0fd838d
This commit is contained in:
@@ -260,6 +260,13 @@ public class NavbarButtonsViewController {
|
||||
return (mState & FLAG_IME_VISIBLE) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the recents (overview) button is disabled
|
||||
*/
|
||||
public boolean isRecentsDisabled() {
|
||||
return (mState & FLAG_DISABLE_RECENTS) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the bounds corresponding to all visible buttons to provided region
|
||||
*/
|
||||
|
||||
@@ -236,6 +236,8 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
|
||||
systemUiStateFlags, forceUpdate);
|
||||
mControllers.taskbarViewController.setImeIsVisible(
|
||||
mControllers.navbarButtonsViewController.isImeVisible());
|
||||
mControllers.taskbarViewController.setRecentsButtonDisabled(
|
||||
mControllers.navbarButtonsViewController.isRecentsDisabled());
|
||||
mControllers.taskbarKeyguardController.updateStateForSysuiFlags(systemUiStateFlags);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,8 @@ public class TaskbarViewController {
|
||||
public static final int ALPHA_INDEX_IME = 1;
|
||||
public static final int ALPHA_INDEX_KEYGUARD = 2;
|
||||
public static final int ALPHA_INDEX_STASH = 3;
|
||||
public static final int ALPHA_INDEX_RECENTS_DISABLED = 4;
|
||||
private static final int NUM_ALPHA_CHANNELS = 5;
|
||||
|
||||
private final TaskbarActivityContext mActivity;
|
||||
private final TaskbarView mTaskbarView;
|
||||
@@ -67,7 +69,7 @@ public class TaskbarViewController {
|
||||
public TaskbarViewController(TaskbarActivityContext activity, TaskbarView taskbarView) {
|
||||
mActivity = activity;
|
||||
mTaskbarView = taskbarView;
|
||||
mTaskbarIconAlpha = new MultiValueAlpha(mTaskbarView, 4);
|
||||
mTaskbarIconAlpha = new MultiValueAlpha(mTaskbarView, NUM_ALPHA_CHANNELS);
|
||||
mTaskbarIconAlpha.setUpdateVisibility(true);
|
||||
mModelCallbacks = new TaskbarModelCallbacks(activity, mTaskbarView);
|
||||
}
|
||||
@@ -100,6 +102,14 @@ public class TaskbarViewController {
|
||||
mTaskbarView.setTouchesEnabled(!isImeVisible);
|
||||
}
|
||||
|
||||
/**
|
||||
* Should be called when the recents button is disabled, so we can hide taskbar icons as well.
|
||||
*/
|
||||
public void setRecentsButtonDisabled(boolean isDisabled) {
|
||||
// TODO: check TaskbarStashController#supportsStashing(), to stash instead of setting alpha.
|
||||
mTaskbarIconAlpha.getProperty(ALPHA_INDEX_RECENTS_DISABLED).setValue(isDisabled ? 0 : 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets OnClickListener and OnLongClickListener for the given view.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user