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

Commit 58fa9de4 authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Update dock divider display info. whenever it changes.

The docked divider display info. was set on object creation and never
changed. This can hang the dock divider if the device rotation is
changed and the user moves the divider rapidly in and out of the
screen edge closer to the right. We now update the display info.
whenever it changes.

Change-Id: Ie5f0c7ebdafedb156d04eceee00fc7e4176d9bf8
parent 013f84ab
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -191,6 +191,7 @@ class DisplayContent {
    void updateDisplayInfo() {
        mDisplay.getDisplayInfo(mDisplayInfo);
        mDisplay.getMetrics(mDisplayMetrics);
        mDividerControllerLocked.updateDisplayInfo();
        for (int i = mStacks.size() - 1; i >= 0; --i) {
            mStacks.get(i).updateDisplayInfo(null);
        }
+9 −5
Original line number Diff line number Diff line
@@ -57,8 +57,8 @@ public class DockedStackDividerController implements View.OnTouchListener, DimLa
    private final DisplayContent mDisplayContent;
    private final int mSideMargin;
    private final DimLayer mDimLayer;
    private final int mDisplayWidth;
    private final int mDisplayHeight;
    private int mDisplayWidth;
    private int mDisplayHeight;
    private View mView;
    private Rect mTmpRect = new Rect();
    private Rect mLastResizeRect = new Rect();
@@ -72,9 +72,7 @@ public class DockedStackDividerController implements View.OnTouchListener, DimLa
    DockedStackDividerController(Context context, DisplayContent displayContent) {
        mContext = context;
        mDisplayContent = displayContent;
        final DisplayInfo info = displayContent.getDisplayInfo();
        mDisplayWidth = info.logicalWidth;
        mDisplayHeight = info.logicalHeight;
        updateDisplayInfo();
        mDividerWidth = context.getResources().getDimensionPixelSize(
                com.android.internal.R.dimen.docked_stack_divider_thickness);
        mSideMargin = dipToPixel(SIDE_MARGIN_DIP, mDisplayContent.getDisplayMetrics());
@@ -110,6 +108,12 @@ public class DockedStackDividerController implements View.OnTouchListener, DimLa
        return mView != null;
    }

    void updateDisplayInfo() {
        final DisplayInfo info = mDisplayContent.getDisplayInfo();
        mDisplayWidth = info.logicalWidth;
        mDisplayHeight = info.logicalHeight;
    }

    void update(Configuration configuration, boolean forceUpdate) {
        if (forceUpdate && mView != null) {
            removeDivider();