From 7ae0f4523bcdaa62c49ad2ce3fc502cd9ec16e1e Mon Sep 17 00:00:00 2001 From: Chris Banes Date: Wed, 30 Nov 2016 05:07:57 +0000 Subject: [PATCH] Fix CollapsingToolbarLayout tests am: b539fd5711 Change-Id: Ida0b5a86948aaac6d010660275c4bd6a45d380db GitOrigin-RevId=61b3959efb64d18358645762023abf36cec2cc53 PiperOrigin-RevId: 140564437 --- tests/res/values/dimens.xml | 2 +- .../design/widget/AppBarWithCollapsingToolbarTest.java | 5 +++-- .../design/widget/AppBarWithToolbarAndTabsTest.java | 10 ++++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/res/values/dimens.xml b/tests/res/values/dimens.xml index 2451b42ac..b46a4ba1e 100644 --- a/tests/res/values/dimens.xml +++ b/tests/res/values/dimens.xml @@ -26,7 +26,7 @@ 16dip 20dip - 192dip + 160dip 32dip 40dp diff --git a/tests/src/android/support/design/widget/AppBarWithCollapsingToolbarTest.java b/tests/src/android/support/design/widget/AppBarWithCollapsingToolbarTest.java index 9754f5575..4199fa9d5 100644 --- a/tests/src/android/support/design/widget/AppBarWithCollapsingToolbarTest.java +++ b/tests/src/android/support/design/widget/AppBarWithCollapsingToolbarTest.java @@ -159,11 +159,12 @@ public class AppBarWithCollapsingToolbarTest extends AppBarLayoutBaseTest { assertAppBarElevation(0f); - // Perform a swipe-up gesture across the horizontal center of the screen. + // Perform a swipe-up gesture across the horizontal center of the screen, starting from + // just below the AppBarLayout performVerticalSwipeUpGesture( R.id.coordinator_layout, centerX, - originalAppbarBottom + longSwipeAmount / 2, + originalAppbarBottom + 20, longSwipeAmount); mAppBar.getLocationOnScreen(appbarOnScreenXY); diff --git a/tests/src/android/support/design/widget/AppBarWithToolbarAndTabsTest.java b/tests/src/android/support/design/widget/AppBarWithToolbarAndTabsTest.java index a4f4a8969..c35b89354 100644 --- a/tests/src/android/support/design/widget/AppBarWithToolbarAndTabsTest.java +++ b/tests/src/android/support/design/widget/AppBarWithToolbarAndTabsTest.java @@ -64,11 +64,12 @@ public class AppBarWithToolbarAndTabsTest extends AppBarLayoutBaseTest { final int longSwipeAmount = 3 * appbarHeight / 2; final int shortSwipeAmount = toolbarHeight; - // Perform a swipe-up gesture across the horizontal center of the screen. + // Perform a swipe-up gesture across the horizontal center of the screen, starting from + // just below the AppBarLayout performVerticalSwipeUpGesture( R.id.coordinator_layout, centerX, - originalAppbarBottom + 3 * longSwipeAmount / 2, + originalAppbarBottom + 20, longSwipeAmount); mAppBar.getLocationOnScreen(appbarOnScreenXY); @@ -156,11 +157,12 @@ public class AppBarWithToolbarAndTabsTest extends AppBarLayoutBaseTest { final int longSwipeAmount = 3 * appbarHeight / 2; final int shortSwipeAmount = toolbarHeight; - // Perform a swipe-up gesture across the horizontal center of the screen. + // Perform a swipe-up gesture across the horizontal center of the screen, starting from + // just below the AppBarLayout performVerticalSwipeUpGesture( R.id.coordinator_layout, centerX, - originalAppbarBottom + 3 * longSwipeAmount / 2, + originalAppbarBottom + 20, longSwipeAmount); mAppBar.getLocationOnScreen(appbarOnScreenXY);