Loading src/com/android/launcher3/PagedView.java +2 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ import android.view.animation.Interpolator; import android.widget.ScrollView; import com.android.launcher3.anim.Interpolators; import com.android.launcher3.compat.AccessibilityManagerCompat; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.pageindicators.PageIndicator; import com.android.launcher3.touch.OverScroll; Loading Loading @@ -367,6 +368,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou */ protected void onPageEndTransition() { mWasInOverscroll = false; AccessibilityManagerCompat.sendScrollFinishedEventToTest(getContext()); } protected int getUnboundedScrollX() { Loading tests/tapl/com/android/launcher3/tapl/BaseOverview.java +6 −6 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.launcher3.tapl; import android.graphics.Rect; import androidx.annotation.NonNull; import androidx.test.uiautomator.BySelector; import androidx.test.uiautomator.Direction; Loading Loading @@ -49,9 +51,8 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { mLauncher.addContextLayer("want to fling forward in overview")) { LauncherInstrumentation.log("Overview.flingForward before fling"); final UiObject2 overview = verifyActiveContainer(); overview.setGestureMargins(mLauncher.getEdgeSensitivityWidth(), 0, 0, 0); overview.fling(Direction.LEFT, (int) (FLING_SPEED * mLauncher.getDisplayDensity())); mLauncher.waitForIdle(); mLauncher.scroll(overview, Direction.LEFT, 1, new Rect(mLauncher.getEdgeSensitivityWidth(), 0, 0, 0), 20); verifyActiveContainer(); } } Loading Loading @@ -86,9 +87,8 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { mLauncher.addContextLayer("want to fling backward in overview")) { LauncherInstrumentation.log("Overview.flingBackward before fling"); final UiObject2 overview = verifyActiveContainer(); overview.setGestureMargins(0, 0, mLauncher.getEdgeSensitivityWidth(), 0); overview.fling(Direction.RIGHT, (int) (FLING_SPEED * mLauncher.getDisplayDensity())); mLauncher.waitForIdle(); mLauncher.scroll(overview, Direction.RIGHT, 1, new Rect(0, 0, mLauncher.getEdgeSensitivityWidth(), 0), 20); verifyActiveContainer(); } } Loading tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +16 −0 Original line number Diff line number Diff line Loading @@ -834,6 +834,22 @@ public final class LauncherInstrumentation { endY = (int) (vertCenter - halfGestureHeight); } break; case LEFT: { startY = endY = rect.centerY(); final int horizCenter = rect.centerX(); final float halfGestureWidth = rect.width() * percent / 2.0f; startX = (int) (horizCenter - halfGestureWidth); endX = (int) (horizCenter + halfGestureWidth); } break; case RIGHT: { startY = endY = rect.centerY(); final int horizCenter = rect.centerX(); final float halfGestureWidth = rect.width() * percent / 2.0f; startX = (int) (horizCenter + halfGestureWidth); endX = (int) (horizCenter - halfGestureWidth); } break; default: fail("Unsupported direction"); return; Loading Loading
src/com/android/launcher3/PagedView.java +2 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ import android.view.animation.Interpolator; import android.widget.ScrollView; import com.android.launcher3.anim.Interpolators; import com.android.launcher3.compat.AccessibilityManagerCompat; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.pageindicators.PageIndicator; import com.android.launcher3.touch.OverScroll; Loading Loading @@ -367,6 +368,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou */ protected void onPageEndTransition() { mWasInOverscroll = false; AccessibilityManagerCompat.sendScrollFinishedEventToTest(getContext()); } protected int getUnboundedScrollX() { Loading
tests/tapl/com/android/launcher3/tapl/BaseOverview.java +6 −6 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.launcher3.tapl; import android.graphics.Rect; import androidx.annotation.NonNull; import androidx.test.uiautomator.BySelector; import androidx.test.uiautomator.Direction; Loading Loading @@ -49,9 +51,8 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { mLauncher.addContextLayer("want to fling forward in overview")) { LauncherInstrumentation.log("Overview.flingForward before fling"); final UiObject2 overview = verifyActiveContainer(); overview.setGestureMargins(mLauncher.getEdgeSensitivityWidth(), 0, 0, 0); overview.fling(Direction.LEFT, (int) (FLING_SPEED * mLauncher.getDisplayDensity())); mLauncher.waitForIdle(); mLauncher.scroll(overview, Direction.LEFT, 1, new Rect(mLauncher.getEdgeSensitivityWidth(), 0, 0, 0), 20); verifyActiveContainer(); } } Loading Loading @@ -86,9 +87,8 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { mLauncher.addContextLayer("want to fling backward in overview")) { LauncherInstrumentation.log("Overview.flingBackward before fling"); final UiObject2 overview = verifyActiveContainer(); overview.setGestureMargins(0, 0, mLauncher.getEdgeSensitivityWidth(), 0); overview.fling(Direction.RIGHT, (int) (FLING_SPEED * mLauncher.getDisplayDensity())); mLauncher.waitForIdle(); mLauncher.scroll(overview, Direction.RIGHT, 1, new Rect(0, 0, mLauncher.getEdgeSensitivityWidth(), 0), 20); verifyActiveContainer(); } } Loading
tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +16 −0 Original line number Diff line number Diff line Loading @@ -834,6 +834,22 @@ public final class LauncherInstrumentation { endY = (int) (vertCenter - halfGestureHeight); } break; case LEFT: { startY = endY = rect.centerY(); final int horizCenter = rect.centerX(); final float halfGestureWidth = rect.width() * percent / 2.0f; startX = (int) (horizCenter - halfGestureWidth); endX = (int) (horizCenter + halfGestureWidth); } break; case RIGHT: { startY = endY = rect.centerY(); final int horizCenter = rect.centerX(); final float halfGestureWidth = rect.width() * percent / 2.0f; startX = (int) (horizCenter + halfGestureWidth); endX = (int) (horizCenter - halfGestureWidth); } break; default: fail("Unsupported direction"); return; Loading