Merge "Adding diags to getWidget" into ub-launcher3-rvc-dev
This commit is contained in:
commit
e8fade9140
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue