diff options
author | vadimt <vadimt@google.com> | 2019-05-08 15:29:37 -0700 |
---|---|---|
committer | vadimt <vadimt@google.com> | 2019-05-08 17:20:34 -0700 |
commit | 1b383af65211c57dce66349e13cf7b6123bddbc7 (patch) | |
tree | 9a7428cc4a54fbee6b71361cd231b23989d794c6 /tests/src/com/android | |
parent | e627accf264f75bfa70f8df12c10292b23ef0a12 (diff) | |
download | android_packages_apps_Trebuchet-1b383af65211c57dce66349e13cf7b6123bddbc7.tar.gz android_packages_apps_Trebuchet-1b383af65211c57dce66349e13cf7b6123bddbc7.tar.bz2 android_packages_apps_Trebuchet-1b383af65211c57dce66349e13cf7b6123bddbc7.zip |
Not using magic constants for navbar height
Change-Id: I6783b8a2ebb059ce35748d8c3e818cbe732ff40d
Diffstat (limited to 'tests/src/com/android')
-rw-r--r-- | tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java index 75db2f19e..b6878bba6 100644 --- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java @@ -51,6 +51,7 @@ import com.android.launcher3.LauncherModel; import com.android.launcher3.LauncherSettings; import com.android.launcher3.LauncherState; import com.android.launcher3.MainThreadExecutor; +import com.android.launcher3.ResourceUtils; import com.android.launcher3.Utilities; import com.android.launcher3.compat.LauncherAppsCompat; import com.android.launcher3.tapl.LauncherInstrumentation; @@ -208,7 +209,9 @@ public abstract class AbstractLauncherUiTest { * @return the matching object. */ protected UiObject2 scrollAndFind(UiObject2 container, BySelector condition) { - container.setGestureMargins(0, 0, 0, 200); + final int margin = ResourceUtils.getNavbarSize( + ResourceUtils.NAVBAR_VERTICAL_SIZE, mLauncher.getResources()) + 1; + container.setGestureMargins(0, 0, 0, margin); int i = 0; for (; ; ) { @@ -216,7 +219,8 @@ public abstract class AbstractLauncherUiTest { mDevice.wait(Until.findObject(condition), SHORT_UI_TIMEOUT); UiObject2 widget = container.findObject(condition); if (widget != null && widget.getVisibleBounds().intersects( - 0, 0, mDevice.getDisplayWidth(), mDevice.getDisplayHeight() - 200)) { + 0, 0, mDevice.getDisplayWidth(), + mDevice.getDisplayHeight() - margin)) { return widget; } if (++i > 40) fail("Too many attempts"); |