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

Commit c83b989c authored by Matthew Ng's avatar Matthew Ng
Browse files

Added experiment for back gesture dragging home button

Dragging the opposite direction of quickscrub will execute the back
functionality as if you pressed the button. If you hold the home button
while in gesture, every second it will execute back command. Both adb
commands below are default to false so they must be enabled first.

Enable the setprop value for enabling this functionality.
adb shell setprop persist.quickstepcontroller.homegoesback true

Fully remove the back (and ime up) arrow button. Dependent of above.
adb shell setprop persist.quickstepcontroller.hideback true
Then go home or start the ime/keyboard to see changes.

Test: manual
Bug: 112934365
Change-Id: I68b7f0415107fc134d51fafbd55bc641d4312815
parent b3d3dd21
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -952,6 +952,7 @@
    <dimen name="nav_content_padding">0dp</dimen>
    <dimen name="nav_quick_scrub_track_edge_padding">24dp</dimen>
    <dimen name="nav_quick_scrub_track_thickness">10dp</dimen>
    <dimen name="nav_home_back_gesture_drag_limit">60dp</dimen>

    <!-- Navigation bar shadow params. -->
    <dimen name="nav_key_button_shadow_offset_x">0dp</dimen>
+6 −0
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
    private @InteractionType int mInteractionFlags;
    private boolean mIsEnabled;
    private int mCurrentBoundedUserId = -1;
    private float mBackButtonAlpha;

    private ISystemUiProxy mSysUiProxy = new ISystemUiProxy.Stub() {

@@ -193,6 +194,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
            }
            long token = Binder.clearCallingIdentity();
            try {
                mBackButtonAlpha = alpha;
                mHandler.post(() -> {
                    notifyBackButtonAlphaChanged(alpha, animate);
                });
@@ -322,6 +324,10 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
        }
    }

    public float getBackButtonAlpha() {
        return mBackButtonAlpha;
    }

    public void startConnectionToCurrentUser() {
        if (mHandler.getLooper() != Looper.myLooper()) {
            mHandler.post(mConnectionRunnable);
+5 −1
Original line number Diff line number Diff line
@@ -163,12 +163,16 @@ public class ButtonDispatcher {
    }

    public void setAlpha(float alpha, boolean animate) {
        setAlpha(alpha, animate, (getAlpha() < alpha) ? FADE_DURATION_IN : FADE_DURATION_OUT);
    }

    public void setAlpha(float alpha, boolean animate, long duration) {
        if (animate) {
            if (mFadeAnimator != null) {
                mFadeAnimator.cancel();
            }
            mFadeAnimator = ValueAnimator.ofFloat(getAlpha(), alpha);
            mFadeAnimator.setDuration(getAlpha() < alpha? FADE_DURATION_IN : FADE_DURATION_OUT);
            mFadeAnimator.setDuration(duration);
            mFadeAnimator.setInterpolator(getAlpha() < alpha ? ALPHA_IN : ALPHA_OUT);
            mFadeAnimator.addListener(mFadeListener);
            mFadeAnimator.addUpdateListener(mAlphaListener);
+8 −2
Original line number Diff line number Diff line
@@ -195,9 +195,15 @@ public class NavigationBarFragment extends Fragment implements Callbacks {
        @Override
        public void onBackButtonAlphaChanged(float alpha, boolean animate) {
            final ButtonDispatcher backButton = mNavigationBarView.getBackButton();
            if (QuickStepController.shouldhideBackButton()) {
                // If property was changed to hide/show back button, going home will trigger
                // launcher to to change the back button alpha to reflect property change
                backButton.setVisibility(View.GONE);
            } else {
                backButton.setVisibility(alpha > 0 ? View.VISIBLE : View.INVISIBLE);
                backButton.setAlpha(alpha, animate);
            }
        }
    };

    // ----- Fragment Lifecycle Callbacks -----
+2 −1
Original line number Diff line number Diff line
@@ -682,7 +682,8 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav
        // Always disable recents when alternate car mode UI is active.
        boolean disableRecent = mUseCarModeUi || !isOverviewEnabled();

        boolean disableBack = ((mDisabledFlags & View.STATUS_BAR_DISABLE_BACK) != 0) && !useAltBack;
        boolean disableBack = QuickStepController.shouldhideBackButton()
                || (((mDisabledFlags & View.STATUS_BAR_DISABLE_BACK) != 0) && !useAltBack);

        // When screen pinning, don't hide back and home when connected service or back and
        // recents buttons when disconnected from launcher service in screen pinning mode,
Loading