Merge "Adding diags to getWidget" into ub-launcher3-rvc-dev

This commit is contained in:
TreeHugger Robot 2020-04-09 04:47:09 +00:00 committed by Android (Google) Code Review
commit e8fade9140
1 changed files with 12 additions and 11 deletions

View File

@ -91,8 +91,9 @@ public final class Widgets extends LauncherInstrumentation.VisibleContainer {
}
public Widget getWidget(String labelText) {
try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
"getting widget " + labelText + " in widgets list")) {
try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck();
LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
"getting widget " + labelText + " in widgets list")) {
final UiObject2 widgetsContainer = verifyActiveContainer();
mLauncher.assertTrue("Widgets container didn't become scrollable",
widgetsContainer.wait(Until.scrollable(true), WAIT_TIME_MS));
@ -119,17 +120,17 @@ public final class Widgets extends LauncherInstrumentation.VisibleContainer {
maxWidth = Math.max(mLauncher.getVisibleBounds(sibling).width(), maxWidth);
}
int visibleDelta = maxWidth - mLauncher.getVisibleBounds(widget).width();
if (visibleDelta > 0) {
Rect parentBounds = mLauncher.getVisibleBounds(cell);
mLauncher.linearGesture(parentBounds.centerX() + visibleDelta
+ mLauncher.getTouchSlop(),
parentBounds.centerY(), parentBounds.centerX(),
parentBounds.centerY(), 10, true, GestureScope.INSIDE);
}
if (mLauncher.getVisibleBounds(widget).bottom
<= displaySize.y - mLauncher.getBottomGestureSize()) {
int visibleDelta = maxWidth - mLauncher.getVisibleBounds(widget).width();
if (visibleDelta > 0) {
Rect parentBounds = mLauncher.getVisibleBounds(cell);
mLauncher.linearGesture(parentBounds.centerX() + visibleDelta
+ mLauncher.getTouchSlop(),
parentBounds.centerY(), parentBounds.centerX(),
parentBounds.centerY(), 10, true, GestureScope.INSIDE);
}
return new Widget(mLauncher, widget);
}
}