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

Commit aebd901c authored by Sergey Serokurov's avatar Sergey Serokurov
Browse files

Adjust dismiss view position when one handed mode is switched on/off

Bug: 198403767
Test: atest SystemUITests
Test: Manual, screen recording: https://drive.google.com/file/d/1CvoTt_BlKFHQI0H15QJ8M-M7zJMq3hfU/view?usp=sharing

Change-Id: I3d757909f4e01fcde11f3377caa83e7cf3a73b5b
parent e3f8cd4e
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -284,17 +284,21 @@ public class BubbleController {
        mSyncQueue = syncQueue;
    }

    private static void registerOneHandedState(OneHandedController oneHanded) {
    private void registerOneHandedState(OneHandedController oneHanded) {
        oneHanded.registerTransitionCallback(
                new OneHandedTransitionCallback() {
                    @Override
                    public void onStartFinished(Rect bounds) {
                        // TODO(b/198403767) mStackView.offSetY(int bounds.top)
                        if (mStackView != null) {
                            mStackView.onVerticalOffsetChanged(bounds.top);
                        }
                    }

                    @Override
                    public void onStopFinished(Rect bounds) {
                        // TODO(b/198403767) mStackView.offSetY(int bounds.top)
                        if (mStackView != null) {
                            mStackView.onVerticalOffsetChanged(bounds.top);
                        }
                    }
                });
    }
@@ -423,7 +427,7 @@ public class BubbleController {
                    }
                });

        mOneHandedOptional.ifPresent(BubbleController::registerOneHandedState);
        mOneHandedOptional.ifPresent(this::registerOneHandedState);
    }

    @VisibleForTesting
+10 −0
Original line number Diff line number Diff line
@@ -3009,6 +3009,16 @@ public class BubbleStackView extends FrameLayout
        return mStackViewState;
    }

    /**
     * Handles vertical offset changes, e.g. when one handed mode is switched on/off.
     *
     * @param offset new vertical offset.
     */
    void onVerticalOffsetChanged(int offset) {
        // adjust dismiss view vertical position, so that it is still visible to the user
        mDismissView.setPadding(/* left = */ 0, /* top = */ 0, /* right = */ 0, offset);
    }

    /**
     * Holds some commonly queried information about the stack.
     */