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

Commit 62d31441 authored by Sergey Serokurov's avatar Sergey Serokurov Committed by Android (Google) Code Review
Browse files

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

parents ec41e351 aebd901c
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
@@ -3014,6 +3014,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.
     */