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

Commit 180c2e10 authored by vadimt's avatar vadimt Committed by Vadim Tryshev
Browse files

Adding diags to getWidget

Also avoiding scrolling widgets horizontally when the gesture could
happen in the lower system gesture area.

Change-Id: I80192db7e407f8c1715aad3b96178c00b5710e71
parent 16cd3677
Loading
Loading
Loading
Loading
+12 −11
Original line number Diff line number Diff line
@@ -88,7 +88,8 @@ public final class Widgets extends LauncherInstrumentation.VisibleContainer {
    }

    public Widget getWidget(String labelText) {
        try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
        try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck();
             LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
                     "getting widget " + labelText + " in widgets list")) {
            final UiObject2 widgetsContainer = verifyActiveContainer();
            final Point displaySize = mLauncher.getRealDisplaySize();
@@ -114,6 +115,8 @@ public final class Widgets extends LauncherInstrumentation.VisibleContainer {
                        maxWidth = Math.max(mLauncher.getVisibleBounds(sibling).width(), maxWidth);
                    }

                    if (mLauncher.getVisibleBounds(widget).bottom
                            <= displaySize.y - mLauncher.getBottomGestureSize()) {
                        int visibleDelta = maxWidth - mLauncher.getVisibleBounds(widget).width();
                        if (visibleDelta > 0) {
                            Rect parentBounds = mLauncher.getVisibleBounds(cell);
@@ -123,8 +126,6 @@ public final class Widgets extends LauncherInstrumentation.VisibleContainer {
                                    parentBounds.centerY(), 10, true, GestureScope.INSIDE);
                        }

                    if (mLauncher.getVisibleBounds(widget).bottom
                            <= displaySize.y - mLauncher.getBottomGestureSize()) {
                        return new Widget(mLauncher, widget);
                    }
                }