Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b07b8f6 authored by Tony Wickham's avatar Tony Wickham Committed by Android (Google) Code Review
Browse files

Merge "Hide taskbar icons when recents button is disabled" into sc-v2-dev

parents ee3814de bc30e25c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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
     */
+2 −0
Original line number Diff line number Diff line
@@ -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);
    }

+11 −1
Original line number Diff line number Diff line
@@ -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.
     */