From 58fa4b66ea2e693ff59374d8081ddb54a91c7056 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Fri, 22 Mar 2019 16:23:25 -0700 Subject: [PATCH 01/19] Removing some redundant resource definitions Change-Id: I68ae602116e6eb334dfce2a013fcc42068c464bf --- res/values-land/dimens.xml | 3 -- res/values/dimens.xml | 3 -- src/com/android/launcher3/DeviceProfile.java | 36 ++++++++----------- src/com/android/launcher3/DropTargetBar.java | 2 +- .../launcher3/InvariantDeviceProfile.java | 8 +++++ src/com/android/launcher3/Workspace.java | 4 +-- 6 files changed, 26 insertions(+), 30 deletions(-) diff --git a/res/values-land/dimens.xml b/res/values-land/dimens.xml index b2f357565f..bc658e4830 100644 --- a/res/values-land/dimens.xml +++ b/res/values-land/dimens.xml @@ -27,9 +27,6 @@ 4dp - 0dp - 5.5dp - 16dp diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 04e4591be1..7822e0547a 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -22,13 +22,10 @@ 8dp 1dp 8dp - 8dp - 8dp 8dp 5.5dp - 0dp 8dp diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 7919d29358..6397e14ac0 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -16,8 +16,6 @@ package com.android.launcher3; -import android.appwidget.AppWidgetHostView; -import android.content.ComponentName; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; @@ -70,9 +68,6 @@ public class DeviceProfile { public final int cellLayoutPaddingLeftRightPx; public final int cellLayoutBottomPaddingPx; public final int edgeMarginPx; - public final Rect defaultWidgetPadding; - public final int defaultPageSpacingPx; - private final int topWorkspacePadding; public float workspaceSpringLoadShrinkFactor; public final int workspaceSpringLoadedBottomSpace; @@ -177,26 +172,25 @@ public class DeviceProfile { : Configuration.ORIENTATION_PORTRAIT); res = context.getResources(); - - ComponentName cn = new ComponentName(context.getPackageName(), - this.getClass().getName()); - defaultWidgetPadding = AppWidgetHostView.getDefaultPaddingForWidget(context, cn, null); edgeMarginPx = res.getDimensionPixelSize(R.dimen.dynamic_grid_edge_margin); desiredWorkspaceLeftRightMarginPx = isVerticalBarLayout() ? 0 : edgeMarginPx; + int cellLayoutPaddingLeftRightMultiplier = !isVerticalBarLayout() && isTablet ? PORTRAIT_TABLET_LEFT_RIGHT_PADDING_MULTIPLIER : 1; - cellLayoutPaddingLeftRightPx = cellLayoutPaddingLeftRightMultiplier * - res.getDimensionPixelSize(R.dimen.dynamic_grid_cell_layout_padding); - cellLayoutBottomPaddingPx = - res.getDimensionPixelSize(R.dimen.dynamic_grid_cell_layout_bottom_padding); + int cellLayoutPadding = res.getDimensionPixelSize(R.dimen.dynamic_grid_cell_layout_padding); + if (isLandscape) { + cellLayoutPaddingLeftRightPx = 0; + cellLayoutBottomPaddingPx = cellLayoutPadding; + } else { + cellLayoutPaddingLeftRightPx = cellLayoutPaddingLeftRightMultiplier * cellLayoutPadding; + cellLayoutBottomPaddingPx = 0; + } + verticalDragHandleSizePx = res.getDimensionPixelSize( R.dimen.vertical_drag_handle_size); verticalDragHandleOverlapWorkspace = res.getDimensionPixelSize(R.dimen.vertical_drag_handle_overlap_workspace); - defaultPageSpacingPx = - res.getDimensionPixelSize(R.dimen.dynamic_grid_workspace_page_spacing); - topWorkspacePadding = - res.getDimensionPixelSize(R.dimen.dynamic_grid_workspace_top_padding); + iconDrawablePaddingOriginalPx = res.getDimensionPixelSize(R.dimen.dynamic_grid_icon_drawable_padding); dropTargetBarSizePx = res.getDimensionPixelSize(R.dimen.dynamic_grid_drop_target_size); @@ -360,7 +354,7 @@ public class DeviceProfile { if (!isVerticalLayout) { int expectedWorkspaceHeight = availableHeightPx - hotseatBarSizePx - - verticalDragHandleSizePx - topWorkspacePadding; + - verticalDragHandleSizePx - edgeMarginPx; float minRequiredHeight = dropTargetBarSizePx + workspaceSpringLoadedBottomSpace; workspaceSpringLoadShrinkFactor = Math.min( res.getInteger(R.integer.config_workspaceSpringLoadShrinkPercentage) / 100.0f, @@ -471,15 +465,15 @@ public class DeviceProfile { ((inv.numColumns - 1) * cellWidthPx))); availablePaddingX = (int) Math.min(availablePaddingX, widthPx * MAX_HORIZONTAL_PADDING_PERCENT); - int availablePaddingY = Math.max(0, heightPx - topWorkspacePadding - paddingBottom + int availablePaddingY = Math.max(0, heightPx - edgeMarginPx - paddingBottom - (2 * inv.numRows * cellHeightPx) - hotseatBarTopPaddingPx - hotseatBarBottomPaddingPx); - padding.set(availablePaddingX / 2, topWorkspacePadding + availablePaddingY / 2, + padding.set(availablePaddingX / 2, edgeMarginPx + availablePaddingY / 2, availablePaddingX / 2, paddingBottom + availablePaddingY / 2); } else { // Pad the top and bottom of the workspace with search/hotseat bar sizes padding.set(desiredWorkspaceLeftRightMarginPx, - topWorkspacePadding, + edgeMarginPx, desiredWorkspaceLeftRightMarginPx, paddingBottom); } diff --git a/src/com/android/launcher3/DropTargetBar.java b/src/com/android/launcher3/DropTargetBar.java index d025a9b992..0543e8d710 100644 --- a/src/com/android/launcher3/DropTargetBar.java +++ b/src/com/android/launcher3/DropTargetBar.java @@ -104,7 +104,7 @@ public class DropTargetBar extends FrameLayout / (2 * (grid.inv.numColumns + 1))) + grid.edgeMarginPx; } else { - gap = grid.desiredWorkspaceLeftRightMarginPx - grid.defaultWidgetPadding.right; + gap = grid.desiredWorkspaceLeftRightMarginPx - grid.inv.defaultWidgetPadding.right; } lp.width = grid.availableWidthPx - 2 * gap; diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java index f081303148..c4495c7143 100644 --- a/src/com/android/launcher3/InvariantDeviceProfile.java +++ b/src/com/android/launcher3/InvariantDeviceProfile.java @@ -20,7 +20,9 @@ import static com.android.launcher3.config.FeatureFlags.APPLY_CONFIG_AT_RUNTIME; import static com.android.launcher3.Utilities.getDevicePrefs; import android.annotation.TargetApi; +import android.appwidget.AppWidgetHostView; import android.content.BroadcastReceiver; +import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; @@ -29,6 +31,7 @@ import android.content.res.Resources; import android.content.res.TypedArray; import android.content.res.XmlResourceParser; import android.graphics.Point; +import android.graphics.Rect; import android.text.TextUtils; import android.util.AttributeSet; import android.util.DisplayMetrics; @@ -114,6 +117,7 @@ public class InvariantDeviceProfile { public DeviceProfile portraitProfile; public Point defaultWallpaperSize; + public Rect defaultWidgetPadding; private final ArrayList mChangeListeners = new ArrayList<>(); private ConfigMonitor mConfigMonitor; @@ -235,6 +239,10 @@ public class InvariantDeviceProfile { } else { defaultWallpaperSize = new Point(Math.max(smallSide * 2, largeSide), largeSide); } + + ComponentName cn = new ComponentName(context.getPackageName(), getClass().getName()); + defaultWidgetPadding = AppWidgetHostView.getDefaultPaddingForWidget(context, cn, null); + return closestProfile.name; } diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 720a692361..d05f916372 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -298,12 +298,12 @@ public class Workspace extends PagedView if (grid.shouldFadeAdjacentWorkspaceScreens()) { // In landscape mode the page spacing is set to the default. - setPageSpacing(grid.defaultPageSpacingPx); + setPageSpacing(grid.edgeMarginPx); } else { // In portrait, we want the pages spaced such that there is no // overhang of the previous / next page into the current page viewport. // We assume symmetrical padding in portrait mode. - setPageSpacing(Math.max(grid.defaultPageSpacingPx, padding.left + 1)); + setPageSpacing(Math.max(grid.edgeMarginPx, padding.left + 1)); } int paddingLeftRight = grid.cellLayoutPaddingLeftRightPx; From 56635d4f8532ac368e25224c6b4fb79328bc3497 Mon Sep 17 00:00:00 2001 From: Bill Yi Date: Sat, 23 Mar 2019 08:05:19 -0700 Subject: [PATCH 02/19] Import translations. DO NOT MERGE Change-Id: Ibed07a95d0eb703afc04a19e9c0018944ffaf9f7 Auto-generated-cl: translation import --- quickstep/res/values-ca/strings.xml | 1 - quickstep/res/values-fr-rCA/strings.xml | 1 - quickstep/res/values-fr/strings.xml | 1 - quickstep/res/values-ko/strings.xml | 1 - quickstep/res/values-ta/strings.xml | 1 - 5 files changed, 5 deletions(-) diff --git a/quickstep/res/values-ca/strings.xml b/quickstep/res/values-ca/strings.xml index d120a2c358..484f445db7 100644 --- a/quickstep/res/values-ca/strings.xml +++ b/quickstep/res/values-ca/strings.xml @@ -30,6 +30,5 @@ "Aplicacions recents" "%1$s; %2$s" "< 1 minut" - "App en escala de grisos" "temps restant avui: %1$s" diff --git a/quickstep/res/values-fr-rCA/strings.xml b/quickstep/res/values-fr-rCA/strings.xml index 068fd0889f..248a5da5ee 100644 --- a/quickstep/res/values-fr-rCA/strings.xml +++ b/quickstep/res/values-fr-rCA/strings.xml @@ -30,6 +30,5 @@ "Applications récentes" "%1$s : %2$s" "< 1 min" - "Application en nuances de gris" "Il reste %1$s aujourd\'hui" diff --git a/quickstep/res/values-fr/strings.xml b/quickstep/res/values-fr/strings.xml index ea5b0dc623..338d9baff7 100644 --- a/quickstep/res/values-fr/strings.xml +++ b/quickstep/res/values-fr/strings.xml @@ -30,6 +30,5 @@ "Applications récentes" "%1$s, %2$s" "< 1 min" - "Appli en nuances de gris" "Encore %1$s aujourd\'hui" diff --git a/quickstep/res/values-ko/strings.xml b/quickstep/res/values-ko/strings.xml index 5daa508ed4..9543e7987f 100644 --- a/quickstep/res/values-ko/strings.xml +++ b/quickstep/res/values-ko/strings.xml @@ -30,6 +30,5 @@ "최근 앱" "%1$s, %2$s" "< 1분" - "앱이 그레이 스케일로 전환됨" "오늘 %1$s 남음" diff --git a/quickstep/res/values-ta/strings.xml b/quickstep/res/values-ta/strings.xml index ecc8f6c733..19bfaa92f7 100644 --- a/quickstep/res/values-ta/strings.xml +++ b/quickstep/res/values-ta/strings.xml @@ -30,6 +30,5 @@ "சமீபத்திய ஆப்ஸ்" "%1$s, %2$s" "< 1 நி" - "கிரேஸ்கேலில் உள்ள ஆப்ஸ்" "இன்று %1$s மீதமுள்ளது" From 6d862386fb7fdb620c663a6366796ea3dba743e6 Mon Sep 17 00:00:00 2001 From: Vadim Tryshev Date: Thu, 30 Aug 2018 16:01:47 -0700 Subject: [PATCH 03/19] Slowing down some gestures for testing on virtual devices Change-Id: Ie8b9a4eff3e9b4c133719a6292d2d251b87b90e8 --- tests/tapl/com/android/launcher3/tapl/AllApps.java | 2 +- .../com/android/launcher3/tapl/LauncherInstrumentation.java | 5 +++++ tests/tapl/com/android/launcher3/tapl/Workspace.java | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/tapl/com/android/launcher3/tapl/AllApps.java b/tests/tapl/com/android/launcher3/tapl/AllApps.java index 122151e9d2..7ab91bc863 100644 --- a/tests/tapl/com/android/launcher3/tapl/AllApps.java +++ b/tests/tapl/com/android/launcher3/tapl/AllApps.java @@ -29,7 +29,7 @@ import com.android.launcher3.TestProtocol; public class AllApps extends LauncherInstrumentation.VisibleContainer { private static final int MAX_SCROLL_ATTEMPTS = 40; private static final int MIN_INTERACT_SIZE = 100; - private static final int FLING_SPEED = 3000; + private static final int FLING_SPEED = LauncherInstrumentation.needSlowGestures() ? 1000 : 3000; private final int mHeight; diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index f44022baac..f7de2f95cc 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -26,6 +26,7 @@ import android.content.ContentResolver; import android.content.Context; import android.graphics.Point; import android.net.Uri; +import android.os.Build; import android.os.Bundle; import android.os.Parcelable; import android.os.SystemClock; @@ -161,6 +162,10 @@ public final class LauncherInstrumentation { return isSwipeUpEnabled() ? NavigationModel.TWO_BUTTON : NavigationModel.THREE_BUTTON; } + static boolean needSlowGestures() { + return Build.MODEL.contains("Cuttlefish"); + } + private boolean isSwipeUpEnabled() { final boolean swipeUpEnabledDefaultValue = SwipeUpSetting.isSwipeUpEnabledDefaultValue(); return SwipeUpSetting.isSwipeUpSettingAvailable() ? diff --git a/tests/tapl/com/android/launcher3/tapl/Workspace.java b/tests/tapl/com/android/launcher3/tapl/Workspace.java index 7d97acd754..6868e1e498 100644 --- a/tests/tapl/com/android/launcher3/tapl/Workspace.java +++ b/tests/tapl/com/android/launcher3/tapl/Workspace.java @@ -36,7 +36,7 @@ import com.android.launcher3.TestProtocol; public final class Workspace extends Home { private static final float FLING_SPEED = 3500.0F; private final UiObject2 mHotseat; - private final int ICON_DRAG_SPEED = 2000; + private final int ICON_DRAG_SPEED = LauncherInstrumentation.needSlowGestures() ? 100 : 570; Workspace(LauncherInstrumentation launcher) { super(launcher); @@ -107,7 +107,7 @@ public final class Workspace extends Home { getHotseatAppIcon("Messages"), new Point(mLauncher.getDevice().getDisplayWidth(), workspace.getVisibleBounds().centerY()), - ICON_DRAG_SPEED); + (int) (ICON_DRAG_SPEED * mLauncher.getDisplayDensity())); verifyActiveContainer(); } assertTrue("Home screen workspace didn't become scrollable", From 4397d8d5ea53e4b31d6e445ec048bc21ad87a560 Mon Sep 17 00:00:00 2001 From: vadimt Date: Fri, 22 Mar 2019 18:15:35 -0700 Subject: [PATCH 04/19] Improving TAPL diagnostics Bug: 128531133 Change-Id: If81861afccb665e2dc2293f2704d99818b3297c8 --- .../com/android/launcher3/tapl/AllApps.java | 107 ++++++++------ .../launcher3/tapl/AllAppsFromOverview.java | 30 ++-- .../android/launcher3/tapl/Background.java | 13 +- .../android/launcher3/tapl/BaseOverview.java | 83 ++++++----- .../tapl/com/android/launcher3/tapl/Home.java | 12 +- .../android/launcher3/tapl/Launchable.java | 9 +- .../tapl/LauncherInstrumentation.java | 132 +++++++++++------- .../com/android/launcher3/tapl/Overview.java | 24 ++-- .../android/launcher3/tapl/OverviewTask.java | 13 +- .../com/android/launcher3/tapl/Widgets.java | 30 ++-- .../com/android/launcher3/tapl/Workspace.java | 48 ++++--- 11 files changed, 308 insertions(+), 193 deletions(-) diff --git a/tests/tapl/com/android/launcher3/tapl/AllApps.java b/tests/tapl/com/android/launcher3/tapl/AllApps.java index 7ab91bc863..b78500788b 100644 --- a/tests/tapl/com/android/launcher3/tapl/AllApps.java +++ b/tests/tapl/com/android/launcher3/tapl/AllApps.java @@ -60,47 +60,59 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer { */ @NonNull public AppIcon getAppIcon(String appName) { - final UiObject2 allAppsContainer = verifyActiveContainer(); - final BySelector appIconSelector = AppIcon.getAppIconSelector(appName, mLauncher); - if (!hasClickableIcon(allAppsContainer, appIconSelector)) { - scrollBackToBeginning(); - int attempts = 0; - while (!hasClickableIcon(allAppsContainer, appIconSelector) && - allAppsContainer.scroll(Direction.DOWN, 0.8f)) { - LauncherInstrumentation.assertTrue( - "Exceeded max scroll attempts: " + MAX_SCROLL_ATTEMPTS, - ++attempts <= MAX_SCROLL_ATTEMPTS); + try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer( + "want to get app icon on all apps")) { + final UiObject2 allAppsContainer = verifyActiveContainer(); + final BySelector appIconSelector = AppIcon.getAppIconSelector(appName, mLauncher); + if (!hasClickableIcon(allAppsContainer, appIconSelector)) { + scrollBackToBeginning(); + int attempts = 0; + try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer("scrolled")) { + while (!hasClickableIcon(allAppsContainer, appIconSelector) && + allAppsContainer.scroll(Direction.DOWN, 0.8f)) { + mLauncher.assertTrue( + "Exceeded max scroll attempts: " + MAX_SCROLL_ATTEMPTS, + ++attempts <= MAX_SCROLL_ATTEMPTS); + verifyActiveContainer(); + } + } verifyActiveContainer(); } - } - verifyActiveContainer(); - final UiObject2 appIcon = mLauncher.getObjectInContainer(allAppsContainer, appIconSelector); - ensureIconVisible(appIcon, allAppsContainer); - return new AppIcon(mLauncher, appIcon); + final UiObject2 appIcon = mLauncher.getObjectInContainer(allAppsContainer, + appIconSelector); + ensureIconVisible(appIcon, allAppsContainer); + return new AppIcon(mLauncher, appIcon); + } } private void scrollBackToBeginning() { - final UiObject2 allAppsContainer = verifyActiveContainer(); - final UiObject2 searchBox = - mLauncher.waitForObjectInContainer(allAppsContainer, "search_container_all_apps"); + try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer( + "want to scroll back in all apps")) { + final UiObject2 allAppsContainer = verifyActiveContainer(); + final UiObject2 searchBox = + mLauncher.waitForObjectInContainer(allAppsContainer, + "search_container_all_apps"); - int attempts = 0; - allAppsContainer.setGestureMargins(0, searchBox.getVisibleBounds().bottom + 1, 0, 5); + int attempts = 0; + allAppsContainer.setGestureMargins(0, searchBox.getVisibleBounds().bottom + 1, 0, 5); - for (int scroll = getScroll(allAppsContainer); - scroll != 0; - scroll = getScroll(allAppsContainer)) { - LauncherInstrumentation.assertTrue("Negative scroll position", scroll > 0); + for (int scroll = getScroll(allAppsContainer); + scroll != 0; + scroll = getScroll(allAppsContainer)) { + mLauncher.assertTrue("Negative scroll position", scroll > 0); - LauncherInstrumentation.assertTrue( - "Exceeded max scroll attempts: " + MAX_SCROLL_ATTEMPTS, - ++attempts <= MAX_SCROLL_ATTEMPTS); + mLauncher.assertTrue( + "Exceeded max scroll attempts: " + MAX_SCROLL_ATTEMPTS, + ++attempts <= MAX_SCROLL_ATTEMPTS); - allAppsContainer.scroll(Direction.UP, 1); + allAppsContainer.scroll(Direction.UP, 1); + } + + try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer("scrolled up")) { + verifyActiveContainer(); + } } - - verifyActiveContainer(); } private int getScroll(UiObject2 allAppsContainer) { @@ -115,8 +127,11 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer { // to reveal the app icon to have the MIN_INTERACT_SIZE final float pct = Math.max(((float) (MIN_INTERACT_SIZE - appHeight)) / mHeight, 0.2f); allAppsContainer.scroll(Direction.DOWN, pct); - mLauncher.waitForIdle(); - verifyActiveContainer(); + try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer( + "scrolled an icon in all apps to make it visible - and then")) { + mLauncher.waitForIdle(); + verifyActiveContainer(); + } } } @@ -124,21 +139,29 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer { * Flings forward (down) and waits the fling's end. */ public void flingForward() { - final UiObject2 allAppsContainer = verifyActiveContainer(); - // Start the gesture in the center to avoid starting at elements near the top. - allAppsContainer.setGestureMargins(0, 0, 0, mHeight / 2); - allAppsContainer.fling(Direction.DOWN, (int) (FLING_SPEED * mLauncher.getDisplayDensity())); - verifyActiveContainer(); + try(LauncherInstrumentation.Closable c = + mLauncher.addContextLayer("want to fling forward in all apps")) { + final UiObject2 allAppsContainer = verifyActiveContainer(); + // Start the gesture in the center to avoid starting at elements near the top. + allAppsContainer.setGestureMargins(0, 0, 0, mHeight / 2); + allAppsContainer.fling(Direction.DOWN, + (int) (FLING_SPEED * mLauncher.getDisplayDensity())); + verifyActiveContainer(); + } } /** * Flings backward (up) and waits the fling's end. */ public void flingBackward() { - final UiObject2 allAppsContainer = verifyActiveContainer(); - // Start the gesture in the center, for symmetry with forward. - allAppsContainer.setGestureMargins(0, mHeight / 2, 0, 0); - allAppsContainer.fling(Direction.UP, (int) (FLING_SPEED * mLauncher.getDisplayDensity())); - verifyActiveContainer(); + try(LauncherInstrumentation.Closable c = + mLauncher.addContextLayer("want to fling backward in all apps")) { + final UiObject2 allAppsContainer = verifyActiveContainer(); + // Start the gesture in the center, for symmetry with forward. + allAppsContainer.setGestureMargins(0, mHeight / 2, 0, 0); + allAppsContainer.fling(Direction.UP, + (int) (FLING_SPEED * mLauncher.getDisplayDensity())); + verifyActiveContainer(); + } } } diff --git a/tests/tapl/com/android/launcher3/tapl/AllAppsFromOverview.java b/tests/tapl/com/android/launcher3/tapl/AllAppsFromOverview.java index dcc51b50ba..c3b671bcc2 100644 --- a/tests/tapl/com/android/launcher3/tapl/AllAppsFromOverview.java +++ b/tests/tapl/com/android/launcher3/tapl/AllAppsFromOverview.java @@ -42,20 +42,24 @@ public final class AllAppsFromOverview extends AllApps { */ @NonNull public Overview switchBackToOverview() { - final UiObject2 allAppsContainer = verifyActiveContainer(); - // Swipe from the search box to the bottom. - final UiObject2 qsb = mLauncher.waitForObjectInContainer( - allAppsContainer, "search_container_all_apps"); - final Point start = qsb.getVisibleCenter(); - final int swipeHeight = mLauncher.getTestInfo( - TestProtocol.REQUEST_ALL_APPS_TO_OVERVIEW_SWIPE_HEIGHT). - getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD); + try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer( + "want to switch back from all apps to overview")) { + final UiObject2 allAppsContainer = verifyActiveContainer(); + // Swipe from the search box to the bottom. + final UiObject2 qsb = mLauncher.waitForObjectInContainer( + allAppsContainer, "search_container_all_apps"); + final Point start = qsb.getVisibleCenter(); + final int swipeHeight = mLauncher.getTestInfo( + TestProtocol.REQUEST_ALL_APPS_TO_OVERVIEW_SWIPE_HEIGHT). + getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD); - final int endY = start.y + swipeHeight + mLauncher.getTouchSlop(); - LauncherInstrumentation.log("AllAppsFromOverview.switchBackToOverview before swipe"); - mLauncher.swipe(start.x, start.y, start.x, endY, OVERVIEW_STATE_ORDINAL); + final int endY = start.y + swipeHeight + mLauncher.getTouchSlop(); + LauncherInstrumentation.log("AllAppsFromOverview.switchBackToOverview before swipe"); + mLauncher.swipe(start.x, start.y, start.x, endY, OVERVIEW_STATE_ORDINAL); - return new Overview(mLauncher); + try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer("swiped down")) { + return new Overview(mLauncher); + } + } } - } diff --git a/tests/tapl/com/android/launcher3/tapl/Background.java b/tests/tapl/com/android/launcher3/tapl/Background.java index ef509edebe..26c0ca4ec7 100644 --- a/tests/tapl/com/android/launcher3/tapl/Background.java +++ b/tests/tapl/com/android/launcher3/tapl/Background.java @@ -57,11 +57,14 @@ public class Background extends LauncherInstrumentation.VisibleContainer { */ @NonNull public BaseOverview switchToOverview() { - verifyActiveContainer(); - goToOverviewUnchecked(BACKGROUND_APP_STATE_ORDINAL); - assertTrue("Overview not visible", mLauncher.getDevice().wait( - Until.hasObject(By.pkg(getOverviewPackageName())), WAIT_TIME_MS)); - return new BaseOverview(mLauncher); + try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer( + "want to switch from background to overview")) { + verifyActiveContainer(); + goToOverviewUnchecked(BACKGROUND_APP_STATE_ORDINAL); + assertTrue("Overview not visible", mLauncher.getDevice().wait( + Until.hasObject(By.pkg(getOverviewPackageName())), WAIT_TIME_MS)); + return new BaseOverview(mLauncher); + } } protected void goToOverviewUnchecked(int expectedState) { diff --git a/tests/tapl/com/android/launcher3/tapl/BaseOverview.java b/tests/tapl/com/android/launcher3/tapl/BaseOverview.java index 234c3bfd64..4205188098 100644 --- a/tests/tapl/com/android/launcher3/tapl/BaseOverview.java +++ b/tests/tapl/com/android/launcher3/tapl/BaseOverview.java @@ -44,42 +44,54 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { * Flings forward (left) and waits the fling's end. */ public void flingForward() { - LauncherInstrumentation.log("Overview.flingForward before fling"); - final UiObject2 overview = verifyActiveContainer(); - final int margin = (int) (50 * mLauncher.getDisplayDensity()) + 1; - overview.setGestureMargins(margin, 0, 0, 0); - overview.fling(Direction.LEFT, (int) (FLING_SPEED * mLauncher.getDisplayDensity())); - mLauncher.waitForIdle(); - verifyActiveContainer(); + try (LauncherInstrumentation.Closable c = + mLauncher.addContextLayer("want to fling forward in overview")) { + LauncherInstrumentation.log("Overview.flingForward before fling"); + final UiObject2 overview = verifyActiveContainer(); + final int margin = (int) (50 * mLauncher.getDisplayDensity()) + 1; + overview.setGestureMargins(margin, 0, 0, 0); + overview.fling(Direction.LEFT, (int) (FLING_SPEED * mLauncher.getDisplayDensity())); + mLauncher.waitForIdle(); + verifyActiveContainer(); + } } /** * Dismissed all tasks by scrolling to Clear-all button and pressing it. */ public Workspace dismissAllTasks() { - final BySelector clearAllSelector = mLauncher.getLauncherObjectSelector("clear_all"); - for (int i = 0; - i < FLINGS_FOR_DISMISS_LIMIT - && !verifyActiveContainer().hasObject(clearAllSelector); - ++i) { - flingForward(); - } + try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer( + "dismissing all tasks")) { + final BySelector clearAllSelector = mLauncher.getLauncherObjectSelector("clear_all"); + for (int i = 0; + i < FLINGS_FOR_DISMISS_LIMIT + && !verifyActiveContainer().hasObject(clearAllSelector); + ++i) { + flingForward(); + } - mLauncher.getObjectInContainer(verifyActiveContainer(), clearAllSelector).click(); - return new Workspace(mLauncher); + mLauncher.getObjectInContainer(verifyActiveContainer(), clearAllSelector).click(); + try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer( + "dismissed all tasks")) { + return new Workspace(mLauncher); + } + } } /** * Flings backward (right) and waits the fling's end. */ public void flingBackward() { - LauncherInstrumentation.log("Overview.flingBackward before fling"); - final UiObject2 overview = verifyActiveContainer(); - final int margin = (int) (50 * mLauncher.getDisplayDensity()) + 1; - overview.setGestureMargins(0, 0, margin, 0); - overview.fling(Direction.RIGHT, (int) (FLING_SPEED * mLauncher.getDisplayDensity())); - mLauncher.waitForIdle(); - verifyActiveContainer(); + try (LauncherInstrumentation.Closable c = + mLauncher.addContextLayer("want to fling backward in overview")) { + LauncherInstrumentation.log("Overview.flingBackward before fling"); + final UiObject2 overview = verifyActiveContainer(); + final int margin = (int) (50 * mLauncher.getDisplayDensity()) + 1; + overview.setGestureMargins(0, 0, margin, 0); + overview.fling(Direction.RIGHT, (int) (FLING_SPEED * mLauncher.getDisplayDensity())); + mLauncher.waitForIdle(); + verifyActiveContainer(); + } } /** @@ -89,18 +101,21 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { */ @NonNull public OverviewTask getCurrentTask() { - verifyActiveContainer(); - final List taskViews = mLauncher.getDevice().findObjects( - mLauncher.getLauncherObjectSelector("snapshot")); - LauncherInstrumentation.assertNotEquals("Unable to find a task", 0, taskViews.size()); + try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer( + "want to get current task")) { + verifyActiveContainer(); + final List taskViews = mLauncher.getDevice().findObjects( + mLauncher.getLauncherObjectSelector("snapshot")); + mLauncher.assertNotEquals("Unable to find a task", 0, taskViews.size()); - // taskViews contains up to 3 task views: the 'main' (having the widest visible - // part) one in the center, and parts of its right and left siblings. Find the - // main task view by its width. - final UiObject2 widestTask = Collections.max(taskViews, - (t1, t2) -> Integer.compare(t1.getVisibleBounds().width(), - t2.getVisibleBounds().width())); + // taskViews contains up to 3 task views: the 'main' (having the widest visible + // part) one in the center, and parts of its right and left siblings. Find the + // main task view by its width. + final UiObject2 widestTask = Collections.max(taskViews, + (t1, t2) -> Integer.compare(t1.getVisibleBounds().width(), + t2.getVisibleBounds().width())); - return new OverviewTask(mLauncher, widestTask, this); + return new OverviewTask(mLauncher, widestTask, this); + } } } \ No newline at end of file diff --git a/tests/tapl/com/android/launcher3/tapl/Home.java b/tests/tapl/com/android/launcher3/tapl/Home.java index f8bd85accc..20c116ce21 100644 --- a/tests/tapl/com/android/launcher3/tapl/Home.java +++ b/tests/tapl/com/android/launcher3/tapl/Home.java @@ -48,8 +48,14 @@ public abstract class Home extends Background { @NonNull @Override public Overview switchToOverview() { - verifyActiveContainer(); - goToOverviewUnchecked(OVERVIEW_STATE_ORDINAL); - return new Overview(mLauncher); + try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer( + "want to switch from home to overview")) { + verifyActiveContainer(); + goToOverviewUnchecked(OVERVIEW_STATE_ORDINAL); + try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer( + "performed the switch action")) { + return new Overview(mLauncher); + } + } } } \ No newline at end of file diff --git a/tests/tapl/com/android/launcher3/tapl/Launchable.java b/tests/tapl/com/android/launcher3/tapl/Launchable.java index 481281a3d5..7a2b7af5ae 100644 --- a/tests/tapl/com/android/launcher3/tapl/Launchable.java +++ b/tests/tapl/com/android/launcher3/tapl/Launchable.java @@ -59,10 +59,10 @@ class Launchable { private Background launch(String errorMessage, BySelector selector) { LauncherInstrumentation.log("Launchable.launch before click " + mObject.getVisibleCenter()); - LauncherInstrumentation.assertTrue( + mLauncher.assertTrue( "Launching an app didn't open a new window: " + mObject.getText(), mObject.clickAndWait(Until.newWindow(), LauncherInstrumentation.WAIT_TIME_MS)); - LauncherInstrumentation.assertTrue( + mLauncher.assertTrue( "App didn't start: " + errorMessage, mLauncher.getDevice().wait(Until.hasObject(selector), LauncherInstrumentation.WAIT_TIME_MS)); @@ -79,6 +79,9 @@ class Launchable { this, new Point(device.getDisplayWidth() / 2, device.getDisplayHeight() / 2), DRAG_SPEED); - return new Workspace(mLauncher); + try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer( + "dragged launchable to workspace")) { + return new Workspace(mLauncher); + } } } diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index f7de2f95cc..19b368f4f8 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -54,6 +54,8 @@ import org.junit.Assert; import java.io.IOException; import java.lang.ref.WeakReference; +import java.util.Deque; +import java.util.LinkedList; import java.util.List; import java.util.concurrent.TimeoutException; @@ -91,11 +93,16 @@ public final class LauncherInstrumentation { * @return UI object for the container. */ final UiObject2 verifyActiveContainer() { - assertTrue("Attempt to use a stale container", this == sActiveContainer.get()); + mLauncher.assertTrue("Attempt to use a stale container", + this == sActiveContainer.get()); return mLauncher.verifyContainerType(getContainerType()); } } + interface Closable extends AutoCloseable { + void close(); + } + private static final String WORKSPACE_RES_ID = "workspace"; private static final String APPS_RES_ID = "apps_view"; private static final String OVERVIEW_RES_ID = "overview_panel"; @@ -109,6 +116,7 @@ public final class LauncherInstrumentation { private final Instrumentation mInstrumentation; private int mExpectedRotation = Surface.ROTATION_0; private final Uri mTestProviderUri; + private final Deque mDiagnosticContext = new LinkedList<>(); /** * Constructs the root of TAPL hierarchy. You get all other objects from it. @@ -180,31 +188,38 @@ public final class LauncherInstrumentation { Log.d(TAG, message); } - private static void fail(String message) { - Assert.fail("http://go/tapl : " + message); + Closable addContextLayer(String piece) { + mDiagnosticContext.addLast(piece); + return () -> mDiagnosticContext.removeLast(); } - static void assertTrue(String message, boolean condition) { + private void fail(String message) { + final String ctxt = mDiagnosticContext.isEmpty() ? "" : String.join(", ", + mDiagnosticContext) + "; "; + Assert.fail("http://go/tapl : " + ctxt + message); + } + + void assertTrue(String message, boolean condition) { if (!condition) { fail(message); } } - static void assertNotNull(String message, Object object) { + void assertNotNull(String message, Object object) { assertTrue(message, object != null); } - static private void failEquals(String message, Object actual) { + private void failEquals(String message, Object actual) { fail(message + ". " + "Actual: " + actual); } - static private void assertEquals(String message, int expected, int actual) { + private void assertEquals(String message, int expected, int actual) { if (expected != actual) { fail(message + " expected: " + expected + " but was: " + actual); } } - static void assertNotEquals(String message, int unexpected, int actual) { + void assertNotEquals(String message, int unexpected, int actual) { if (unexpected == actual) { failEquals(message, actual); } @@ -222,49 +237,52 @@ public final class LauncherInstrumentation { (mDevice.findObject(By.res(SYSTEMUI_PACKAGE, "recent_apps")) == null)); log("verifyContainerType: " + containerType); - switch (containerType) { - case WORKSPACE: { - waitForLauncherObject(APPS_RES_ID); - waitUntilGone(OVERVIEW_RES_ID); - waitUntilGone(WIDGETS_RES_ID); - return waitForLauncherObject(WORKSPACE_RES_ID); - } - case WIDGETS: { - waitUntilGone(WORKSPACE_RES_ID); - waitUntilGone(APPS_RES_ID); - waitUntilGone(OVERVIEW_RES_ID); - return waitForLauncherObject(WIDGETS_RES_ID); - } - case ALL_APPS: { - waitUntilGone(WORKSPACE_RES_ID); - waitUntilGone(OVERVIEW_RES_ID); - waitUntilGone(WIDGETS_RES_ID); - return waitForLauncherObject(APPS_RES_ID); - } - case OVERVIEW: { - if (mDevice.isNaturalOrientation()) { + try (Closable c = addContextLayer( + "but the current state is not " + containerType.name())) { + switch (containerType) { + case WORKSPACE: { waitForLauncherObject(APPS_RES_ID); - } else { - waitUntilGone(APPS_RES_ID); + waitUntilGone(OVERVIEW_RES_ID); + waitUntilGone(WIDGETS_RES_ID); + return waitForLauncherObject(WORKSPACE_RES_ID); } - // Fall through - } - case BASE_OVERVIEW: { - waitUntilGone(WORKSPACE_RES_ID); - waitUntilGone(WIDGETS_RES_ID); + case WIDGETS: { + waitUntilGone(WORKSPACE_RES_ID); + waitUntilGone(APPS_RES_ID); + waitUntilGone(OVERVIEW_RES_ID); + return waitForLauncherObject(WIDGETS_RES_ID); + } + case ALL_APPS: { + waitUntilGone(WORKSPACE_RES_ID); + waitUntilGone(OVERVIEW_RES_ID); + waitUntilGone(WIDGETS_RES_ID); + return waitForLauncherObject(APPS_RES_ID); + } + case OVERVIEW: { + if (mDevice.isNaturalOrientation()) { + waitForLauncherObject(APPS_RES_ID); + } else { + waitUntilGone(APPS_RES_ID); + } + // Fall through + } + case BASE_OVERVIEW: { + waitUntilGone(WORKSPACE_RES_ID); + waitUntilGone(WIDGETS_RES_ID); - return waitForLauncherObject(OVERVIEW_RES_ID); + return waitForLauncherObject(OVERVIEW_RES_ID); + } + case BACKGROUND: { + waitUntilGone(WORKSPACE_RES_ID); + waitUntilGone(APPS_RES_ID); + waitUntilGone(OVERVIEW_RES_ID); + waitUntilGone(WIDGETS_RES_ID); + return null; + } + default: + fail("Invalid state: " + containerType); + return null; } - case BACKGROUND: { - waitUntilGone(WORKSPACE_RES_ID); - waitUntilGone(APPS_RES_ID); - waitUntilGone(OVERVIEW_RES_ID); - waitUntilGone(WIDGETS_RES_ID); - return null; - } - default: - fail("Invalid state: " + containerType); - return null; } } @@ -356,7 +374,9 @@ public final class LauncherInstrumentation { */ @NonNull public Workspace getWorkspace() { - return new Workspace(this); + try (LauncherInstrumentation.Closable c = addContextLayer("want to get workspace object")) { + return new Workspace(this); + } } /** @@ -378,7 +398,9 @@ public final class LauncherInstrumentation { */ @NonNull public Widgets getAllWidgets() { - return new Widgets(this); + try (LauncherInstrumentation.Closable c = addContextLayer("want to get widgets")) { + return new Widgets(this); + } } /** @@ -389,7 +411,9 @@ public final class LauncherInstrumentation { */ @NonNull public Overview getOverview() { - return new Overview(this); + try (LauncherInstrumentation.Closable c = addContextLayer("want to get overview")) { + return new Overview(this); + } } /** @@ -413,7 +437,9 @@ public final class LauncherInstrumentation { */ @NonNull public AllApps getAllApps() { - return new AllApps(this); + try (LauncherInstrumentation.Closable c = addContextLayer("want to get all apps object")) { + return new AllApps(this); + } } /** @@ -426,7 +452,9 @@ public final class LauncherInstrumentation { */ @NonNull public AllAppsFromOverview getAllAppsFromOverview() { - return new AllAppsFromOverview(this); + try (LauncherInstrumentation.Closable c = addContextLayer("want to get all apps object")) { + return new AllAppsFromOverview(this); + } } void waitUntilGone(String resId) { diff --git a/tests/tapl/com/android/launcher3/tapl/Overview.java b/tests/tapl/com/android/launcher3/tapl/Overview.java index 5c8d5eb12a..41932c8cbb 100644 --- a/tests/tapl/com/android/launcher3/tapl/Overview.java +++ b/tests/tapl/com/android/launcher3/tapl/Overview.java @@ -20,11 +20,11 @@ import static com.android.launcher3.TestProtocol.ALL_APPS_STATE_ORDINAL; import android.graphics.Point; -import com.android.launcher3.tapl.LauncherInstrumentation.ContainerType; - import androidx.annotation.NonNull; import androidx.test.uiautomator.UiObject2; +import com.android.launcher3.tapl.LauncherInstrumentation.ContainerType; + /** * Overview pane. */ @@ -47,14 +47,20 @@ public final class Overview extends BaseOverview { */ @NonNull public AllAppsFromOverview switchToAllApps() { - verifyActiveContainer(); + try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer( + "want to switch from overview to all apps")) { + verifyActiveContainer(); - // Swipe from navbar to the top. - final UiObject2 navBar = mLauncher.waitForSystemUiObject("navigation_bar_frame"); - final Point start = navBar.getVisibleCenter(); - LauncherInstrumentation.log("Overview.switchToAllApps before swipe"); - mLauncher.swipe(start.x, start.y, start.x, 0, ALL_APPS_STATE_ORDINAL); + // Swipe from navbar to the top. + final UiObject2 navBar = mLauncher.waitForSystemUiObject("navigation_bar_frame"); + final Point start = navBar.getVisibleCenter(); + LauncherInstrumentation.log("Overview.switchToAllApps before swipe"); + mLauncher.swipe(start.x, start.y, start.x, 0, ALL_APPS_STATE_ORDINAL); - return new AllAppsFromOverview(mLauncher); + try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer( + "swiped all way up from overview")) { + return new AllAppsFromOverview(mLauncher); + } + } } } diff --git a/tests/tapl/com/android/launcher3/tapl/OverviewTask.java b/tests/tapl/com/android/launcher3/tapl/OverviewTask.java index 7ccd49bd56..b9668513c3 100644 --- a/tests/tapl/com/android/launcher3/tapl/OverviewTask.java +++ b/tests/tapl/com/android/launcher3/tapl/OverviewTask.java @@ -44,10 +44,13 @@ public final class OverviewTask { * Swipes the task up. */ public void dismiss() { - verifyActiveContainer(); - // Dismiss the task via flinging it up. - mTask.fling(Direction.DOWN, (int) (FLING_SPEED * mLauncher.getDisplayDensity())); - mLauncher.waitForIdle(); + try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer( + "want to dismiss a task")) { + verifyActiveContainer(); + // Dismiss the task via flinging it up. + mTask.fling(Direction.DOWN, (int) (FLING_SPEED * mLauncher.getDisplayDensity())); + mLauncher.waitForIdle(); + } } /** @@ -55,7 +58,7 @@ public final class OverviewTask { */ public Background open() { verifyActiveContainer(); - LauncherInstrumentation.assertTrue("Launching task didn't open a new window: " + + mLauncher.assertTrue("Launching task didn't open a new window: " + mTask.getParent().getContentDescription(), mTask.clickAndWait(Until.newWindow(), LauncherInstrumentation.WAIT_TIME_MS)); return new Background(mLauncher); diff --git a/tests/tapl/com/android/launcher3/tapl/Widgets.java b/tests/tapl/com/android/launcher3/tapl/Widgets.java index 89affd1bb0..b6938d6bce 100644 --- a/tests/tapl/com/android/launcher3/tapl/Widgets.java +++ b/tests/tapl/com/android/launcher3/tapl/Widgets.java @@ -34,21 +34,33 @@ public final class Widgets extends LauncherInstrumentation.VisibleContainer { * Flings forward (down) and waits the fling's end. */ public void flingForward() { - final UiObject2 widgetsContainer = verifyActiveContainer(); - widgetsContainer.setGestureMargin(100); - widgetsContainer.fling(Direction.DOWN, (int) (FLING_SPEED * mLauncher.getDisplayDensity())); - verifyActiveContainer(); + try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer( + "want to fling forward in widgets")) { + final UiObject2 widgetsContainer = verifyActiveContainer(); + widgetsContainer.setGestureMargin(100); + widgetsContainer.fling(Direction.DOWN, + (int) (FLING_SPEED * mLauncher.getDisplayDensity())); + try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer("flung forward")) { + verifyActiveContainer(); + } + } } /** * Flings backward (up) and waits the fling's end. */ public void flingBackward() { - final UiObject2 widgetsContainer = verifyActiveContainer(); - widgetsContainer.setGestureMargin(100); - widgetsContainer.fling(Direction.UP, (int) (FLING_SPEED * mLauncher.getDisplayDensity())); - mLauncher.waitForIdle(); - verifyActiveContainer(); + try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer( + "want to fling backwards in widgets")) { + final UiObject2 widgetsContainer = verifyActiveContainer(); + widgetsContainer.setGestureMargin(100); + widgetsContainer.fling(Direction.UP, + (int) (FLING_SPEED * mLauncher.getDisplayDensity())); + mLauncher.waitForIdle(); + try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer("flung back")) { + verifyActiveContainer(); + } + } } @Override diff --git a/tests/tapl/com/android/launcher3/tapl/Workspace.java b/tests/tapl/com/android/launcher3/tapl/Workspace.java index 6868e1e498..9979f50a6d 100644 --- a/tests/tapl/com/android/launcher3/tapl/Workspace.java +++ b/tests/tapl/com/android/launcher3/tapl/Workspace.java @@ -50,21 +50,27 @@ public final class Workspace extends Home { */ @NonNull public AllApps switchToAllApps() { - verifyActiveContainer(); - final UiObject2 hotseat = mHotseat; - final Point start = hotseat.getVisibleCenter(); - final int swipeHeight = mLauncher.getTestInfo( - TestProtocol.REQUEST_HOME_TO_ALL_APPS_SWIPE_HEIGHT). - getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD); - mLauncher.swipe( - start.x, - start.y, - start.x, - start.y - swipeHeight - mLauncher.getTouchSlop(), - ALL_APPS_STATE_ORDINAL - ); + try(LauncherInstrumentation.Closable c = + mLauncher.addContextLayer("want to switch from workspace to all apps")) { + verifyActiveContainer(); + final UiObject2 hotseat = mHotseat; + final Point start = hotseat.getVisibleCenter(); + final int swipeHeight = mLauncher.getTestInfo( + TestProtocol.REQUEST_HOME_TO_ALL_APPS_SWIPE_HEIGHT). + getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD); + mLauncher.swipe( + start.x, + start.y, + start.x, + start.y - swipeHeight - mLauncher.getTouchSlop(), + ALL_APPS_STATE_ORDINAL + ); - return new AllApps(mLauncher); + try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer( + "swiped to all apps")) { + return new AllApps(mLauncher); + } + } } /** @@ -75,9 +81,13 @@ public final class Workspace extends Home { */ @Nullable public AppIcon tryGetWorkspaceAppIcon(String appName) { - final UiObject2 workspace = verifyActiveContainer(); - final UiObject2 icon = workspace.findObject(AppIcon.getAppIconSelector(appName, mLauncher)); - return icon != null ? new AppIcon(mLauncher, icon) : null; + try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer( + "want to get a workspace icon")) { + final UiObject2 workspace = verifyActiveContainer(); + final UiObject2 icon = workspace.findObject( + AppIcon.getAppIconSelector(appName, mLauncher)); + return icon != null ? new AppIcon(mLauncher, icon) : null; + } } @@ -165,7 +175,9 @@ public final class Workspace extends Home { public Widgets openAllWidgets() { verifyActiveContainer(); mLauncher.getDevice().pressKeyCode(KeyEvent.KEYCODE_W, KeyEvent.META_CTRL_ON); - return new Widgets(mLauncher); + try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer("pressed Ctrl+W")) { + return new Widgets(mLauncher); + } } @Override From 38b76942d650402c5d69182ad8a2e5d236e74899 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Tue, 26 Mar 2019 12:20:14 -0700 Subject: [PATCH 05/19] Launcher landscape gesture nav Bug: 128129398 Test: Rotate to landscape, ensure you can use gesture nav Change-Id: I4630cbae9bf1cbabd83fb72d5eb09c9a435950e9 --- .../android/quickstep/FallbackActivityControllerHelper.java | 3 ++- .../android/quickstep/LauncherActivityControllerHelper.java | 3 ++- .../com/android/quickstep/OtherActivityInputConsumer.java | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackActivityControllerHelper.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackActivityControllerHelper.java index ef46b3b0d9..8f4818ba1e 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackActivityControllerHelper.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackActivityControllerHelper.java @@ -59,7 +59,8 @@ public final class FallbackActivityControllerHelper implements @Override public int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context, Rect outRect) { LayoutUtils.calculateFallbackTaskSize(context, dp, outRect); - if (dp.isVerticalBarLayout()) { + if (dp.isVerticalBarLayout() + && !NavBarModeOverlayResourceObserver.isEdgeToEdgeModeEnabled(context)) { Rect targetInsets = dp.getInsets(); int hotseatInset = dp.isSeascape() ? targetInsets.left : targetInsets.right; return dp.hotseatBarSizePx + hotseatInset; diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java index 279b83c238..a9747844ba 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java @@ -75,7 +75,8 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe @Override public int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context, Rect outRect) { LayoutUtils.calculateLauncherTaskSize(context, dp, outRect); - if (dp.isVerticalBarLayout()) { + if (dp.isVerticalBarLayout() + && !NavBarModeOverlayResourceObserver.isEdgeToEdgeModeEnabled(context)) { Rect targetInsets = dp.getInsets(); int hotseatInset = dp.isSeascape() ? targetInsets.left : targetInsets.right; return dp.hotseatBarSizePx + hotseatInset; diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/OtherActivityInputConsumer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/OtherActivityInputConsumer.java index c8dcf80683..bcde13f4c3 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/OtherActivityInputConsumer.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/OtherActivityInputConsumer.java @@ -284,11 +284,13 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC } private boolean isNavBarOnRight() { - return mDisplayRotation == Surface.ROTATION_90 && mStableInsets.right > 0; + return !NavBarModeOverlayResourceObserver.isEdgeToEdgeModeEnabled(getBaseContext()) + && mDisplayRotation == Surface.ROTATION_90 && mStableInsets.right > 0; } private boolean isNavBarOnLeft() { - return mDisplayRotation == Surface.ROTATION_270 && mStableInsets.left > 0; + return !NavBarModeOverlayResourceObserver.isEdgeToEdgeModeEnabled(getBaseContext()) + && mDisplayRotation == Surface.ROTATION_270 && mStableInsets.left > 0; } private void startTouchTrackingForWindowAnimation(long touchTimeMs) { From f25461c337c9883d180479557ba5592115a5384e Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Mon, 11 Mar 2019 16:23:45 -0700 Subject: [PATCH 06/19] Updating to nav bar mode Bug: 127366543 Test: Manual Change-Id: I602539e5d6161c5bf6056bb60679b7ef1f168e3e (cherry picked from commit 18841823ed24af6ab879382901f4b4dd1cd61ddc) --- .../NavBarModeOverlayResourceObserver.java | 84 +++++++++++++++++++ .../quickstep/OverviewInteractionState.java | 27 +++--- .../com/android/quickstep/SwipeUpSetting.java | 25 +----- .../android/quickstep/QuickStepOnOffRule.java | 82 ++++++++++-------- .../android/launcher3/config/BaseFlags.java | 4 +- tests/Android.mk | 20 ++--- .../tapl/LauncherInstrumentation.java | 12 +-- 7 files changed, 164 insertions(+), 90 deletions(-) create mode 100644 quickstep/src/com/android/quickstep/NavBarModeOverlayResourceObserver.java diff --git a/quickstep/src/com/android/quickstep/NavBarModeOverlayResourceObserver.java b/quickstep/src/com/android/quickstep/NavBarModeOverlayResourceObserver.java new file mode 100644 index 0000000000..058b46ffc6 --- /dev/null +++ b/quickstep/src/com/android/quickstep/NavBarModeOverlayResourceObserver.java @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.quickstep; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.content.res.Resources; +import android.util.Log; + +import com.android.systemui.shared.system.QuickStepContract; + +/** + * Observer for the resource config that specifies the navigation bar mode. + */ +public class NavBarModeOverlayResourceObserver extends BroadcastReceiver { + + private static final String TAG = "NavBarModeOverlayResourceObserver"; + + private final String ACTION_OVERLAY_CHANGED = "android.intent.action.OVERLAY_CHANGED"; + private static final String NAV_BAR_INTERACTION_MODE_RES_NAME = + "config_navBarInteractionMode"; + + private final Context mContext; + private final OnChangeListener mOnChangeListener; + + public NavBarModeOverlayResourceObserver(Context context, OnChangeListener listener) { + mContext = context; + mOnChangeListener = listener; + } + + public void register() { + IntentFilter filter = new IntentFilter(ACTION_OVERLAY_CHANGED); + filter.addDataScheme("package"); + mContext.registerReceiver(this, filter); + } + + @Override + public void onReceive(Context context, Intent intent) { + mOnChangeListener.onNavBarModeChanged(getSystemIntegerRes(context, + NAV_BAR_INTERACTION_MODE_RES_NAME)); + } + + public interface OnChangeListener { + void onNavBarModeChanged(int mode); + } + + public static boolean isSwipeUpModeEnabled(Context context) { + return QuickStepContract.isSwipeUpMode(getSystemIntegerRes(context, + NAV_BAR_INTERACTION_MODE_RES_NAME)); + } + + public static boolean isEdgeToEdgeModeEnabled(Context context) { + return QuickStepContract.isGesturalMode(getSystemIntegerRes(context, + NAV_BAR_INTERACTION_MODE_RES_NAME)); + } + + private static int getSystemIntegerRes(Context context, String resName) { + Resources res = context.getResources(); + int resId = res.getIdentifier(resName, "integer", "android"); + + if (resId != 0) { + return res.getInteger(resId); + } else { + Log.e(TAG, "Failed to get system resource ID. Incompatible framework version?"); + return -1; + } + } +} diff --git a/quickstep/src/com/android/quickstep/OverviewInteractionState.java b/quickstep/src/com/android/quickstep/OverviewInteractionState.java index a0ab30141a..903701de31 100644 --- a/quickstep/src/com/android/quickstep/OverviewInteractionState.java +++ b/quickstep/src/com/android/quickstep/OverviewInteractionState.java @@ -15,7 +15,6 @@ */ package com.android.quickstep; -import static com.android.quickstep.SwipeUpSetting.newSwipeUpSettingsObserver; import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_DISABLE_QUICK_SCRUB; import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_DISABLE_SWIPE_UP; import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_SHOW_OVERVIEW_BUTTON; @@ -28,10 +27,11 @@ import android.util.Log; import com.android.launcher3.Utilities; import com.android.launcher3.allapps.DiscoveryBounce; +import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.util.MainThreadInitializedObject; -import com.android.launcher3.util.SecureSettingsObserver; import com.android.launcher3.util.UiThreadHelper; import com.android.systemui.shared.recents.ISystemUiProxy; +import com.android.systemui.shared.system.QuickStepContract; import androidx.annotation.WorkerThread; @@ -58,7 +58,8 @@ public class OverviewInteractionState { private static final int MSG_SET_BACK_BUTTON_ALPHA = 201; private static final int MSG_SET_SWIPE_UP_ENABLED = 202; - private final SecureSettingsObserver mSwipeUpSettingObserver; + // TODO: Discriminate between swipe up and edge to edge + private final NavBarModeOverlayResourceObserver mSwipeUpSettingObserver; private final Context mContext; private final Handler mUiHandler; @@ -66,7 +67,7 @@ public class OverviewInteractionState { // These are updated on the background thread private ISystemUiProxy mISystemUiProxy; - private boolean mSwipeUpEnabled = true; + private boolean mSwipeUpEnabled; private float mBackButtonAlpha = 1; private Runnable mOnSwipeUpSettingChangedListener; @@ -80,15 +81,15 @@ public class OverviewInteractionState { mUiHandler = new Handler(this::handleUiMessage); mBgHandler = new Handler(UiThreadHelper.getBackgroundLooper(), this::handleBgMessage); - if (SwipeUpSetting.isSwipeUpSettingAvailable()) { - mSwipeUpSettingObserver = - newSwipeUpSettingsObserver(context, this::notifySwipeUpSettingChanged); + mSwipeUpEnabled = NavBarModeOverlayResourceObserver.isSwipeUpModeEnabled(mContext) + || NavBarModeOverlayResourceObserver.isEdgeToEdgeModeEnabled(mContext); + if (SwipeUpSetting.isSystemNavigationSettingAvailable()) { + mSwipeUpSettingObserver = new NavBarModeOverlayResourceObserver(context, + this::notifySwipeUpSettingChanged); mSwipeUpSettingObserver.register(); - mSwipeUpEnabled = mSwipeUpSettingObserver.getValue(); resetHomeBounceSeenOnQuickstepEnabledFirstTime(); } else { mSwipeUpSettingObserver = null; - mSwipeUpEnabled = SwipeUpSetting.isSwipeUpEnabledDefaultValue(); } } @@ -175,7 +176,13 @@ public class OverviewInteractionState { } } - private void notifySwipeUpSettingChanged(boolean swipeUpEnabled) { + private void notifySwipeUpSettingChanged(int mode) { + boolean swipeUpEnabled = !QuickStepContract.isLegacyMode(mode); + boolean gesturalEnabled = QuickStepContract.isGesturalMode(mode); + + FeatureFlags.SWIPE_HOME.updateStorage(mContext, gesturalEnabled); + FeatureFlags.ENABLE_ASSISTANT_GESTURE.updateStorage(mContext, gesturalEnabled); + mUiHandler.removeMessages(MSG_SET_SWIPE_UP_ENABLED); mUiHandler.obtainMessage(MSG_SET_SWIPE_UP_ENABLED, swipeUpEnabled ? 1 : 0, 0). sendToTarget(); diff --git a/quickstep/src/com/android/quickstep/SwipeUpSetting.java b/quickstep/src/com/android/quickstep/SwipeUpSetting.java index 381ab9ffd8..7f830f93e2 100644 --- a/quickstep/src/com/android/quickstep/SwipeUpSetting.java +++ b/quickstep/src/com/android/quickstep/SwipeUpSetting.java @@ -16,23 +16,18 @@ package com.android.quickstep; -import static com.android.systemui.shared.system.SettingsCompat.SWIPE_UP_SETTING_NAME; - -import android.content.Context; import android.content.res.Resources; import android.util.Log; -import com.android.launcher3.util.SecureSettingsObserver; -import com.android.launcher3.util.SecureSettingsObserver.OnChangeListener; - public final class SwipeUpSetting { private static final String TAG = "SwipeUpSetting"; private static final String SWIPE_UP_SETTING_AVAILABLE_RES_NAME = "config_swipe_up_gesture_setting_available"; - private static final String SWIPE_UP_ENABLED_DEFAULT_RES_NAME = - "config_swipe_up_gesture_default"; + public static boolean isSystemNavigationSettingAvailable() { + return getSystemBooleanRes(SWIPE_UP_SETTING_AVAILABLE_RES_NAME); + } private static boolean getSystemBooleanRes(String resName) { Resources res = Resources.getSystem(); @@ -45,18 +40,4 @@ public final class SwipeUpSetting { return false; } } - - public static boolean isSwipeUpSettingAvailable() { - return getSystemBooleanRes(SWIPE_UP_SETTING_AVAILABLE_RES_NAME); - } - - public static boolean isSwipeUpEnabledDefaultValue() { - return getSystemBooleanRes(SWIPE_UP_ENABLED_DEFAULT_RES_NAME); - } - - public static SecureSettingsObserver newSwipeUpSettingsObserver(Context context, - OnChangeListener listener) { - return new SecureSettingsObserver(context.getContentResolver(), listener, - SWIPE_UP_SETTING_NAME, isSwipeUpEnabledDefaultValue() ? 1 : 0); - } } diff --git a/quickstep/tests/src/com/android/quickstep/QuickStepOnOffRule.java b/quickstep/tests/src/com/android/quickstep/QuickStepOnOffRule.java index f89842a394..12bd0ca88c 100644 --- a/quickstep/tests/src/com/android/quickstep/QuickStepOnOffRule.java +++ b/quickstep/tests/src/com/android/quickstep/QuickStepOnOffRule.java @@ -16,25 +16,29 @@ package com.android.quickstep; +import static androidx.test.InstrumentationRegistry.getInstrumentation; + import static com.android.quickstep.QuickStepOnOffRule.Mode.BOTH; import static com.android.quickstep.QuickStepOnOffRule.Mode.OFF; import static com.android.quickstep.QuickStepOnOffRule.Mode.ON; -import static com.android.systemui.shared.system.SettingsCompat.SWIPE_UP_SETTING_NAME; +import static com.android.systemui.shared.system.QuickStepContract.NAV_BAR_MODE_2BUTTON_OVERLAY; +import static com.android.systemui.shared.system.QuickStepContract.NAV_BAR_MODE_3BUTTON_OVERLAY; +import static com.android.systemui.shared.system.QuickStepContract.NAV_BAR_MODE_GESTURAL_OVERLAY; -import static org.junit.Assert.assertTrue; - -import android.provider.Settings; +import android.content.Context; import android.util.Log; -import androidx.test.InstrumentationRegistry; +import androidx.test.uiautomator.UiDevice; import com.android.launcher3.tapl.LauncherInstrumentation; import com.android.launcher3.tapl.TestHelpers; +import com.android.systemui.shared.system.QuickStepContract; import org.junit.rules.TestRule; import org.junit.runner.Description; import org.junit.runners.model.Statement; +import java.io.IOException; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -76,53 +80,59 @@ public class QuickStepOnOffRule implements TestRule { return new Statement() { @Override public void evaluate() throws Throwable { - if (SwipeUpSetting.isSwipeUpSettingAvailable()) { - try { - if (mode == ON || mode == BOTH) { - evaluateWithQuickstepOn(); - } - if (mode == OFF || mode == BOTH) { - evaluateWithQuickstepOff(); - } - } finally { - setSwipeUpSetting(null); + final Context context = getInstrumentation().getContext(); + final String prevOverlayPkg = QuickStepContract.isGesturalMode(context) + ? NAV_BAR_MODE_GESTURAL_OVERLAY + : QuickStepContract.isSwipeUpMode(context) + ? NAV_BAR_MODE_2BUTTON_OVERLAY + : NAV_BAR_MODE_3BUTTON_OVERLAY; + try { + if (mode == ON || mode == BOTH) { + evaluateWithQuickstepOn(); } - } else { - // Execute without changing the setting, if the requested mode is - // compatible. - final boolean swipeUpEnabledDefaultValue = - SwipeUpSetting.isSwipeUpEnabledDefaultValue(); - if (mode == BOTH || - mode == ON && swipeUpEnabledDefaultValue || - mode == OFF && !swipeUpEnabledDefaultValue) { - evaluateWithoutChangingSetting(base); + if (mode == OFF || mode == BOTH) { + evaluateWithQuickstepOff(); } + } finally { + setActiveOverlay(prevOverlayPkg); } } - public void setSwipeUpSetting(String value) { - Log.d(TAG, "setSwipeUpSetting: " + value); - assertTrue("Couldn't change Quickstep mode", - Settings.Secure.putString( - InstrumentationRegistry.getInstrumentation().getTargetContext(). - getContentResolver(), - SWIPE_UP_SETTING_NAME, - value)); - } - public void evaluateWithoutChangingSetting(Statement base) throws Throwable { base.evaluate(); } private void evaluateWithQuickstepOff() throws Throwable { - setSwipeUpSetting("0"); + setActiveOverlay(NAV_BAR_MODE_3BUTTON_OVERLAY); evaluateWithoutChangingSetting(base); } private void evaluateWithQuickstepOn() throws Throwable { - setSwipeUpSetting("1"); + setActiveOverlay(NAV_BAR_MODE_2BUTTON_OVERLAY); base.evaluate(); } + + private void setActiveOverlay(String overlayPackage) { + setOverlayPackageEnabled(NAV_BAR_MODE_3BUTTON_OVERLAY, + overlayPackage == NAV_BAR_MODE_3BUTTON_OVERLAY); + setOverlayPackageEnabled(NAV_BAR_MODE_2BUTTON_OVERLAY, + overlayPackage == NAV_BAR_MODE_2BUTTON_OVERLAY); + setOverlayPackageEnabled(NAV_BAR_MODE_GESTURAL_OVERLAY, + overlayPackage == NAV_BAR_MODE_GESTURAL_OVERLAY); + + // TODO: Wait until nav bar mode has applied + } + + private void setOverlayPackageEnabled(String overlayPackage, boolean enable) { + Log.d(TAG, "setOverlayPackageEnabled: " + overlayPackage + " " + enable); + final String action = enable ? "enable" : "disable"; + try { + UiDevice.getInstance(getInstrumentation()).executeShellCommand( + "cmd overlay " + action + " " + overlayPackage); + } catch (IOException e) { + e.printStackTrace(); + } + } }; } else { return base; diff --git a/src/com/android/launcher3/config/BaseFlags.java b/src/com/android/launcher3/config/BaseFlags.java index c260fa333e..106d9014d1 100644 --- a/src/com/android/launcher3/config/BaseFlags.java +++ b/src/com/android/launcher3/config/BaseFlags.java @@ -180,7 +180,7 @@ abstract class BaseFlags { currentValue = getFromStorage(context, defaultValue); } - void updateStorage(Context context, boolean value) { + public void updateStorage(Context context, boolean value) { SharedPreferences.Editor editor = context.getSharedPreferences(FLAGS_PREF_NAME, Context.MODE_PRIVATE).edit(); if (value == defaultValue) { @@ -272,7 +272,7 @@ abstract class BaseFlags { } @Override - void updateStorage(Context context, boolean value) { + public void updateStorage(Context context, boolean value) { if (contentResolver == null) { return; } diff --git a/tests/Android.mk b/tests/Android.mk index b9b703d022..ca7395adda 100644 --- a/tests/Android.mk +++ b/tests/Android.mk @@ -35,8 +35,8 @@ else ../src/com/android/launcher3/TestProtocol.java endif -LOCAL_SDK_VERSION := current LOCAL_MODULE := ub-launcher-aosp-tapl +LOCAL_SDK_VERSION := current include $(BUILD_STATIC_JAVA_LIBRARY) @@ -47,18 +47,18 @@ include $(CLEAR_VARS) LOCAL_MODULE_TAGS := tests LOCAL_STATIC_JAVA_LIBRARIES := \ - androidx.test.runner \ - androidx.test.rules \ - androidx.test.uiautomator_uiautomator \ - mockito-target-minus-junit4 + androidx.test.runner \ + androidx.test.rules \ + androidx.test.uiautomator_uiautomator \ + mockito-target-minus-junit4 ifneq (,$(wildcard frameworks/base)) - LOCAL_PRIVATE_PLATFORM_APIS := true - LOCAL_STATIC_JAVA_LIBRARIES += launcher-aosp-tapl + LOCAL_PRIVATE_PLATFORM_APIS := true + LOCAL_STATIC_JAVA_LIBRARIES += launcher-aosp-tapl else - LOCAL_SDK_VERSION := 28 - LOCAL_MIN_SDK_VERSION := 21 - LOCAL_STATIC_JAVA_LIBRARIES += ub-launcher-aosp-tapl + LOCAL_SDK_VERSION := 28 + LOCAL_MIN_SDK_VERSION := 21 + LOCAL_STATIC_JAVA_LIBRARIES += ub-launcher-aosp-tapl endif LOCAL_SRC_FILES := $(call all-java-files-under, src) diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 19b368f4f8..3dd14676a2 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -17,7 +17,6 @@ package com.android.launcher3.tapl; import static com.android.launcher3.TestProtocol.BACKGROUND_APP_STATE_ORDINAL; -import static com.android.systemui.shared.system.SettingsCompat.SWIPE_UP_SETTING_NAME; import android.app.ActivityManager; import android.app.Instrumentation; @@ -30,7 +29,6 @@ import android.os.Build; import android.os.Bundle; import android.os.Parcelable; import android.os.SystemClock; -import android.provider.Settings; import android.util.Log; import android.view.InputDevice; import android.view.MotionEvent; @@ -48,7 +46,7 @@ import androidx.test.uiautomator.UiObject2; import androidx.test.uiautomator.Until; import com.android.launcher3.TestProtocol; -import com.android.quickstep.SwipeUpSetting; +import com.android.systemui.shared.system.QuickStepContract; import org.junit.Assert; @@ -175,13 +173,7 @@ public final class LauncherInstrumentation { } private boolean isSwipeUpEnabled() { - final boolean swipeUpEnabledDefaultValue = SwipeUpSetting.isSwipeUpEnabledDefaultValue(); - return SwipeUpSetting.isSwipeUpSettingAvailable() ? - Settings.Secure.getInt( - mInstrumentation.getTargetContext().getContentResolver(), - SWIPE_UP_SETTING_NAME, - swipeUpEnabledDefaultValue ? 1 : 0) == 1 : - swipeUpEnabledDefaultValue; + return !QuickStepContract.isLegacyMode(mInstrumentation.getTargetContext()); } static void log(String message) { From 14b2f9dd57216e4443bed8300b8464c2f50162c0 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Mon, 25 Mar 2019 14:26:29 -0700 Subject: [PATCH 07/19] Use own context instead of app context to get overlay resources Bug: 129270535 Test: adb shell am instrument -w -r -e package android.platform.test.scenario.launcher android.platform.test.scenario/androidx.test.runner.AndroidJUnitRunner Change-Id: Iff2921cafcdb933566b5eb76670facc844bc7fd9 (cherry picked from commit 15179c0674b2cd20c252205673b338300b4fa48c) --- .../launcher3/tapl/LauncherInstrumentation.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 3dd14676a2..fd6ddce5d4 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -23,6 +23,7 @@ import android.app.Instrumentation; import android.app.UiAutomation; import android.content.ContentResolver; import android.content.Context; +import android.content.pm.PackageManager; import android.graphics.Point; import android.net.Uri; import android.os.Build; @@ -173,7 +174,15 @@ public final class LauncherInstrumentation { } private boolean isSwipeUpEnabled() { - return !QuickStepContract.isLegacyMode(mInstrumentation.getTargetContext()); + final Context baseContext = mInstrumentation.getTargetContext(); + try { + // Workaround, use constructed context because both the instrumentation context and the + // app context are not constructed with resources that take overlays into account + Context ctx = baseContext.createPackageContext(getLauncherPackageName(), 0); + return !QuickStepContract.isLegacyMode(ctx); + } catch (PackageManager.NameNotFoundException e) { + return false; + } } static void log(String message) { From 369212aed9b1740afb74afb1f1d93978ef87b4f0 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Tue, 26 Mar 2019 15:03:57 -0700 Subject: [PATCH 08/19] Adding a utility class to listen for app launches Change-Id: I62e82a6e04b7101773d98c6e7aec574facd053fe --- res/values/config.xml | 1 + .../launcher3/BaseDraggingActivity.java | 19 ++++++- src/com/android/launcher3/Launcher.java | 9 ++- .../launcher3/allapps/AllAppsGridAdapter.java | 9 +-- .../search/AllAppsSearchBarController.java | 4 +- .../launcher3/model/AppLaunchTracker.java | 56 +++++++++++++++++++ .../launcher3/popup/SystemShortcut.java | 2 +- .../launcher3/touch/ItemClickHandler.java | 29 +++++++--- .../launcher3/views/OptionsPopupView.java | 2 +- 9 files changed, 107 insertions(+), 24 deletions(-) create mode 100644 src/com/android/launcher3/model/AppLaunchTracker.java diff --git a/res/values/config.xml b/res/values/config.xml index 6bd01b5792..4b68b5064c 100644 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -70,6 +70,7 @@ + diff --git a/src/com/android/launcher3/BaseDraggingActivity.java b/src/com/android/launcher3/BaseDraggingActivity.java index ff9dd131b2..18599ac697 100644 --- a/src/com/android/launcher3/BaseDraggingActivity.java +++ b/src/com/android/launcher3/BaseDraggingActivity.java @@ -16,6 +16,8 @@ package com.android.launcher3; +import static com.android.launcher3.model.AppLaunchTracker.CONTAINER_SEARCH; + import android.app.ActivityOptions; import android.content.ActivityNotFoundException; import android.content.Intent; @@ -32,10 +34,13 @@ import android.widget.Toast; import com.android.launcher3.LauncherSettings.Favorites; import com.android.launcher3.compat.LauncherAppsCompat; +import com.android.launcher3.model.AppLaunchTracker; import com.android.launcher3.shortcuts.DeepShortcutManager; import com.android.launcher3.uioverrides.DisplayRotationListener; import com.android.launcher3.uioverrides.WallpaperColorInfo; +import androidx.annotation.Nullable; + /** * Extension of BaseActivity allowing support for drag-n-drop */ @@ -148,7 +153,8 @@ public abstract class BaseDraggingActivity extends BaseActivity public abstract ActivityOptions getActivityLaunchOptions(View v); - public boolean startActivitySafely(View v, Intent intent, ItemInfo item) { + public boolean startActivitySafely(View v, Intent intent, @Nullable ItemInfo item, + @Nullable String sourceContainer) { if (mIsSafeModeEnabled && !Utilities.isSystemApp(this, intent)) { Toast.makeText(this, R.string.safemode_shortcut_error, Toast.LENGTH_SHORT).show(); return false; @@ -169,13 +175,17 @@ public abstract class BaseDraggingActivity extends BaseActivity && !((ShortcutInfo) item).isPromise(); if (isShortcut) { // Shortcuts need some special checks due to legacy reasons. - startShortcutIntentSafely(intent, optsBundle, item); + startShortcutIntentSafely(intent, optsBundle, item, sourceContainer); } else if (user == null || user.equals(Process.myUserHandle())) { // Could be launching some bookkeeping activity startActivity(intent, optsBundle); + AppLaunchTracker.INSTANCE.get(this).onStartApp(intent.getComponent(), + Process.myUserHandle(), sourceContainer); } else { LauncherAppsCompat.getInstance(this).startActivityForProfile( intent.getComponent(), user, intent.getSourceBounds(), optsBundle); + AppLaunchTracker.INSTANCE.get(this).onStartApp(intent.getComponent(), user, + sourceContainer); } getUserEventDispatcher().logAppLaunch(v, intent); getStatsLogManager().logAppLaunch(v, intent); @@ -187,7 +197,8 @@ public abstract class BaseDraggingActivity extends BaseActivity return false; } - private void startShortcutIntentSafely(Intent intent, Bundle optsBundle, ItemInfo info) { + private void startShortcutIntentSafely(Intent intent, Bundle optsBundle, ItemInfo info, + @Nullable String sourceContainer) { try { StrictMode.VmPolicy oldPolicy = StrictMode.getVmPolicy(); try { @@ -202,6 +213,8 @@ public abstract class BaseDraggingActivity extends BaseActivity String packageName = intent.getPackage(); DeepShortcutManager.getInstance(this).startShortcut( packageName, id, intent.getSourceBounds(), optsBundle, info.user); + AppLaunchTracker.INSTANCE.get(this).onStartShortcut(packageName, id, info.user, + sourceContainer); } else { // Could be launching some bookkeeping activity startActivity(intent, optsBundle); diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index f283a6c260..867001ab49 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -97,6 +97,7 @@ import com.android.launcher3.logging.FileLog; import com.android.launcher3.logging.StatsLogUtils; import com.android.launcher3.logging.UserEventDispatcher; import com.android.launcher3.logging.UserEventDispatcher.UserEventDelegate; +import com.android.launcher3.model.AppLaunchTracker; import com.android.launcher3.model.ModelWriter; import com.android.launcher3.notification.NotificationListener; import com.android.launcher3.popup.PopupContainerWithArrow; @@ -694,7 +695,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { - startActivitySafely(v, intent, null); + startActivitySafely(v, intent, null, null); } else { // TODO: Show a snack bar with link to settings Toast.makeText(this, getString(R.string.msg_no_phone_permission, @@ -798,6 +799,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, getUserEventDispatcher().startSession(); UiFactory.onLauncherStateOrResumeChanged(this); + AppLaunchTracker.INSTANCE.get(this).onReturnedToHome(); } } @@ -1652,8 +1654,9 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, } } - public boolean startActivitySafely(View v, Intent intent, ItemInfo item) { - boolean success = super.startActivitySafely(v, intent, item); + public boolean startActivitySafely(View v, Intent intent, ItemInfo item, + @Nullable String sourceContainer) { + boolean success = super.startActivitySafely(v, intent, item, sourceContainer); if (success && v instanceof BubbleTextView) { // This is set to the view that launched the activity that navigated the user away // from launcher. Since there is no callback for when the activity has finished diff --git a/src/com/android/launcher3/allapps/AllAppsGridAdapter.java b/src/com/android/launcher3/allapps/AllAppsGridAdapter.java index 69b4bdb1df..3cfa0b1ecb 100644 --- a/src/com/android/launcher3/allapps/AllAppsGridAdapter.java +++ b/src/com/android/launcher3/allapps/AllAppsGridAdapter.java @@ -32,6 +32,7 @@ import com.android.launcher3.Launcher; import com.android.launcher3.R; import com.android.launcher3.allapps.AlphabeticalAppsList.AdapterItem; import com.android.launcher3.compat.UserManagerCompat; +import com.android.launcher3.model.AppLaunchTracker; import com.android.launcher3.touch.ItemClickHandler; import com.android.launcher3.touch.ItemLongClickListener; import com.android.launcher3.util.PackageManagerHelper; @@ -263,12 +264,8 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter mLauncher.startActivitySafely( + v, mMarketSearchIntent, null, AppLaunchTracker.CONTAINER_SEARCH)); return new ViewHolder(searchMarketView); case VIEW_TYPE_ALL_APPS_DIVIDER: return new ViewHolder(mLayoutInflater.inflate( diff --git a/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java b/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java index 91be504ef4..4515dde25e 100644 --- a/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java +++ b/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java @@ -28,6 +28,7 @@ import android.widget.TextView.OnEditorActionListener; import com.android.launcher3.ExtendedEditText; import com.android.launcher3.Launcher; import com.android.launcher3.Utilities; +import com.android.launcher3.model.AppLaunchTracker; import com.android.launcher3.util.ComponentKey; import com.android.launcher3.util.PackageManagerHelper; @@ -111,7 +112,8 @@ public class AllAppsSearchBarController return false; } return mLauncher.startActivitySafely(v, - PackageManagerHelper.getMarketSearchIntent(mLauncher, query), null); + PackageManagerHelper.getMarketSearchIntent(mLauncher, query), null, + AppLaunchTracker.CONTAINER_SEARCH); } @Override diff --git a/src/com/android/launcher3/model/AppLaunchTracker.java b/src/com/android/launcher3/model/AppLaunchTracker.java new file mode 100644 index 0000000000..1613d47b9f --- /dev/null +++ b/src/com/android/launcher3/model/AppLaunchTracker.java @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.android.launcher3.model; + +import static com.android.launcher3.util.ResourceBasedOverride.Overrides.getObject; + +import android.content.ComponentName; +import android.os.UserHandle; + +import com.android.launcher3.R; +import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType; +import com.android.launcher3.util.MainThreadInitializedObject; +import com.android.launcher3.util.ResourceBasedOverride; + +import androidx.annotation.Nullable; + +/** + * Callback for receiving various app launch events + */ +public class AppLaunchTracker implements ResourceBasedOverride { + + /** + * Derived from LauncherEvent proto. + * TODO: Use proper descriptive constants + */ + public static final String CONTAINER_DEFAULT = Integer.toString(ContainerType.WORKSPACE); + public static final String CONTAINER_ALL_APPS = Integer.toString(ContainerType.ALLAPPS); + public static final String CONTAINER_PREDICTIONS = Integer.toString(ContainerType.PREDICTION); + public static final String CONTAINER_SEARCH = Integer.toString(ContainerType.SEARCHRESULT); + + + public static final MainThreadInitializedObject INSTANCE = + new MainThreadInitializedObject<>(c -> + getObject(AppLaunchTracker.class, c, R.string.app_launch_tracker_class)); + + public void onStartShortcut(String packageName, String shortcutId, UserHandle user, + @Nullable String container) { } + + public void onStartApp(ComponentName componentName, UserHandle user, + @Nullable String container) { } + + public void onReturnedToHome() { } +} diff --git a/src/com/android/launcher3/popup/SystemShortcut.java b/src/com/android/launcher3/popup/SystemShortcut.java index fdc1b39d71..e7b8292613 100644 --- a/src/com/android/launcher3/popup/SystemShortcut.java +++ b/src/com/android/launcher3/popup/SystemShortcut.java @@ -195,7 +195,7 @@ public abstract class SystemShortcut extends Ite return view -> { Intent intent = new PackageManagerHelper(view.getContext()).getMarketIntent( itemInfo.getTargetComponent().getPackageName()); - activity.startActivitySafely(view, intent, itemInfo); + activity.startActivitySafely(view, intent, itemInfo, null); AbstractFloatingView.closeAllOpenViews(activity); }; } diff --git a/src/com/android/launcher3/touch/ItemClickHandler.java b/src/com/android/launcher3/touch/ItemClickHandler.java index 52fef9f7df..3639090021 100644 --- a/src/com/android/launcher3/touch/ItemClickHandler.java +++ b/src/com/android/launcher3/touch/ItemClickHandler.java @@ -22,6 +22,8 @@ import static com.android.launcher3.ItemInfoWithIcon.FLAG_DISABLED_SAFEMODE; import static com.android.launcher3.ItemInfoWithIcon.FLAG_DISABLED_SUSPENDED; import static com.android.launcher3.Launcher.REQUEST_BIND_PENDING_APPWIDGET; import static com.android.launcher3.Launcher.REQUEST_RECONFIGURE_APPWIDGET; +import static com.android.launcher3.model.AppLaunchTracker.CONTAINER_ALL_APPS; +import static com.android.launcher3.model.AppLaunchTracker.CONTAINER_DEFAULT; import android.app.AlertDialog; import android.content.Intent; @@ -48,6 +50,8 @@ import com.android.launcher3.util.PackageManagerHelper; import com.android.launcher3.widget.PendingAppWidgetHostView; import com.android.launcher3.widget.WidgetAddFlowHandler; +import androidx.annotation.Nullable; + /** * Class for handling clicks on workspace and all-apps items */ @@ -56,9 +60,13 @@ public class ItemClickHandler { /** * Instance used for click handling on items */ - public static final OnClickListener INSTANCE = ItemClickHandler::onClick; + public static final OnClickListener INSTANCE = getInstance(null); - private static void onClick(View v) { + public static final OnClickListener getInstance(String sourceContainer) { + return v -> onClick(v, sourceContainer); + } + + private static void onClick(View v, String sourceContainer) { // Make sure that rogue clicks don't get through while allapps is launching, or after the // view has detached (it's possible for this to happen if the view is removed mid touch). if (v.getWindowToken() == null) { @@ -72,13 +80,14 @@ public class ItemClickHandler { Object tag = v.getTag(); if (tag instanceof ShortcutInfo) { - onClickAppShortcut(v, (ShortcutInfo) tag, launcher); + onClickAppShortcut(v, (ShortcutInfo) tag, launcher, sourceContainer); } else if (tag instanceof FolderInfo) { if (v instanceof FolderIcon) { onClickFolderIcon(v); } } else if (tag instanceof AppInfo) { - startAppShortcutOrInfoActivity(v, (AppInfo) tag, launcher); + startAppShortcutOrInfoActivity(v, (AppInfo) tag, launcher, + sourceContainer == null ? CONTAINER_ALL_APPS: sourceContainer); } else if (tag instanceof LauncherAppWidgetInfo) { if (v instanceof PendingAppWidgetHostView) { onClickPendingWidget((PendingAppWidgetHostView) v, launcher); @@ -154,7 +163,7 @@ public class ItemClickHandler { private static void startMarketIntentForPackage(View v, Launcher launcher, String packageName) { ItemInfo item = (ItemInfo) v.getTag(); Intent intent = new PackageManagerHelper(launcher).getMarketIntent(packageName); - launcher.startActivitySafely(v, intent, item); + launcher.startActivitySafely(v, intent, item, null); } /** @@ -162,7 +171,8 @@ public class ItemClickHandler { * * @param v The view that was clicked. Must be a tagged with a {@link ShortcutInfo}. */ - public static void onClickAppShortcut(View v, ShortcutInfo shortcut, Launcher launcher) { + public static void onClickAppShortcut(View v, ShortcutInfo shortcut, Launcher launcher, + @Nullable String sourceContainer) { if (shortcut.isDisabled()) { final int disabledFlags = shortcut.runtimeStatusFlags & ShortcutInfo.FLAG_DISABLED_MASK; if ((disabledFlags & @@ -201,10 +211,11 @@ public class ItemClickHandler { } // Start activities - startAppShortcutOrInfoActivity(v, shortcut, launcher); + startAppShortcutOrInfoActivity(v, shortcut, launcher, sourceContainer); } - private static void startAppShortcutOrInfoActivity(View v, ItemInfo item, Launcher launcher) { + private static void startAppShortcutOrInfoActivity(View v, ItemInfo item, Launcher launcher, + @Nullable String sourceContainer) { Intent intent; if (item instanceof PromiseAppInfo) { PromiseAppInfo promiseAppInfo = (PromiseAppInfo) item; @@ -227,6 +238,6 @@ public class ItemClickHandler { intent.setPackage(null); } } - launcher.startActivitySafely(v, intent, item); + launcher.startActivitySafely(v, intent, item, sourceContainer); } } diff --git a/src/com/android/launcher3/views/OptionsPopupView.java b/src/com/android/launcher3/views/OptionsPopupView.java index e259cfea7d..6a2f0ffa23 100644 --- a/src/com/android/launcher3/views/OptionsPopupView.java +++ b/src/com/android/launcher3/views/OptionsPopupView.java @@ -217,7 +217,7 @@ public class OptionsPopupView extends ArrowPopup if (!TextUtils.isEmpty(pickerPackage)) { intent.setPackage(pickerPackage); } - return launcher.startActivitySafely(v, intent, null); + return launcher.startActivitySafely(v, intent, null, null); } public static class OptionItem { From a5354e02a2bf2bd8b0907b9e34dfbfddd9e679be Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Tue, 26 Mar 2019 14:36:52 -0700 Subject: [PATCH 09/19] Use system recent tasks stabilization Bug: 111926330 Test: Swipe to last task, ensure it resets task list on timeout or interaction Change-Id: Id09215a4cfdea63a4be6fb69fced163ad3bc10bd --- .../WindowTransformSwipeHandler.java | 16 +- .../com/android/quickstep/views/TaskView.java | 25 ++- .../NavBarModeOverlayResourceObserver.java | 7 +- .../android/quickstep/RecentTasksList.java | 11 +- .../com/android/quickstep/RecentsModel.java | 8 - .../android/quickstep/TaskListStabilizer.java | 145 ------------------ 6 files changed, 31 insertions(+), 181 deletions(-) delete mode 100644 quickstep/src/com/android/quickstep/TaskListStabilizer.java diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java index e8d4c19a73..15072a254c 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java @@ -851,16 +851,6 @@ public class WindowTransformSwipeHandler Interpolator interpolator, GestureEndTarget target, PointF velocityPxPerMs) { mGestureEndTarget = target; - if (mGestureEndTarget.canBeContinued) { - // Because we might continue this gesture, e.g. for consecutive quick switch, we need to - // stabilize the task list so that tasks don't rearrange in the middle of the gesture. - RecentsModel.INSTANCE.get(mContext).startStabilizationSession(); - } else if (mGestureEndTarget.isLauncher) { - // Otherwise, if we're going to home or overview, - // we reset the tasks to a consistent start state. - RecentsModel.INSTANCE.get(mContext).endStabilizationSession(); - } - if (mGestureEndTarget == HOME) { HomeAnimationFactory homeAnimFactory; if (mActivity != null) { @@ -1003,10 +993,12 @@ public class WindowTransformSwipeHandler // Launch the task user scrolled to (mRecentsView.getNextPage()). if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { // We finish recents animation inside launchTask() when live tile is enabled. - mRecentsView.getTaskViewAt(mRecentsView.getNextPage()).launchTask(false); + mRecentsView.getTaskViewAt(mRecentsView.getNextPage()).launchTask(false /* animate */, + true /* freezeTaskList */); } else { mRecentsAnimationWrapper.finish(true /* toRecents */, () -> { - mRecentsView.getTaskViewAt(mRecentsView.getNextPage()).launchTask(false); + mRecentsView.getTaskViewAt(mRecentsView.getNextPage()).launchTask( + false /* animate */, true /* freezeTaskList */); }); } TOUCH_INTERACTION_LOG.addLog("finishRecentsAnimation", false); diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java index eb17e3e820..6ba89c9bce 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java @@ -250,7 +250,11 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable { } public void launchTask(boolean animate) { - launchTask(animate, (result) -> { + launchTask(animate, false /* freezeTaskList */); + } + + public void launchTask(boolean animate, boolean freezeTaskList) { + launchTask(animate, freezeTaskList, (result) -> { if (!result) { notifyTaskLaunchFailed(TAG); } @@ -259,25 +263,33 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable { public void launchTask(boolean animate, Consumer resultCallback, Handler resultCallbackHandler) { + launchTask(animate, false /* freezeTaskList */, resultCallback, resultCallbackHandler); + } + + public void launchTask(boolean animate, boolean freezeTaskList, Consumer resultCallback, + Handler resultCallbackHandler) { if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { if (isRunningTask()) { getRecentsView().finishRecentsAnimation(false /* toRecents */, () -> resultCallbackHandler.post(() -> resultCallback.accept(true))); } else { - launchTaskInternal(animate, resultCallback, resultCallbackHandler); + launchTaskInternal(animate, freezeTaskList, resultCallback, resultCallbackHandler); } } else { - launchTaskInternal(animate, resultCallback, resultCallbackHandler); + launchTaskInternal(animate, freezeTaskList, resultCallback, resultCallbackHandler); } } - private void launchTaskInternal(boolean animate, Consumer resultCallback, - Handler resultCallbackHandler) { + private void launchTaskInternal(boolean animate, boolean freezeTaskList, + Consumer resultCallback, Handler resultCallbackHandler) { if (mTask != null) { final ActivityOptions opts; if (animate) { opts = ((BaseDraggingActivity) fromContext(getContext())) .getActivityLaunchOptions(this); + if (freezeTaskList) { + ActivityOptionsCompat.setFreezeRecentTasksList(opts); + } ActivityManagerWrapper.getInstance().startActivityFromRecentsAsync(mTask.key, opts, resultCallback, resultCallbackHandler); } else { @@ -288,6 +300,9 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable { resultCallbackHandler.post(() -> resultCallback.accept(true)); } }, resultCallbackHandler); + if (freezeTaskList) { + ActivityOptionsCompat.setFreezeRecentTasksList(opts); + } ActivityManagerWrapper.getInstance().startActivityFromRecentsAsync(mTask.key, opts, (success) -> { if (resultCallback != null && !success) { diff --git a/quickstep/src/com/android/quickstep/NavBarModeOverlayResourceObserver.java b/quickstep/src/com/android/quickstep/NavBarModeOverlayResourceObserver.java index 058b46ffc6..3136632807 100644 --- a/quickstep/src/com/android/quickstep/NavBarModeOverlayResourceObserver.java +++ b/quickstep/src/com/android/quickstep/NavBarModeOverlayResourceObserver.java @@ -70,6 +70,11 @@ public class NavBarModeOverlayResourceObserver extends BroadcastReceiver { NAV_BAR_INTERACTION_MODE_RES_NAME)); } + public static boolean isLegacyModeEnabled(Context context) { + return QuickStepContract.isLegacyMode(getSystemIntegerRes(context, + NAV_BAR_INTERACTION_MODE_RES_NAME)); + } + private static int getSystemIntegerRes(Context context, String resName) { Resources res = context.getResources(); int resId = res.getIdentifier(resName, "integer", "android"); @@ -81,4 +86,4 @@ public class NavBarModeOverlayResourceObserver extends BroadcastReceiver { return -1; } } -} +} \ No newline at end of file diff --git a/quickstep/src/com/android/quickstep/RecentTasksList.java b/quickstep/src/com/android/quickstep/RecentTasksList.java index e15a3f1ca1..06a36c9f0c 100644 --- a/quickstep/src/com/android/quickstep/RecentTasksList.java +++ b/quickstep/src/com/android/quickstep/RecentTasksList.java @@ -44,7 +44,6 @@ public class RecentTasksList extends TaskStackChangeListener { private final KeyguardManagerCompat mKeyguardManager; private final MainThreadExecutor mMainThreadExecutor; private final BackgroundExecutor mBgThreadExecutor; - private final TaskListStabilizer mStabilizer = new TaskListStabilizer(); // The list change id, increments as the task list changes in the system private int mChangeId; @@ -74,14 +73,6 @@ public class RecentTasksList extends TaskStackChangeListener { }); } - public void startStabilizationSession() { - mStabilizer.startStabilizationSession(); - } - - public void endStabilizationSession() { - mStabilizer.endStabilizationSession(); - } - /** * Asynchronously fetches the list of recent tasks, reusing cached list if available. * @@ -93,7 +84,7 @@ public class RecentTasksList extends TaskStackChangeListener { final int requestLoadId = mChangeId; Runnable resultCallback = callback == null ? () -> { } - : () -> callback.accept(mStabilizer.reorder(mTasks)); + : () -> callback.accept(mTasks); if (mLastLoadedId == mChangeId && (!mLastLoadHadKeysOnly || loadKeysOnly)) { // The list is up to date, callback with the same list diff --git a/quickstep/src/com/android/quickstep/RecentsModel.java b/quickstep/src/com/android/quickstep/RecentsModel.java index 56bc8570f6..a65bc33f14 100644 --- a/quickstep/src/com/android/quickstep/RecentsModel.java +++ b/quickstep/src/com/android/quickstep/RecentsModel.java @@ -90,14 +90,6 @@ public class RecentsModel extends TaskStackChangeListener { return mThumbnailCache; } - public void startStabilizationSession() { - mTaskList.startStabilizationSession(); - } - - public void endStabilizationSession() { - mTaskList.endStabilizationSession(); - } - /** * Fetches the list of recent tasks. * diff --git a/quickstep/src/com/android/quickstep/TaskListStabilizer.java b/quickstep/src/com/android/quickstep/TaskListStabilizer.java deleted file mode 100644 index 4c63f8188f..0000000000 --- a/quickstep/src/com/android/quickstep/TaskListStabilizer.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (C) 2019 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.android.quickstep; - -import android.app.ActivityManager.RecentTaskInfo; -import android.content.ComponentName; -import android.os.Process; -import android.os.SystemClock; - -import com.android.launcher3.util.IntArray; -import com.android.systemui.shared.recents.model.Task; -import com.android.systemui.shared.recents.model.Task.TaskKey; -import com.android.systemui.shared.system.ActivityManagerWrapper; -import com.android.systemui.shared.system.TaskStackChangeListener; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** - * Keeps the task list stable during quick switch gestures. So if you swipe right to switch from app - * A to B, you can then swipe right again to get to app C or left to get back to A. - */ -public class TaskListStabilizer { - - private static final long TASK_CACHE_TIMEOUT_MS = 5000; - - private final TaskStackChangeListener mTaskStackListener = new TaskStackChangeListener() { - - @Override - public void onTaskCreated(int taskId, ComponentName componentName) { - endStabilizationSession(); - } - - @Override - public void onTaskRemoved(int taskId) { - endStabilizationSession(); - } - }; - - // Task ids ordered based on recency, 0th index is the least recent task - private final IntArray mSystemOrder; - private final IntArray mStabilizedOrder; - - // Wrapper objects used for sorting tasks - private final ArrayList mTaskWrappers = new ArrayList<>(); - - private boolean mInStabilizationSession; - private long mSessionStartTime; - - public TaskListStabilizer() { - // Initialize the task ids map - List rawTasks = ActivityManagerWrapper.getInstance().getRecentTasks( - Integer.MAX_VALUE, Process.myUserHandle().getIdentifier()); - mSystemOrder = new IntArray(rawTasks.size()); - for (RecentTaskInfo info : rawTasks) { - mSystemOrder.add(new TaskKey(info).id); - } - // We will lazily copy the task id's from mSystemOrder when a stabilization session starts. - mStabilizedOrder = new IntArray(rawTasks.size()); - - ActivityManagerWrapper.getInstance().registerTaskStackListener(mTaskStackListener); - } - - public synchronized void startStabilizationSession() { - if (!mInStabilizationSession) { - mStabilizedOrder.clear(); - mStabilizedOrder.addAll(mSystemOrder); - } - mInStabilizationSession = true; - mSessionStartTime = SystemClock.uptimeMillis(); - } - - public synchronized void endStabilizationSession() { - mInStabilizationSession = false; - } - - public synchronized ArrayList reorder(ArrayList tasks) { - mSystemOrder.clear(); - for (Task task : tasks) { - mSystemOrder.add(task.key.id); - } - - if ((SystemClock.uptimeMillis() - mSessionStartTime) > TASK_CACHE_TIMEOUT_MS) { - endStabilizationSession(); - } - - if (!mInStabilizationSession) { - return tasks; - } - - // Ensure that we have enough wrappers - int taskCount = tasks.size(); - for (int i = taskCount - mTaskWrappers.size(); i > 0; i--) { - mTaskWrappers.add(new TaskWrapper()); - } - - List listToSort = mTaskWrappers.size() == taskCount - ? mTaskWrappers : mTaskWrappers.subList(0, taskCount); - int missingTaskIndex = -taskCount; - - for (int i = 0; i < taskCount; i++){ - TaskWrapper wrapper = listToSort.get(i); - wrapper.task = tasks.get(i); - wrapper.index = mStabilizedOrder.indexOf(wrapper.task.key.id); - - // Ensure that missing tasks are put in the front, in the order they appear in the - // original list - if (wrapper.index < 0) { - wrapper.index = missingTaskIndex; - missingTaskIndex++; - } - } - Collections.sort(listToSort); - - ArrayList result = new ArrayList<>(taskCount); - for (int i = 0; i < taskCount; i++) { - result.add(listToSort.get(i).task); - } - return result; - } - - private static class TaskWrapper implements Comparable { - Task task; - int index; - - @Override - public int compareTo(TaskWrapper other) { - return Integer.compare(index, other.index); - } - } -} From 522cc2ff0c2eca5414302ab8262efffb2256f43e Mon Sep 17 00:00:00 2001 From: vadimt Date: Tue, 26 Mar 2019 17:51:15 -0700 Subject: [PATCH 10/19] Adding diags for TAPL flakes that don't reproduce locally Also temporarily disabling more flaky BindWidgetTests Change-Id: Ib0d3c54c560ddb49b7964e85bf9cd6ebc567b6d7 --- tests/src/com/android/launcher3/ui/widget/BindWidgetTest.java | 2 +- tests/tapl/com/android/launcher3/tapl/Widgets.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/src/com/android/launcher3/ui/widget/BindWidgetTest.java b/tests/src/com/android/launcher3/ui/widget/BindWidgetTest.java index fbb4f5115b..68b16d6db5 100644 --- a/tests/src/com/android/launcher3/ui/widget/BindWidgetTest.java +++ b/tests/src/com/android/launcher3/ui/widget/BindWidgetTest.java @@ -145,7 +145,7 @@ public class BindWidgetTest extends AbstractLauncherUiTest { assertFalse(mDevice.findObject(new UiSelector().description(info.label)).exists()); } - @Test + @Test @Ignore public void testPendingWidget_autoRestored() { // A non-restored widget with no config screen gets restored automatically. LauncherAppWidgetProviderInfo info = TestViewHelpers.findWidgetProvider(this, false); diff --git a/tests/tapl/com/android/launcher3/tapl/Widgets.java b/tests/tapl/com/android/launcher3/tapl/Widgets.java index b6938d6bce..2de53c3f58 100644 --- a/tests/tapl/com/android/launcher3/tapl/Widgets.java +++ b/tests/tapl/com/android/launcher3/tapl/Widgets.java @@ -36,6 +36,7 @@ public final class Widgets extends LauncherInstrumentation.VisibleContainer { public void flingForward() { try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer( "want to fling forward in widgets")) { + LauncherInstrumentation.log("Widgets.flingForward enter"); final UiObject2 widgetsContainer = verifyActiveContainer(); widgetsContainer.setGestureMargin(100); widgetsContainer.fling(Direction.DOWN, @@ -43,6 +44,7 @@ public final class Widgets extends LauncherInstrumentation.VisibleContainer { try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer("flung forward")) { verifyActiveContainer(); } + LauncherInstrumentation.log("Widgets.flingForward exit"); } } @@ -52,6 +54,7 @@ public final class Widgets extends LauncherInstrumentation.VisibleContainer { public void flingBackward() { try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer( "want to fling backwards in widgets")) { + LauncherInstrumentation.log("Widgets.flingBackward enter"); final UiObject2 widgetsContainer = verifyActiveContainer(); widgetsContainer.setGestureMargin(100); widgetsContainer.fling(Direction.UP, @@ -60,6 +63,7 @@ public final class Widgets extends LauncherInstrumentation.VisibleContainer { try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer("flung back")) { verifyActiveContainer(); } + LauncherInstrumentation.log("Widgets.flingBackward exit"); } } From 3092a21532e58e71267fc7f1e2f941e2ed32f757 Mon Sep 17 00:00:00 2001 From: Bill Yi Date: Tue, 26 Mar 2019 22:14:07 -0700 Subject: [PATCH 11/19] Import translations. DO NOT MERGE Change-Id: I3bfe6c1b97612ecc829e361fc70d98b9318da417 Auto-generated-cl: translation import --- quickstep/res/values-af/strings.xml | 1 - quickstep/res/values-am/strings.xml | 1 - quickstep/res/values-ar/strings.xml | 1 - quickstep/res/values-as/strings.xml | 1 - quickstep/res/values-az/strings.xml | 1 - quickstep/res/values-b+sr+Latn/strings.xml | 1 - quickstep/res/values-be/strings.xml | 1 - quickstep/res/values-bg/strings.xml | 1 - quickstep/res/values-bn/strings.xml | 1 - quickstep/res/values-bs/strings.xml | 1 - quickstep/res/values-cs/strings.xml | 1 - quickstep/res/values-da/strings.xml | 1 - quickstep/res/values-de/strings.xml | 1 - quickstep/res/values-el/strings.xml | 1 - quickstep/res/values-en-rAU/strings.xml | 1 - quickstep/res/values-en-rGB/strings.xml | 1 - quickstep/res/values-en-rIN/strings.xml | 1 - quickstep/res/values-es-rUS/strings.xml | 1 - quickstep/res/values-es/strings.xml | 1 - quickstep/res/values-et/strings.xml | 1 - quickstep/res/values-eu/strings.xml | 1 - quickstep/res/values-fa/strings.xml | 1 - quickstep/res/values-fi/strings.xml | 1 - quickstep/res/values-gl/strings.xml | 1 - quickstep/res/values-gu/strings.xml | 1 - quickstep/res/values-hi/strings.xml | 1 - quickstep/res/values-hr/strings.xml | 1 - quickstep/res/values-hu/strings.xml | 1 - quickstep/res/values-hy/strings.xml | 1 - quickstep/res/values-in/strings.xml | 1 - quickstep/res/values-is/strings.xml | 1 - quickstep/res/values-it/strings.xml | 1 - quickstep/res/values-iw/strings.xml | 1 - quickstep/res/values-ja/strings.xml | 1 - quickstep/res/values-ka/strings.xml | 1 - quickstep/res/values-kk/strings.xml | 1 - quickstep/res/values-km/strings.xml | 1 - quickstep/res/values-kn/strings.xml | 1 - quickstep/res/values-ky/strings.xml | 1 - quickstep/res/values-lo/strings.xml | 1 - quickstep/res/values-lt/strings.xml | 1 - quickstep/res/values-lv/strings.xml | 1 - quickstep/res/values-mk/strings.xml | 1 - quickstep/res/values-ml/strings.xml | 1 - quickstep/res/values-mn/strings.xml | 1 - quickstep/res/values-mr/strings.xml | 1 - quickstep/res/values-ms/strings.xml | 1 - quickstep/res/values-my/strings.xml | 1 - quickstep/res/values-nb/strings.xml | 1 - quickstep/res/values-ne/strings.xml | 1 - quickstep/res/values-nl/strings.xml | 1 - quickstep/res/values-or/strings.xml | 1 - quickstep/res/values-pa/strings.xml | 1 - quickstep/res/values-pl/strings.xml | 1 - quickstep/res/values-pt-rPT/strings.xml | 1 - quickstep/res/values-pt/strings.xml | 1 - quickstep/res/values-ro/strings.xml | 1 - quickstep/res/values-ru/strings.xml | 1 - quickstep/res/values-si/strings.xml | 1 - quickstep/res/values-sk/strings.xml | 1 - quickstep/res/values-sl/strings.xml | 1 - quickstep/res/values-sq/strings.xml | 1 - quickstep/res/values-sr/strings.xml | 1 - quickstep/res/values-sv/strings.xml | 1 - quickstep/res/values-sw/strings.xml | 1 - quickstep/res/values-te/strings.xml | 1 - quickstep/res/values-th/strings.xml | 1 - quickstep/res/values-tl/strings.xml | 1 - quickstep/res/values-tr/strings.xml | 1 - quickstep/res/values-uk/strings.xml | 1 - quickstep/res/values-ur/strings.xml | 1 - quickstep/res/values-uz/strings.xml | 1 - quickstep/res/values-vi/strings.xml | 1 - quickstep/res/values-zh-rCN/strings.xml | 1 - quickstep/res/values-zh-rHK/strings.xml | 1 - quickstep/res/values-zh-rTW/strings.xml | 1 - quickstep/res/values-zu/strings.xml | 1 - res/values-ca/strings.xml | 2 +- res/values-ko/strings.xml | 2 +- res/values-pt-rPT/strings.xml | 2 +- 80 files changed, 3 insertions(+), 80 deletions(-) diff --git a/quickstep/res/values-af/strings.xml b/quickstep/res/values-af/strings.xml index 336eef81c0..88954b2270 100644 --- a/quickstep/res/values-af/strings.xml +++ b/quickstep/res/values-af/strings.xml @@ -30,6 +30,5 @@ "Onlangse programme" "%1$s, %2$s" "< 1 minuut" - "Program in grysskaal" "%1$s oor vandag" diff --git a/quickstep/res/values-am/strings.xml b/quickstep/res/values-am/strings.xml index 8a565e4242..34fb3be414 100644 --- a/quickstep/res/values-am/strings.xml +++ b/quickstep/res/values-am/strings.xml @@ -30,6 +30,5 @@ "የቅርብ ጊዜ መተግበሪያዎች" "%1$s%2$s" "< 1 ደቂቃ" - "መተግበሪያ በግራጫ" "ዛሬ %1$s ቀርቷል" diff --git a/quickstep/res/values-ar/strings.xml b/quickstep/res/values-ar/strings.xml index d96397ce5e..ebdcf7363a 100644 --- a/quickstep/res/values-ar/strings.xml +++ b/quickstep/res/values-ar/strings.xml @@ -30,6 +30,5 @@ "التطبيقات التي تمّ استخدامها مؤخرًا" "%1$s، %2$s" "أقل من دقيقة" - "التطبيق بالتدرّج الرمادي" "يتبقى اليوم %1$s." diff --git a/quickstep/res/values-as/strings.xml b/quickstep/res/values-as/strings.xml index 7216b4f3bc..a33973b218 100644 --- a/quickstep/res/values-as/strings.xml +++ b/quickstep/res/values-as/strings.xml @@ -30,6 +30,5 @@ "শেহতীয়া এপসমূহ" "%1$s, %2$s" "< ১ মিনিট" - "এপ্ গ্ৰে’স্কে’লত আছে" "আজি %1$s বাকী আছ" diff --git a/quickstep/res/values-az/strings.xml b/quickstep/res/values-az/strings.xml index c07098e121..02312f49e4 100644 --- a/quickstep/res/values-az/strings.xml +++ b/quickstep/res/values-az/strings.xml @@ -30,6 +30,5 @@ "Son tətbiqlər" "%1$s, %2$s" "< 1 dəq" - "Tətbiq ağ-qara rejimdədir" "Bu gün %1$s qaldı" diff --git a/quickstep/res/values-b+sr+Latn/strings.xml b/quickstep/res/values-b+sr+Latn/strings.xml index 6fea4583d7..baab4a12f2 100644 --- a/quickstep/res/values-b+sr+Latn/strings.xml +++ b/quickstep/res/values-b+sr+Latn/strings.xml @@ -30,6 +30,5 @@ "Nedavne aplikacije" "%1$s, %2$s" "< 1 min" - "Aplikacija je u sivilu" "Još %1$s danas" diff --git a/quickstep/res/values-be/strings.xml b/quickstep/res/values-be/strings.xml index 814703150b..b28f3771a6 100644 --- a/quickstep/res/values-be/strings.xml +++ b/quickstep/res/values-be/strings.xml @@ -30,6 +30,5 @@ "Нядаўнія праграмы" "%1$s, %2$s" "< 1 хв" - "Праграма ў шэрым рэжыме" "Сёння засталося %1$s" diff --git a/quickstep/res/values-bg/strings.xml b/quickstep/res/values-bg/strings.xml index 00ba58251c..0475c0d1f6 100644 --- a/quickstep/res/values-bg/strings.xml +++ b/quickstep/res/values-bg/strings.xml @@ -30,6 +30,5 @@ "Скорошни приложения" "%1$s, %2$s" "< 1 мин" - "Прилож. е в сивата скала" "Оставащо време днес: %1$s" diff --git a/quickstep/res/values-bn/strings.xml b/quickstep/res/values-bn/strings.xml index 9a30adf430..e6764e0161 100644 --- a/quickstep/res/values-bn/strings.xml +++ b/quickstep/res/values-bn/strings.xml @@ -30,6 +30,5 @@ "সম্প্রতি ব্যবহৃত অ্যাপ" "%1$s, %2$s" "< ১ মি." - "অ্যাপে গ্রেস্কেল" "আজকে %1$s বাকি আছে" diff --git a/quickstep/res/values-bs/strings.xml b/quickstep/res/values-bs/strings.xml index e940616189..77b4c46073 100644 --- a/quickstep/res/values-bs/strings.xml +++ b/quickstep/res/values-bs/strings.xml @@ -30,6 +30,5 @@ "Nedavne aplikacije" "%1$s, %2$s" "< 1 min" - "Apl. je u nijansi sive" "Preostalo vrijeme: %1$s" diff --git a/quickstep/res/values-cs/strings.xml b/quickstep/res/values-cs/strings.xml index 435edd92d6..a698d49dee 100644 --- a/quickstep/res/values-cs/strings.xml +++ b/quickstep/res/values-cs/strings.xml @@ -30,6 +30,5 @@ "Poslední aplikace" "%1$s, %2$s" "< 1 minuta" - "Aplikace se zešednutím" "dnes zbývá: %1$s" diff --git a/quickstep/res/values-da/strings.xml b/quickstep/res/values-da/strings.xml index 3db6ab34d6..b3e8524f8d 100644 --- a/quickstep/res/values-da/strings.xml +++ b/quickstep/res/values-da/strings.xml @@ -30,6 +30,5 @@ "Seneste apps" "%1$s, %2$s" "< 1 min" - "Nedtonet app" "%1$s tilbage i dag" diff --git a/quickstep/res/values-de/strings.xml b/quickstep/res/values-de/strings.xml index 48604f1d3f..10e4fd7ce6 100644 --- a/quickstep/res/values-de/strings.xml +++ b/quickstep/res/values-de/strings.xml @@ -30,6 +30,5 @@ "Zuletzt aktive Apps" "%1$s, %2$s" "< 1 min" - "App in Graustufen" "Heute noch %1$s" diff --git a/quickstep/res/values-el/strings.xml b/quickstep/res/values-el/strings.xml index fdc7464a02..6ef1e9426c 100644 --- a/quickstep/res/values-el/strings.xml +++ b/quickstep/res/values-el/strings.xml @@ -30,6 +30,5 @@ "Πρόσφατες εφαρμογές" "%1$s, %2$s" "< 1 λ." - "Εφαρ. σε κλίμακα του γκρι" "Απομένουν %1$s σήμερα" diff --git a/quickstep/res/values-en-rAU/strings.xml b/quickstep/res/values-en-rAU/strings.xml index d625b600b9..d640b63ea6 100644 --- a/quickstep/res/values-en-rAU/strings.xml +++ b/quickstep/res/values-en-rAU/strings.xml @@ -30,6 +30,5 @@ "Recent apps" "%1$s, %2$s" "< 1 minute" - "App in grayscale" "%1$s left today" diff --git a/quickstep/res/values-en-rGB/strings.xml b/quickstep/res/values-en-rGB/strings.xml index d625b600b9..d640b63ea6 100644 --- a/quickstep/res/values-en-rGB/strings.xml +++ b/quickstep/res/values-en-rGB/strings.xml @@ -30,6 +30,5 @@ "Recent apps" "%1$s, %2$s" "< 1 minute" - "App in grayscale" "%1$s left today" diff --git a/quickstep/res/values-en-rIN/strings.xml b/quickstep/res/values-en-rIN/strings.xml index d625b600b9..d640b63ea6 100644 --- a/quickstep/res/values-en-rIN/strings.xml +++ b/quickstep/res/values-en-rIN/strings.xml @@ -30,6 +30,5 @@ "Recent apps" "%1$s, %2$s" "< 1 minute" - "App in grayscale" "%1$s left today" diff --git a/quickstep/res/values-es-rUS/strings.xml b/quickstep/res/values-es-rUS/strings.xml index a9d303aba1..c93e8fc4ad 100644 --- a/quickstep/res/values-es-rUS/strings.xml +++ b/quickstep/res/values-es-rUS/strings.xml @@ -30,6 +30,5 @@ "Apps recientes" "%1$s (%2$s)" "< 1 minuto" - "App en escala de grises" "Tiempo restante: %1$s" diff --git a/quickstep/res/values-es/strings.xml b/quickstep/res/values-es/strings.xml index 291512aa57..3a588e5fc0 100644 --- a/quickstep/res/values-es/strings.xml +++ b/quickstep/res/values-es/strings.xml @@ -30,6 +30,5 @@ "Aplicaciones recientes" "%1$s (%2$s)" "<1 minuto" - "App en escala de grises" "tiempo restante: %1$s" diff --git a/quickstep/res/values-et/strings.xml b/quickstep/res/values-et/strings.xml index 96c27e735a..7032765bb0 100644 --- a/quickstep/res/values-et/strings.xml +++ b/quickstep/res/values-et/strings.xml @@ -30,6 +30,5 @@ "Hiljutised rakendused" "%1$s %2$s" "< 1 minut" - "Rakendus halltoonides" "Tääna jäänud %1$s" diff --git a/quickstep/res/values-eu/strings.xml b/quickstep/res/values-eu/strings.xml index 15b682c6f2..66e08b9f10 100644 --- a/quickstep/res/values-eu/strings.xml +++ b/quickstep/res/values-eu/strings.xml @@ -30,6 +30,5 @@ "Azken aplikazioak" "%1$s (%2$s)" "< 1 min" - "Aplikazioa grisen eskalan" "%1$s gelditzen dira gaur" diff --git a/quickstep/res/values-fa/strings.xml b/quickstep/res/values-fa/strings.xml index 0a482f8b50..112d04cdef 100644 --- a/quickstep/res/values-fa/strings.xml +++ b/quickstep/res/values-fa/strings.xml @@ -30,6 +30,5 @@ "برنامه‌های اخیر" "%1$s، %2$s" "< ۱ دقیقه" - "برنامه به‌صورت سیاه‌وسفید" "%1$s باقی‌مانده برای امروز" diff --git a/quickstep/res/values-fi/strings.xml b/quickstep/res/values-fi/strings.xml index 69686bbfbb..6a0a359305 100644 --- a/quickstep/res/values-fi/strings.xml +++ b/quickstep/res/values-fi/strings.xml @@ -30,6 +30,5 @@ "Viimeisimmät sovellukset" "%1$s, %2$s" "< 1 min" - "Harmaasävyinen sovellus" "%1$s jäljellä tänään" diff --git a/quickstep/res/values-gl/strings.xml b/quickstep/res/values-gl/strings.xml index a6995d01de..d6ddf3cd68 100644 --- a/quickstep/res/values-gl/strings.xml +++ b/quickstep/res/values-gl/strings.xml @@ -30,6 +30,5 @@ "Aplicacións recentes" "%1$s (%2$s)" "<1 min" - "App en escala de grises" "Tempo restante hoxe %1$s" diff --git a/quickstep/res/values-gu/strings.xml b/quickstep/res/values-gu/strings.xml index 72b70b0650..4493e3b5dd 100644 --- a/quickstep/res/values-gu/strings.xml +++ b/quickstep/res/values-gu/strings.xml @@ -30,6 +30,5 @@ "તાજેતરની ઍપ" "%1$s, %2$s" "< 1 મિનિટ" - "ગ્રેસ્કેલમાં ઍપ" "%1$s આજે બાકી" diff --git a/quickstep/res/values-hi/strings.xml b/quickstep/res/values-hi/strings.xml index 4d150445b9..3c53cce45a 100644 --- a/quickstep/res/values-hi/strings.xml +++ b/quickstep/res/values-hi/strings.xml @@ -30,6 +30,5 @@ "हाल ही में इस्तेमाल किए गए एेप्लिकेशन" "%1$s, %2$s" "<1 मिनट" - "ग्रेस्केल में ऐप्लिकेशन" "आज %1$s और चलेगा" diff --git a/quickstep/res/values-hr/strings.xml b/quickstep/res/values-hr/strings.xml index 1cec1fbca2..103710ff91 100644 --- a/quickstep/res/values-hr/strings.xml +++ b/quickstep/res/values-hr/strings.xml @@ -30,6 +30,5 @@ "Nedavne aplikacije" "%1$s, %2$s" "< 1 min" - "Apl. u nijansama sive" "Još %1$s danas" diff --git a/quickstep/res/values-hu/strings.xml b/quickstep/res/values-hu/strings.xml index 112c4819cb..22b2380f26 100644 --- a/quickstep/res/values-hu/strings.xml +++ b/quickstep/res/values-hu/strings.xml @@ -30,6 +30,5 @@ "Legutóbbi alkalmazások" "%1$s, %2$s" "< 1 perc" - "Szürkeárnyalat aktív" "Ma még %1$s van hátra" diff --git a/quickstep/res/values-hy/strings.xml b/quickstep/res/values-hy/strings.xml index f39db5a5b7..910265acc3 100644 --- a/quickstep/res/values-hy/strings.xml +++ b/quickstep/res/values-hy/strings.xml @@ -30,6 +30,5 @@ "Վերջին օգտագործած հավելվածները" "%1$s, %2$s" "< 1 ր" - "Մոխրագույն երանգներ" "Այսօր մնացել է՝ %1$s" diff --git a/quickstep/res/values-in/strings.xml b/quickstep/res/values-in/strings.xml index 48892c9562..a7749df883 100644 --- a/quickstep/res/values-in/strings.xml +++ b/quickstep/res/values-in/strings.xml @@ -30,6 +30,5 @@ "Aplikasi baru-baru ini" "%1$s, %2$s" "< 1 menit" - "Aplikasi hitam putih" "%1$s tersisa hari ini" diff --git a/quickstep/res/values-is/strings.xml b/quickstep/res/values-is/strings.xml index c3ec96cbff..ba0c6723fa 100644 --- a/quickstep/res/values-is/strings.xml +++ b/quickstep/res/values-is/strings.xml @@ -30,6 +30,5 @@ "Nýleg forrit" "%1$s, %2$s" "< 1 mín." - "Forrit í grátónum" "%1$s eftir í dag" diff --git a/quickstep/res/values-it/strings.xml b/quickstep/res/values-it/strings.xml index d7c57ee287..746443eabd 100644 --- a/quickstep/res/values-it/strings.xml +++ b/quickstep/res/values-it/strings.xml @@ -30,6 +30,5 @@ "App recenti" "%1$s, %2$s" "< 1 min" - "App in scala di grigi" "Rimanente oggi: %1$s" diff --git a/quickstep/res/values-iw/strings.xml b/quickstep/res/values-iw/strings.xml index 0b745cdd2f..96a8adcaf3 100644 --- a/quickstep/res/values-iw/strings.xml +++ b/quickstep/res/values-iw/strings.xml @@ -30,6 +30,5 @@ "אפליקציות אחרונות" "%1$s, %2$s" "‏< דקה" - "האפליקציה בגווני אפור" "הזמן שנותר להיום: %1$s" diff --git a/quickstep/res/values-ja/strings.xml b/quickstep/res/values-ja/strings.xml index c76c4a6f15..5484ae1fcd 100644 --- a/quickstep/res/values-ja/strings.xml +++ b/quickstep/res/values-ja/strings.xml @@ -30,6 +30,5 @@ "最近使ったアプリ" "%1$s%2$s" "1 分未満" - "グレースケールのアプリ" "今日はあと %1$sです" diff --git a/quickstep/res/values-ka/strings.xml b/quickstep/res/values-ka/strings.xml index 700522ff97..9218fb8b8a 100644 --- a/quickstep/res/values-ka/strings.xml +++ b/quickstep/res/values-ka/strings.xml @@ -30,6 +30,5 @@ "ბოლოდროინდელი აპები" "%1$s, %2$s" "< 1 წუთი" - "აპი ნაცრისფერ ტონებშია" "დღეს დარჩენილია %1$s" diff --git a/quickstep/res/values-kk/strings.xml b/quickstep/res/values-kk/strings.xml index 96f8956192..0766150226 100644 --- a/quickstep/res/values-kk/strings.xml +++ b/quickstep/res/values-kk/strings.xml @@ -30,6 +30,5 @@ "Соңғы пайдаланылған қолданбалар" "%1$s, %2$s" "< 1 мин" - "Сұр түстегі қолданба" "Бүгін %1$s қалды" diff --git a/quickstep/res/values-km/strings.xml b/quickstep/res/values-km/strings.xml index 323efdfba7..8737ae8303 100644 --- a/quickstep/res/values-km/strings.xml +++ b/quickstep/res/values-km/strings.xml @@ -30,6 +30,5 @@ "កម្មវិធី​ថ្មីៗ" "%1$s, %2$s" "< 1 នាទី" - "កម្មវិធី​ស្ថិតក្នុង​មាត្រដ្ឋាន​ពណ៌ប្រផេះ" "នៅសល់ %1$s ទៀត​នៅថ្ងៃនេះ" diff --git a/quickstep/res/values-kn/strings.xml b/quickstep/res/values-kn/strings.xml index b5e57382cb..099957cb71 100644 --- a/quickstep/res/values-kn/strings.xml +++ b/quickstep/res/values-kn/strings.xml @@ -30,6 +30,5 @@ "ಇತ್ತೀಚಿನ ಅಪ್ಲಿಕೇಶನ್‌ಗಳು" "%1$s, %2$s" "< 1 ನಿ" - "ಗ್ರೇಸ್ಕೇಲ್‌ನಲ್ಲಿ ಆ್ಯಪ್‌" "ಇಂದು %1$s ಸಮಯ ಉಳಿದಿದೆ" diff --git a/quickstep/res/values-ky/strings.xml b/quickstep/res/values-ky/strings.xml index be960ecd3d..d1d2d201d3 100644 --- a/quickstep/res/values-ky/strings.xml +++ b/quickstep/res/values-ky/strings.xml @@ -30,6 +30,5 @@ "Акыркы колдонмолор" "%1$s, %2$s" "< 1 мүнөт" - "Колдонмо жигерсиз" "Бүгүн %1$s мүнөт калды" diff --git a/quickstep/res/values-lo/strings.xml b/quickstep/res/values-lo/strings.xml index ef70ee7454..aba4156d06 100644 --- a/quickstep/res/values-lo/strings.xml +++ b/quickstep/res/values-lo/strings.xml @@ -30,6 +30,5 @@ "ແອັບຫຼ້າສຸດ" "%1$s, %2$s" "< 1 ນາທີ" - "ແອັບເປັນສີຂາວດຳ" "ເຫຼືອ %1$s ມື້ນີ້" diff --git a/quickstep/res/values-lt/strings.xml b/quickstep/res/values-lt/strings.xml index f10866b440..933b3f094f 100644 --- a/quickstep/res/values-lt/strings.xml +++ b/quickstep/res/values-lt/strings.xml @@ -30,6 +30,5 @@ "Naujausios programos" "%1$s, %2$s" "< 1 min." - "Programa su pilkumo tonu" "Šiandien liko: %1$s" diff --git a/quickstep/res/values-lv/strings.xml b/quickstep/res/values-lv/strings.xml index 9ae124a527..1e2ed00f1a 100644 --- a/quickstep/res/values-lv/strings.xml +++ b/quickstep/res/values-lv/strings.xml @@ -30,6 +30,5 @@ "Pēdējās izmantotās lietotnes" "%1$s, %2$s" "<1 minūte" - "Lietotne pelēktoņos" "Šodien atlicis: %1$s" diff --git a/quickstep/res/values-mk/strings.xml b/quickstep/res/values-mk/strings.xml index 688cb933b8..7a6c094b53 100644 --- a/quickstep/res/values-mk/strings.xml +++ b/quickstep/res/values-mk/strings.xml @@ -30,6 +30,5 @@ "Неодамнешни апликации" "%1$s, %2$s" "< 1 минута" - "Апликација во сиви тонови" "Уште %1$s за денес" diff --git a/quickstep/res/values-ml/strings.xml b/quickstep/res/values-ml/strings.xml index e66116cbfb..b5eac1dc32 100644 --- a/quickstep/res/values-ml/strings.xml +++ b/quickstep/res/values-ml/strings.xml @@ -30,6 +30,5 @@ "സമീപകാല ആപ്പുകൾ" "%1$s, %2$s" "< 1 മിനിറ്റ്" - "ആപ്പ് ഗ്രേസ്‌കെയിലിൽ" "ഇന്ന് %1$s ശേഷിക്കുന്നു" diff --git a/quickstep/res/values-mn/strings.xml b/quickstep/res/values-mn/strings.xml index 5c57237985..a105ef1609 100644 --- a/quickstep/res/values-mn/strings.xml +++ b/quickstep/res/values-mn/strings.xml @@ -30,6 +30,5 @@ "Саяхны аппууд" "%1$s, %2$s" "< 1 минут" - "Саарал өнгөтэй болсон апп" "Өнөөдөр %1$s үлдсэн" diff --git a/quickstep/res/values-mr/strings.xml b/quickstep/res/values-mr/strings.xml index f4f29041f9..bf725e3378 100644 --- a/quickstep/res/values-mr/strings.xml +++ b/quickstep/res/values-mr/strings.xml @@ -30,6 +30,5 @@ "अलीकडील अॅप्स" "%1$s, %2$s" "१मिहून कमी" - "ग्रेस्केल मधील अ‍ॅप" "आज %1$sशिल्लक आहे" diff --git a/quickstep/res/values-ms/strings.xml b/quickstep/res/values-ms/strings.xml index d8561eb29e..2e3f236b1a 100644 --- a/quickstep/res/values-ms/strings.xml +++ b/quickstep/res/values-ms/strings.xml @@ -30,6 +30,5 @@ "Apl terbaharu" "%1$s, %2$s" "< 1 minit" - "Apl dalam skala kelabu" "%1$s lagi hari ini" diff --git a/quickstep/res/values-my/strings.xml b/quickstep/res/values-my/strings.xml index f609c892ee..7b931257b3 100644 --- a/quickstep/res/values-my/strings.xml +++ b/quickstep/res/values-my/strings.xml @@ -30,6 +30,5 @@ "လတ်တလောသုံး အက်ပ်များ" "%1$s%2$s" "< ၁ မိနစ်" - "အဖြူအမည်းနှင့်ပြသော အက်ပ်" "ယနေ့ %1$s ခု ကျန်သည်" diff --git a/quickstep/res/values-nb/strings.xml b/quickstep/res/values-nb/strings.xml index cff48d8d73..74f43d2e24 100644 --- a/quickstep/res/values-nb/strings.xml +++ b/quickstep/res/values-nb/strings.xml @@ -30,6 +30,5 @@ "Nylige apper" "%1$s, %2$s" "< 1 minutt" - "App i gråtoner" "%1$s gjenstår i dag" diff --git a/quickstep/res/values-ne/strings.xml b/quickstep/res/values-ne/strings.xml index cc450c485f..6053def168 100644 --- a/quickstep/res/values-ne/strings.xml +++ b/quickstep/res/values-ne/strings.xml @@ -30,6 +30,5 @@ "हालसालैका अनुप्रयोगहरू" "%1$s, %2$s" "< १ मिनेट" - "ग्रेस्केल पारिएको एप" "आज: %1$s बाँकी" diff --git a/quickstep/res/values-nl/strings.xml b/quickstep/res/values-nl/strings.xml index 4a3607d0e2..4e3a34c254 100644 --- a/quickstep/res/values-nl/strings.xml +++ b/quickstep/res/values-nl/strings.xml @@ -30,6 +30,5 @@ "Recente apps" "%1$s, %2$s" "< 1 minuut" - "App in grijstinten" "Nog %1$s vandaag" diff --git a/quickstep/res/values-or/strings.xml b/quickstep/res/values-or/strings.xml index 4dd5920135..bd88671938 100644 --- a/quickstep/res/values-or/strings.xml +++ b/quickstep/res/values-or/strings.xml @@ -30,6 +30,5 @@ "ସାମ୍ପ୍ରତିକ ଆପ୍‌" "%1$s %2$s" "< 1 ମିନିଟ୍" - "ଗ୍ରେସ୍କେଲ୍‌ରେ ଥିବା ଆପ୍" "ଆଜି %1$s ବାକି ଅଛି" diff --git a/quickstep/res/values-pa/strings.xml b/quickstep/res/values-pa/strings.xml index 078d8a038f..5aeeae6b3a 100644 --- a/quickstep/res/values-pa/strings.xml +++ b/quickstep/res/values-pa/strings.xml @@ -30,6 +30,5 @@ "ਹਾਲੀਆ ਐਪਾਂ" "%1$s, %2$s" "< 1 ਮਿੰਟ" - "ਐਪ ਗ੍ਰੇਸਕੇਲ ਵਿੱਚ ਹੈ" "ਅੱਜ %1$s ਬਾਕੀ" diff --git a/quickstep/res/values-pl/strings.xml b/quickstep/res/values-pl/strings.xml index aa7920cda2..210edcf011 100644 --- a/quickstep/res/values-pl/strings.xml +++ b/quickstep/res/values-pl/strings.xml @@ -30,6 +30,5 @@ "Ostatnie aplikacje" "%1$s, %2$s" "> 1 min" - "Aplikacja wyszarzona" "Na dziś zostało %1$s" diff --git a/quickstep/res/values-pt-rPT/strings.xml b/quickstep/res/values-pt-rPT/strings.xml index 22dc65495f..8a129d5ea5 100644 --- a/quickstep/res/values-pt-rPT/strings.xml +++ b/quickstep/res/values-pt-rPT/strings.xml @@ -30,6 +30,5 @@ "Aplicações recentes" "%1$s, %2$s" "< 1 minuto" - "Aplic. na Escala de cinz." "Resta(m) %1$s hoje." diff --git a/quickstep/res/values-pt/strings.xml b/quickstep/res/values-pt/strings.xml index b838c96ba0..e5380d560c 100644 --- a/quickstep/res/values-pt/strings.xml +++ b/quickstep/res/values-pt/strings.xml @@ -30,6 +30,5 @@ "Apps recentes" "%1$s, %2$s" "< 1 min" - "App em escala de cinza" "%1$s restante(s) hoje" diff --git a/quickstep/res/values-ro/strings.xml b/quickstep/res/values-ro/strings.xml index a33524e7c9..54452a0584 100644 --- a/quickstep/res/values-ro/strings.xml +++ b/quickstep/res/values-ro/strings.xml @@ -30,6 +30,5 @@ "Aplicații recente" "%1$s, %2$s" "< 1 minut" - "Aplicație în tonuri de gri" "Au mai rămas %1$s astăzi" diff --git a/quickstep/res/values-ru/strings.xml b/quickstep/res/values-ru/strings.xml index 2df583c9be..8b2016ab2f 100644 --- a/quickstep/res/values-ru/strings.xml +++ b/quickstep/res/values-ru/strings.xml @@ -30,6 +30,5 @@ "Недавние приложения" "%1$s: %2$s" "< 1 мин." - "В режиме оттенков серого" "Осталось сегодня: %1$s" diff --git a/quickstep/res/values-si/strings.xml b/quickstep/res/values-si/strings.xml index 010a56ea0f..2163390679 100644 --- a/quickstep/res/values-si/strings.xml +++ b/quickstep/res/values-si/strings.xml @@ -30,6 +30,5 @@ "මෑත යෙදුම්" "%1$s, %2$s" "< 1 විනාඩියක්" - "අලු පැහැ යෙදුම" "අද %1$sක් ඉතුරුයි" diff --git a/quickstep/res/values-sk/strings.xml b/quickstep/res/values-sk/strings.xml index c73a597248..12983db6d6 100644 --- a/quickstep/res/values-sk/strings.xml +++ b/quickstep/res/values-sk/strings.xml @@ -30,6 +30,5 @@ "Nedávne aplikácie" "%1$s, %2$s" "Menej ako 1 minúta" - "Aplikácia je odfarbená" "Dnes ešte zostáva: %1$s" diff --git a/quickstep/res/values-sl/strings.xml b/quickstep/res/values-sl/strings.xml index a7f0704ef5..a940f2bfc8 100644 --- a/quickstep/res/values-sl/strings.xml +++ b/quickstep/res/values-sl/strings.xml @@ -30,6 +30,5 @@ "Nedavne aplikacije" "%1$s, %2$s" "< 1 min" - "Črnobela aplikacija" "Danes je ostalo še %1$s" diff --git a/quickstep/res/values-sq/strings.xml b/quickstep/res/values-sq/strings.xml index b70f142b4f..e41bcb59aa 100644 --- a/quickstep/res/values-sq/strings.xml +++ b/quickstep/res/values-sq/strings.xml @@ -30,6 +30,5 @@ "Aplikacionet e fundit" "%1$s, %2$s" "< 1 minutë" - "Apl. në shkallën e grisë" "%1$s të mbetura sot" diff --git a/quickstep/res/values-sr/strings.xml b/quickstep/res/values-sr/strings.xml index 2cf43f5252..8f26c66501 100644 --- a/quickstep/res/values-sr/strings.xml +++ b/quickstep/res/values-sr/strings.xml @@ -30,6 +30,5 @@ "Недавне апликације" "%1$s, %2$s" "< 1 мин" - "Апликација је у сивилу" "Још %1$s данас" diff --git a/quickstep/res/values-sv/strings.xml b/quickstep/res/values-sv/strings.xml index bec489393b..70740e502c 100644 --- a/quickstep/res/values-sv/strings.xml +++ b/quickstep/res/values-sv/strings.xml @@ -30,6 +30,5 @@ "Senaste apparna" "%1$s, %2$s" "< 1 min" - "App visas i gråskala" "%1$s kvar i dag" diff --git a/quickstep/res/values-sw/strings.xml b/quickstep/res/values-sw/strings.xml index 53d095daf9..c646b6a5fc 100644 --- a/quickstep/res/values-sw/strings.xml +++ b/quickstep/res/values-sw/strings.xml @@ -30,6 +30,5 @@ "Programu za hivi karibuni" "%1$s, %2$s" "< dak 1" - "Programu katika kijivu" "Umebakisha %1$s leo" diff --git a/quickstep/res/values-te/strings.xml b/quickstep/res/values-te/strings.xml index b6eeb40921..071755a95c 100644 --- a/quickstep/res/values-te/strings.xml +++ b/quickstep/res/values-te/strings.xml @@ -30,6 +30,5 @@ "ఇటీవలి యాప్‌లు" "%1$s, %2$s" "< 1 నిమిషం" - "యాప్‌ గ్రేస్కేల్లో ఉంది" "నేటికి %1$s మిగిలి ఉంది" diff --git a/quickstep/res/values-th/strings.xml b/quickstep/res/values-th/strings.xml index c2e173a6af..c0e78cec1f 100644 --- a/quickstep/res/values-th/strings.xml +++ b/quickstep/res/values-th/strings.xml @@ -30,6 +30,5 @@ "แอปล่าสุด" "%1$s %2$s" "<1 นาที" - "แอปที่เป็นโทนสีเทา" "วันนี้เหลืออีก %1$s" diff --git a/quickstep/res/values-tl/strings.xml b/quickstep/res/values-tl/strings.xml index 5588d03fef..76a0b250ac 100644 --- a/quickstep/res/values-tl/strings.xml +++ b/quickstep/res/values-tl/strings.xml @@ -30,6 +30,5 @@ "Mga kamakailang app" "%1$s, %2$s" "< 1 min" - "App na grayscale" "%1$s na lang ngayon" diff --git a/quickstep/res/values-tr/strings.xml b/quickstep/res/values-tr/strings.xml index 40e0d89505..8b59c7bd09 100644 --- a/quickstep/res/values-tr/strings.xml +++ b/quickstep/res/values-tr/strings.xml @@ -30,6 +30,5 @@ "Son uygulamalar" "%1$s, %2$s" "< 1 dk." - "Uygulama gri tonlamada" "Bugün %1$s kaldı" diff --git a/quickstep/res/values-uk/strings.xml b/quickstep/res/values-uk/strings.xml index 104c82cff6..39c3848bd7 100644 --- a/quickstep/res/values-uk/strings.xml +++ b/quickstep/res/values-uk/strings.xml @@ -30,6 +30,5 @@ "Нещодавні додатки" "%1$s, %2$s" "< 1 хв" - "Додаток у відтінку сірого" "Сьогодні залишилося %1$s" diff --git a/quickstep/res/values-ur/strings.xml b/quickstep/res/values-ur/strings.xml index 481bda0990..4fd9e69bf1 100644 --- a/quickstep/res/values-ur/strings.xml +++ b/quickstep/res/values-ur/strings.xml @@ -30,6 +30,5 @@ "حالیہ ایپس" "%1$s،%2$s" "‏< 1 منٹ" - "ایپ خاکستری کیا گیا" "آج %1$s بچا ہے" diff --git a/quickstep/res/values-uz/strings.xml b/quickstep/res/values-uz/strings.xml index 7e9f955924..466d79ea58 100644 --- a/quickstep/res/values-uz/strings.xml +++ b/quickstep/res/values-uz/strings.xml @@ -30,6 +30,5 @@ "Yaqinda ishlatilgan ilovalar" "%1$s, %2$s" "< 1 daqiqa" - "Ilova kulrang rejimida" "Bugun %1$s qoldi" diff --git a/quickstep/res/values-vi/strings.xml b/quickstep/res/values-vi/strings.xml index 3d42063210..842b22bfe1 100644 --- a/quickstep/res/values-vi/strings.xml +++ b/quickstep/res/values-vi/strings.xml @@ -30,6 +30,5 @@ "Ứng dụng gần đây" "%1$s, %2$s" "< 1 phút" - "Ứng dụng có thang màu xám" "Hôm nay còn %1$s" diff --git a/quickstep/res/values-zh-rCN/strings.xml b/quickstep/res/values-zh-rCN/strings.xml index 4a13d14bd3..951489fff7 100644 --- a/quickstep/res/values-zh-rCN/strings.xml +++ b/quickstep/res/values-zh-rCN/strings.xml @@ -30,6 +30,5 @@ "最近用过的应用" "%1$s%2$s)" "不到 1 分钟" - "灰度模式下的应用" "今天还可使用 %1$s" diff --git a/quickstep/res/values-zh-rHK/strings.xml b/quickstep/res/values-zh-rHK/strings.xml index 02d9b8ee43..361623dfad 100644 --- a/quickstep/res/values-zh-rHK/strings.xml +++ b/quickstep/res/values-zh-rHK/strings.xml @@ -30,6 +30,5 @@ "最近使用的應用程式" "%1$s%2$s" "少於 1 分鐘" - "切換至灰階螢幕的應用程式" "今天剩餘時間:%1$s" diff --git a/quickstep/res/values-zh-rTW/strings.xml b/quickstep/res/values-zh-rTW/strings.xml index 20181fdf6d..6938d3e816 100644 --- a/quickstep/res/values-zh-rTW/strings.xml +++ b/quickstep/res/values-zh-rTW/strings.xml @@ -30,6 +30,5 @@ "最近使用的應用程式" "%1$s (%2$s)" "< 1 分鐘" - "切換為灰階模式的應用程式" "今天還能使用 %1$s" diff --git a/quickstep/res/values-zu/strings.xml b/quickstep/res/values-zu/strings.xml index abbbc95f00..98f7b02d9a 100644 --- a/quickstep/res/values-zu/strings.xml +++ b/quickstep/res/values-zu/strings.xml @@ -30,6 +30,5 @@ "Izinhlelo zokusebenza zakamuva" "%1$s, %2$s" "< 1 iminithi" - "Uhlelo lokusebenza nge-grayscale" "%1$s esele namhlanje" diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml index 56ef414a6b..19f537ffbd 100644 --- a/res/values-ca/strings.xml +++ b/res/values-ca/strings.xml @@ -33,7 +33,7 @@ "Fes doble toc i mantén premut per seleccionar un widget o per utilitzar les accions personalitzades." "%1$d × %2$d" "%1$d d\'amplada per %2$d d\'alçada" - "Toca i mantén premut l\'element per col·locar-lo manualment" + "Mantén premut l\'element per afegir-lo manualment" "Afegeix automàticament" "Cerca aplicacions" "S\'estan carregant les aplicacions…" diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml index c58620e226..58b65da032 100644 --- a/res/values-ko/strings.xml +++ b/res/values-ko/strings.xml @@ -33,7 +33,7 @@ "위젯을 선택하려면 두 번 탭한 다음 길게 터치하거나 맞춤 액션을 사용합니다." "%1$d×%2$d" "너비 %1$d, 높이 %2$d" - "길게 터치하여 직접 장소 추가" + "길게 터치하여 직접 추가" "자동으로 추가" "앱 검색" "앱 로드 중…" diff --git a/res/values-pt-rPT/strings.xml b/res/values-pt-rPT/strings.xml index b26b812162..68a08a9eb5 100644 --- a/res/values-pt-rPT/strings.xml +++ b/res/values-pt-rPT/strings.xml @@ -104,7 +104,7 @@ "Widgets de %1$s" "Lista de widgets" "Lista de widgets fechada." - "Adicionar ao Ecrã principal" + "Adicionar ao ecrã principal" "Mover o item para aqui" "Item adicionado ao ecrã principal" "Item removido" From 6f455b583f6c37eafcb357b0727dbb0133db21ad Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Wed, 27 Mar 2019 08:27:16 -0700 Subject: [PATCH 12/19] Fix sizing of FloatingIconView so that it matches the workspace. * Added a cross fade at the end for text and shadows. * Animate in FolderIcon bg/dot/text after swapping. Bug: 129297366 Change-Id: Ieeb5d7b8fb389a2f7ee263d38b3021ffdefefd93 --- src/com/android/launcher3/BubbleTextView.java | 3 +- src/com/android/launcher3/folder/Folder.java | 3 +- .../android/launcher3/folder/FolderIcon.java | 9 +++ .../launcher3/views/FloatingIconView.java | 78 +++++++++++++++---- 4 files changed, 76 insertions(+), 17 deletions(-) diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index d75006e893..4dd2e0a764 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -480,7 +480,8 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, */ public ObjectAnimator createTextAlphaAnimator(boolean fadeIn) { float toAlpha = shouldTextBeVisible() && fadeIn ? 1 : 0; - return ObjectAnimator.ofFloat(this, TEXT_ALPHA_PROPERTY, toAlpha); + float fromAlpha = toAlpha == 1 ? 0 : 1f; + return ObjectAnimator.ofFloat(this, TEXT_ALPHA_PROPERTY, fromAlpha, toAlpha); } @Override diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java index 7a14b36b03..bcddd037e8 100644 --- a/src/com/android/launcher3/folder/Folder.java +++ b/src/com/android/launcher3/folder/Folder.java @@ -618,8 +618,7 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo mFolderIcon.setBackgroundVisible(true); mFolderIcon.mFolderName.setTextVisibility(true); if (wasAnimated) { - mFolderIcon.mBackground.fadeInBackgroundShadow(); - mFolderIcon.mBackground.animateBackgroundStroke(); + mFolderIcon.animateBgShadowAndStroke(); mFolderIcon.onFolderClose(mContent.getCurrentPage()); if (mFolderIcon.hasDot()) { mFolderIcon.animateDotScale(0f, 1f); diff --git a/src/com/android/launcher3/folder/FolderIcon.java b/src/com/android/launcher3/folder/FolderIcon.java index 71c91488be..521f5c1631 100644 --- a/src/com/android/launcher3/folder/FolderIcon.java +++ b/src/com/android/launcher3/folder/FolderIcon.java @@ -189,6 +189,15 @@ public class FolderIcon extends FrameLayout implements FolderListener { return icon; } + public void animateBgShadowAndStroke() { + mBackground.fadeInBackgroundShadow(); + mBackground.animateBackgroundStroke(); + } + + public BubbleTextView getFolderName() { + return mFolderName; + } + public void getPreviewBounds(Rect outBounds) { mBackground.getBounds(outBounds); } diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java index 2a5418d081..a4f89a7180 100644 --- a/src/com/android/launcher3/views/FloatingIconView.java +++ b/src/com/android/launcher3/views/FloatingIconView.java @@ -19,6 +19,8 @@ import static com.android.launcher3.config.FeatureFlags.ADAPTIVE_ICON_WINDOW_ANI import android.animation.Animator; import android.animation.AnimatorListenerAdapter; +import android.animation.AnimatorSet; +import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.content.Context; import android.graphics.Canvas; @@ -47,6 +49,7 @@ import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.anim.Interpolators; import com.android.launcher3.dragndrop.DragLayer; +import com.android.launcher3.dragndrop.FolderAdaptiveIcon; import com.android.launcher3.folder.FolderIcon; import com.android.launcher3.folder.FolderShape; import com.android.launcher3.graphics.ShiftedBitmapDrawable; @@ -157,11 +160,13 @@ public class FloatingIconView extends View implements Animator.AnimatorListener, @Override public void onAnimationEnd(Animator animator) { - if (mRevealAnimator != null) { - mRevealAnimator.end(); - } if (mEndRunnable != null) { mEndRunnable.run(); + } else { + // End runnable also ends the reveal animator, so we manually handle it here. + if (mRevealAnimator != null) { + mRevealAnimator.end(); + } } } @@ -221,6 +226,7 @@ public class FloatingIconView extends View implements Animator.AnimatorListener, new Handler(Looper.getMainLooper()).post(() -> { if (isAdaptiveIcon) { mIsAdaptiveIcon = true; + boolean isFolderIcon = finalDrawable instanceof FolderAdaptiveIcon; AdaptiveIconDrawable adaptiveIcon = (AdaptiveIconDrawable) finalDrawable; Drawable background = adaptiveIcon.getBackground(); @@ -234,20 +240,27 @@ public class FloatingIconView extends View implements Animator.AnimatorListener, } mForeground = foreground; - mFinalDrawableBounds.set(iconOffset, iconOffset, lp.width - - iconOffset, mOriginalHeight - iconOffset); if (mForeground instanceof ShiftedBitmapDrawable && v instanceof FolderIcon) { ShiftedBitmapDrawable sbd = (ShiftedBitmapDrawable) mForeground; ((FolderIcon) v).getPreviewBounds(sTmpRect); sbd.setShiftX(sbd.getShiftX() - sTmpRect.left); sbd.setShiftY(sbd.getShiftY() - sTmpRect.top); } + + int blurMargin = mBlurSizeOutline / 2; + mFinalDrawableBounds.set(0, 0, lp.width, mOriginalHeight); + if (!isFolderIcon) { + mFinalDrawableBounds.inset(iconOffset - blurMargin, iconOffset - blurMargin); + } mForeground.setBounds(mFinalDrawableBounds); mBackground.setBounds(mFinalDrawableBounds); - int blurMargin = mBlurSizeOutline / 2; - mStartRevealRect.set(blurMargin, blurMargin , lp.width - blurMargin, - mOriginalHeight - blurMargin); + if (isFolderIcon) { + mStartRevealRect.set(0, 0, lp.width, mOriginalHeight); + } else { + mStartRevealRect.set(mBlurSizeOutline, mBlurSizeOutline, + lp.width - mBlurSizeOutline, mOriginalHeight - mBlurSizeOutline); + } if (aspectRatio > 0) { lp.height = (int) Math.max(lp.height, lp.width * aspectRatio); @@ -380,12 +393,49 @@ public class FloatingIconView extends View implements Animator.AnimatorListener, originalView.setVisibility(INVISIBLE); } }; - view.mEndRunnable = () -> { - ((ViewGroup) dragLayer.getParent()).getOverlay().remove(view); - if (hideOriginal) { - originalView.setVisibility(VISIBLE); - } - }; + if (hideOriginal) { + view.mEndRunnable = () -> { + AnimatorSet fade = new AnimatorSet(); + fade.setDuration(200); + fade.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationStart(Animator animation) { + originalView.setVisibility(VISIBLE); + + if (originalView instanceof FolderIcon) { + FolderIcon folderIcon = (FolderIcon) originalView; + folderIcon.setBackgroundVisible(false); + folderIcon.getFolderName().setTextVisibility(false); + } + } + + @Override + public void onAnimationEnd(Animator animation) { + ((ViewGroup) dragLayer.getParent()).getOverlay().remove(view); + + if (view.mRevealAnimator != null) { + view.mRevealAnimator.end(); + } + } + }); + + if (originalView instanceof FolderIcon) { + FolderIcon folderIcon = (FolderIcon) originalView; + fade.play(folderIcon.getFolderName().createTextAlphaAnimator(true)); + fade.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + folderIcon.setBackgroundVisible(true); + folderIcon.animateBgShadowAndStroke(); + folderIcon.animateDotScale(0, 1f); + } + }); + } else { + fade.play(ObjectAnimator.ofFloat(originalView, ALPHA, 0f, 1f)); + } + fade.start(); + }; + } return view; } } From 64df57944649626fd20d05335a333c4012b89ddf Mon Sep 17 00:00:00 2001 From: vadimt Date: Wed, 27 Mar 2019 11:06:10 -0700 Subject: [PATCH 13/19] Improving TAPL diags Bug: 128531133 Change-Id: Iba33011b5cb315731b5104005ef5773e539a21ea --- .../launcher3/tapl/LauncherInstrumentation.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 19b368f4f8..652322e55e 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -320,20 +320,21 @@ public final class LauncherInstrumentation { // We need waiting for any accessibility event generated after pressing Home because // otherwise waitForIdle may return immediately in case when there was a big enough pause in // accessibility events prior to pressing Home. + final String action; if (getNavigationModel() == NavigationModel.ZERO_BUTTON) { if (hasLauncherObject(WORKSPACE_RES_ID)) { - log("0-button pressHome: already in workspace"); + log(action = "0-button: already in workspace"); } else if (hasLauncherObject(OVERVIEW_RES_ID)) { - log("0-button pressHome: overview"); + log(action = "0-button: from overview"); mDevice.pressHome(); } else if (hasLauncherObject(WIDGETS_RES_ID)) { - log("0-button pressHome: widgets"); + log(action = "0-button: from widgets"); mDevice.pressHome(); } else if (hasLauncherObject(APPS_RES_ID)) { - log("0-button pressHome: all apps"); + log(action = "0-button: from all apps"); mDevice.pressHome(); } else { - log("0-button pressHome: another app"); + log(action = "0-button: from another app"); assertTrue("Launcher is visible, don't know how to go home", !mDevice.hasObject(By.pkg(getLauncherPackageName()))); final UiObject2 navBar = waitForSystemUiObject("navigation_bar_frame"); @@ -344,6 +345,7 @@ public final class LauncherInstrumentation { BACKGROUND_APP_STATE_ORDINAL, ZERO_BUTTON_STEPS_FROM_BACKGROUND_TO_HOME); } } else { + log(action = "clicking home button"); executeAndWaitForEvent( () -> { log("LauncherInstrumentation.pressHome before clicking"); @@ -363,7 +365,10 @@ public final class LauncherInstrumentation { "Pressing Home didn't produce any events"); mDevice.waitForIdle(); } - return getWorkspace(); + try (LauncherInstrumentation.Closable c = addContextLayer( + "performed action to switch to Home - " + action)) { + return getWorkspace(); + } } /** From 9244f518f2a4d88d61cdf9e522c47aeedd43fdd6 Mon Sep 17 00:00:00 2001 From: Tony Date: Tue, 19 Mar 2019 14:55:22 -0500 Subject: [PATCH 14/19] Add FLAG_DONT_ANIMATE_OVERVIEW to AnimatorSetBuilder This allows us to specify when a second animation will handle the overview animation, so it doesn't conflict with existing state transitions. Bug: 125362112 Change-Id: I497c02924862bfba558c107bee3c88a9f40ec0f1 --- .../FlingAndHoldTouchController.java | 21 +++++++++++++++++-- .../BaseRecentsViewStateController.java | 4 ++++ .../PortraitStatesTouchController.java | 7 +++++++ .../launcher3/LauncherStateManager.java | 1 - .../launcher3/anim/AnimatorSetBuilder.java | 16 +++++++++----- 5 files changed, 41 insertions(+), 8 deletions(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/FlingAndHoldTouchController.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/FlingAndHoldTouchController.java index a41362f450..a9c8f0dfe9 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/FlingAndHoldTouchController.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/FlingAndHoldTouchController.java @@ -46,7 +46,7 @@ public class FlingAndHoldTouchController extends PortraitStatesTouchController { super.onDragStart(start); - if (mStartState == NORMAL) { + if (handlingOverviewAnim()) { mMotionPauseDetector.setOnMotionPauseListener(isPaused -> { RecentsView recentsView = mLauncher.getOverviewPanel(); recentsView.setOverviewStateEnabled(isPaused); @@ -55,6 +55,14 @@ public class FlingAndHoldTouchController extends PortraitStatesTouchController { } } + /** + * @return Whether we are handling the overview animation, rather than + * having it as part of the existing animation to the target state. + */ + private boolean handlingOverviewAnim() { + return mStartState == NORMAL; + } + @Override public boolean onDrag(float displacement) { mMotionPauseDetector.addPosition(displacement, 0); @@ -63,7 +71,7 @@ public class FlingAndHoldTouchController extends PortraitStatesTouchController { @Override public void onDragEnd(float velocity, boolean fling) { - if (mMotionPauseDetector.isPaused() && mStartState == NORMAL) { + if (mMotionPauseDetector.isPaused() && handlingOverviewAnim()) { float range = getShiftRange(); long maxAccuracy = (long) (2 * range); @@ -93,4 +101,13 @@ public class FlingAndHoldTouchController extends PortraitStatesTouchController { } mMotionPauseDetector.clear(); } + + @Override + protected void updateAnimatorBuilderOnReinit(AnimatorSetBuilder builder) { + if (handlingOverviewAnim()) { + // We don't want the state transition to all apps to animate overview, + // as that will cause a jump after our atomic animation. + builder.addFlag(AnimatorSetBuilder.FLAG_DONT_ANIMATE_OVERVIEW); + } + } } diff --git a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java index e74d84dc28..50e59af490 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java @@ -19,6 +19,7 @@ package com.android.launcher3.uioverrides; import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_FADE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_SCALE; +import static com.android.launcher3.anim.AnimatorSetBuilder.FLAG_DONT_ANIMATE_OVERVIEW; import static com.android.launcher3.anim.Interpolators.AGGRESSIVE_EASE_IN_OUT; import static com.android.launcher3.anim.Interpolators.LINEAR; @@ -66,6 +67,9 @@ public abstract class BaseRecentsViewStateController // The entire recents animation is played atomically. return; } + if (builder.hasFlag(FLAG_DONT_ANIMATE_OVERVIEW)) { + return; + } setStateWithAnimationInternal(toState, builder, config); } diff --git a/quickstep/src/com/android/launcher3/uioverrides/PortraitStatesTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/PortraitStatesTouchController.java index d20ffbb114..62e525c49a 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/PortraitStatesTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/PortraitStatesTouchController.java @@ -195,6 +195,7 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr final AnimatorSetBuilder builder = totalShift == 0 ? new AnimatorSetBuilder() : getAnimatorSetBuilderForStates(mFromState, mToState); + updateAnimatorBuilderOnReinit(builder); cancelPendingAnim(); @@ -228,6 +229,12 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr return 1 / totalShift; } + /** + * Give subclasses the chance to update the animation when we re-initialize towards a new state. + */ + protected void updateAnimatorBuilderOnReinit(AnimatorSetBuilder builder) { + } + private void cancelPendingAnim() { if (mPendingAnimation != null) { mPendingAnimation.finish(false, Touch.SWIPE); diff --git a/src/com/android/launcher3/LauncherStateManager.java b/src/com/android/launcher3/LauncherStateManager.java index f6b54f2441..97c8f51ccc 100644 --- a/src/com/android/launcher3/LauncherStateManager.java +++ b/src/com/android/launcher3/LauncherStateManager.java @@ -373,7 +373,6 @@ public class LauncherStateManager { AnimatorSetBuilder builder, final Runnable onCompleteRunnable) { for (StateHandler handler : getStateHandlers()) { - builder.startTag(handler); handler.setStateWithAnimation(state, builder, mConfig); } diff --git a/src/com/android/launcher3/anim/AnimatorSetBuilder.java b/src/com/android/launcher3/anim/AnimatorSetBuilder.java index fdac5c85fb..e135c0d7d8 100644 --- a/src/com/android/launcher3/anim/AnimatorSetBuilder.java +++ b/src/com/android/launcher3/anim/AnimatorSetBuilder.java @@ -35,15 +35,13 @@ public class AnimatorSetBuilder { public static final int ANIM_OVERVIEW_FADE = 4; public static final int ANIM_ALL_APPS_FADE = 5; + public static final int FLAG_DONT_ANIMATE_OVERVIEW = 1 << 0; + protected final ArrayList mAnims = new ArrayList<>(); private final SparseArray mInterpolators = new SparseArray<>(); private List mOnFinishRunnables = new ArrayList<>(); - - /** - * Associates a tag with all the animations added after this call. - */ - public void startTag(Object obj) { } + private int mFlags = 0; public void play(Animator anim) { mAnims.add(anim); @@ -77,4 +75,12 @@ public class AnimatorSetBuilder { public void setInterpolator(int animId, Interpolator interpolator) { mInterpolators.put(animId, interpolator); } + + public void addFlag(int flag) { + mFlags |= flag; + } + + public boolean hasFlag(int flag) { + return (mFlags & flag) != 0; + } } From bc23440d738338dd357fccb77013a6dab9209d00 Mon Sep 17 00:00:00 2001 From: Tony Date: Tue, 19 Mar 2019 13:30:25 -0500 Subject: [PATCH 15/19] Add translationX to overview state States return ScaleAndTranslation instead of float[]. Also separate overview translate interpolator from overview scale interpolator. Change-Id: I5e65dde3f436055ff5e7f5736f1a4b712377b9cb --- .../launcher3/uioverrides/OverviewState.java | 4 +- .../uioverrides/BackgroundAppState.java | 4 +- .../launcher3/uioverrides/OverviewState.java | 8 ++-- .../LauncherActivityControllerHelper.java | 11 +++-- .../launcher3/uioverrides/AllAppsState.java | 12 ++--- .../BaseRecentsViewStateController.java | 44 ++++++++++--------- src/com/android/launcher3/LauncherState.java | 22 +++++++--- .../WorkspaceStateTransitionAnimation.java | 18 ++++---- .../launcher3/anim/AnimatorSetBuilder.java | 5 ++- .../launcher3/states/SpringLoadedState.java | 10 ++--- .../launcher3/uioverrides/AllAppsState.java | 6 +-- 11 files changed, 80 insertions(+), 64 deletions(-) diff --git a/go/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java b/go/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java index cec12a8d18..14c3495548 100644 --- a/go/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java +++ b/go/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java @@ -43,8 +43,8 @@ public class OverviewState extends LauncherState { } @Override - public float[] getOverviewScaleAndTranslationY(Launcher launcher) { - return new float[] {1f, 0f}; + public ScaleAndTranslation getOverviewScaleAndTranslation(Launcher launcher) { + return new ScaleAndTranslation(1f, 0f, 0f); } @Override diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/BackgroundAppState.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/BackgroundAppState.java index f7127537a5..726ae0504e 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/BackgroundAppState.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/BackgroundAppState.java @@ -52,7 +52,7 @@ public class BackgroundAppState extends OverviewState { } @Override - public float[] getOverviewScaleAndTranslationY(Launcher launcher) { + public ScaleAndTranslation getOverviewScaleAndTranslation(Launcher launcher) { // Initialize the recents view scale to what it would be when starting swipe up RecentsView recentsView = launcher.getOverviewPanel(); recentsView.getTaskSize(sTempRect); @@ -71,7 +71,7 @@ public class BackgroundAppState extends OverviewState { } } float scale = (float) appWidth / sTempRect.width(); - return new float[] { scale, 0f }; + return new ScaleAndTranslation(scale, 0f, 0f); } @Override diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/OverviewState.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/OverviewState.java index 2360eebc46..db02c53d1f 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/OverviewState.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/OverviewState.java @@ -56,7 +56,7 @@ public class OverviewState extends LauncherState { } @Override - public float[] getWorkspaceScaleAndTranslation(Launcher launcher) { + public ScaleAndTranslation getWorkspaceScaleAndTranslation(Launcher launcher) { RecentsView recentsView = launcher.getOverviewPanel(); Workspace workspace = launcher.getWorkspace(); View workspacePage = workspace.getPageAt(workspace.getCurrentPage()); @@ -65,12 +65,12 @@ public class OverviewState extends LauncherState { recentsView.getTaskSize(sTempRect); float scale = (float) sTempRect.width() / workspacePageWidth; float parallaxFactor = 0.5f; - return new float[]{scale, 0, -getDefaultSwipeHeight(launcher) * parallaxFactor}; + return new ScaleAndTranslation(scale, 0, -getDefaultSwipeHeight(launcher) * parallaxFactor); } @Override - public float[] getOverviewScaleAndTranslationY(Launcher launcher) { - return new float[] {1f, 0f}; + public ScaleAndTranslation getOverviewScaleAndTranslation(Launcher launcher) { + return new ScaleAndTranslation(1f, 0f, 0f); } @Override diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java index 279b83c238..9763063b68 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java @@ -16,7 +16,6 @@ package com.android.quickstep; import static android.view.View.TRANSLATION_Y; - import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY; import static com.android.launcher3.LauncherState.BACKGROUND_APP; import static com.android.launcher3.LauncherState.NORMAL; @@ -39,10 +38,6 @@ import android.view.MotionEvent; import android.view.View; import android.view.animation.Interpolator; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.annotation.UiThread; - import com.android.launcher3.DeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherAppState; @@ -67,6 +62,10 @@ import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import java.util.function.BiPredicate; import java.util.function.Consumer; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.UiThread; + /** * {@link ActivityControlHelper} for the in-launcher recents. */ @@ -305,7 +304,7 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe // starting to line up the side pages during swipe up) float prevRvScale = recentsView.getScaleX(); float prevRvTransY = recentsView.getTranslationY(); - float targetRvScale = endState.getOverviewScaleAndTranslationY(launcher)[0]; + float targetRvScale = endState.getOverviewScaleAndTranslation(launcher).scale; SCALE_PROPERTY.set(recentsView, targetRvScale); recentsView.setTranslationY(0); ClipAnimationHelper clipHelper = new ClipAnimationHelper(launcher); diff --git a/quickstep/src/com/android/launcher3/uioverrides/AllAppsState.java b/quickstep/src/com/android/launcher3/uioverrides/AllAppsState.java index 5ae562e8bd..c629e3360a 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/AllAppsState.java +++ b/quickstep/src/com/android/launcher3/uioverrides/AllAppsState.java @@ -60,10 +60,10 @@ public class AllAppsState extends LauncherState { } @Override - public float[] getWorkspaceScaleAndTranslation(Launcher launcher) { - float[] scaleAndTranslation = LauncherState.OVERVIEW.getWorkspaceScaleAndTranslation( - launcher); - scaleAndTranslation[0] = 1; + public ScaleAndTranslation getWorkspaceScaleAndTranslation(Launcher launcher) { + ScaleAndTranslation scaleAndTranslation = LauncherState.OVERVIEW + .getWorkspaceScaleAndTranslation(launcher); + scaleAndTranslation.scale = 1; return scaleAndTranslation; } @@ -78,9 +78,9 @@ public class AllAppsState extends LauncherState { } @Override - public float[] getOverviewScaleAndTranslationY(Launcher launcher) { + public ScaleAndTranslation getOverviewScaleAndTranslation(Launcher launcher) { float slightParallax = -launcher.getDeviceProfile().allAppsCellHeightPx * 0.3f; - return new float[] {0.9f, slightParallax}; + return new ScaleAndTranslation(0.9f, 0f, slightParallax); } @Override diff --git a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java index 50e59af490..7b8699059e 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java @@ -19,6 +19,7 @@ package com.android.launcher3.uioverrides; import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_FADE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_SCALE; +import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_TRANSLATE; import static com.android.launcher3.anim.AnimatorSetBuilder.FLAG_DONT_ANIMATE_OVERVIEW; import static com.android.launcher3.anim.Interpolators.AGGRESSIVE_EASE_IN_OUT; import static com.android.launcher3.anim.Interpolators.LINEAR; @@ -29,6 +30,7 @@ import android.view.animation.Interpolator; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; +import com.android.launcher3.LauncherState.ScaleAndTranslation; import com.android.launcher3.LauncherStateManager.AnimationConfig; import com.android.launcher3.LauncherStateManager.StateHandler; import com.android.launcher3.anim.AnimatorSetBuilder; @@ -54,9 +56,15 @@ public abstract class BaseRecentsViewStateController @Override public void setState(@NonNull LauncherState state) { - float[] scaleTranslationY = state.getOverviewScaleAndTranslationY(mLauncher); - SCALE_PROPERTY.set(mRecentsView, scaleTranslationY[0]); - mRecentsView.setTranslationY(scaleTranslationY[1]); + ScaleAndTranslation scaleAndTranslation = state + .getOverviewScaleAndTranslation(mLauncher); + SCALE_PROPERTY.set(mRecentsView, scaleAndTranslation.scale); + float translationX = scaleAndTranslation.translationX; + if (mRecentsView.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) { + translationX = -translationX; + } + mRecentsView.setTranslationX(translationX); + mRecentsView.setTranslationY(scaleAndTranslation.translationY); getContentAlphaProperty().set(mRecentsView, state.overviewUi ? 1f : 0); } @@ -83,28 +91,22 @@ public abstract class BaseRecentsViewStateController void setStateWithAnimationInternal(@NonNull final LauncherState toState, @NonNull AnimatorSetBuilder builder, @NonNull AnimationConfig config) { PropertySetter setter = config.getPropertySetter(builder); - float[] scaleTranslationY = toState.getOverviewScaleAndTranslationY(mLauncher); - Interpolator scaleAndTransYInterpolator = getScaleAndTransYInterpolator(toState, builder); - setter.setFloat(mRecentsView, SCALE_PROPERTY, scaleTranslationY[0], - scaleAndTransYInterpolator); - setter.setFloat(mRecentsView, View.TRANSLATION_Y, scaleTranslationY[1], - scaleAndTransYInterpolator); + ScaleAndTranslation scaleAndTranslation = toState.getOverviewScaleAndTranslation(mLauncher); + Interpolator scaleInterpolator = builder.getInterpolator(ANIM_OVERVIEW_SCALE, LINEAR); + setter.setFloat(mRecentsView, SCALE_PROPERTY, scaleAndTranslation.scale, scaleInterpolator); + Interpolator translateInterpolator = builder.getInterpolator( + ANIM_OVERVIEW_TRANSLATE, LINEAR); + float translationX = scaleAndTranslation.translationX; + if (mRecentsView.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) { + translationX = -translationX; + } + setter.setFloat(mRecentsView, View.TRANSLATION_X, translationX, translateInterpolator); + setter.setFloat(mRecentsView, View.TRANSLATION_Y, scaleAndTranslation.translationY, + translateInterpolator); setter.setFloat(mRecentsView, getContentAlphaProperty(), toState.overviewUi ? 1 : 0, builder.getInterpolator(ANIM_OVERVIEW_FADE, AGGRESSIVE_EASE_IN_OUT)); } - /** - * Get the interpolator to use for the scale and translation Y animation for the view. - * - * @param toState state to animate to - * @param builder animator set builder - * @return interpolator for scale and trans Y recents view animation - */ - Interpolator getScaleAndTransYInterpolator(@NonNull final LauncherState toState, - @NonNull AnimatorSetBuilder builder) { - return builder.getInterpolator(ANIM_OVERVIEW_SCALE, LINEAR); - } - /** * Get property for content alpha for the recents view. * diff --git a/src/com/android/launcher3/LauncherState.java b/src/com/android/launcher3/LauncherState.java index 875288a55c..b6e00cc8aa 100644 --- a/src/com/android/launcher3/LauncherState.java +++ b/src/com/android/launcher3/LauncherState.java @@ -183,17 +183,17 @@ public class LauncherState { return Arrays.copyOf(sAllStates, sAllStates.length); } - public float[] getWorkspaceScaleAndTranslation(Launcher launcher) { - return new float[] {1, 0, 0}; + public ScaleAndTranslation getWorkspaceScaleAndTranslation(Launcher launcher) { + return new ScaleAndTranslation(1, 0, 0); } - public float[] getHotseatScaleAndTranslation(Launcher launcher) { + public ScaleAndTranslation getHotseatScaleAndTranslation(Launcher launcher) { // For most states, treat the hotseat as if it were part of the workspace. return getWorkspaceScaleAndTranslation(launcher); } - public float[] getOverviewScaleAndTranslationY(Launcher launcher) { - return new float[] {1.1f, 0f}; + public ScaleAndTranslation getOverviewScaleAndTranslation(Launcher launcher) { + return new ScaleAndTranslation(1.1f, 0f, 0f); } public void onStateEnabled(Launcher launcher) { @@ -281,4 +281,16 @@ public class LauncherState { public abstract float getPageAlpha(int pageIndex); } + + public static class ScaleAndTranslation { + public float scale; + public float translationX; + public float translationY; + + public ScaleAndTranslation(float scale, float translationX, float translationY) { + this.scale = scale; + this.translationX = translationX; + this.translationY = translationY; + } + } } diff --git a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java index 0507470e5e..d0f1920e73 100644 --- a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java +++ b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java @@ -31,6 +31,7 @@ import android.view.View; import android.view.animation.Interpolator; import com.android.launcher3.LauncherState.PageAlphaProvider; +import com.android.launcher3.LauncherState.ScaleAndTranslation; import com.android.launcher3.LauncherStateManager.AnimationConfig; import com.android.launcher3.anim.AnimatorSetBuilder; import com.android.launcher3.anim.PropertySetter; @@ -71,9 +72,10 @@ public class WorkspaceStateTransitionAnimation { */ private void setWorkspaceProperty(LauncherState state, PropertySetter propertySetter, AnimatorSetBuilder builder, AnimationConfig config) { - float[] scaleAndTranslation = state.getWorkspaceScaleAndTranslation(mLauncher); - float[] hotseatScaleAndTranslation = state.getHotseatScaleAndTranslation(mLauncher); - mNewScale = scaleAndTranslation[0]; + ScaleAndTranslation scaleAndTranslation = state.getWorkspaceScaleAndTranslation(mLauncher); + ScaleAndTranslation hotseatScaleAndTranslation = state.getHotseatScaleAndTranslation( + mLauncher); + mNewScale = scaleAndTranslation.scale; PageAlphaProvider pageAlphaProvider = state.getWorkspacePageAlphaProvider(mLauncher); final int childCount = mWorkspace.getChildCount(); for (int i = 0; i < childCount; i++) { @@ -98,7 +100,7 @@ public class WorkspaceStateTransitionAnimation { dragLayer.mapCoordInSelfToDescendant(hotseat, workspacePivot); hotseat.setPivotX(workspacePivot[0]); hotseat.setPivotY(workspacePivot[1]); - float hotseatScale = hotseatScaleAndTranslation[0]; + float hotseatScale = hotseatScaleAndTranslation.scale; propertySetter.setFloat(hotseat, SCALE_PROPERTY, hotseatScale, scaleInterpolator); float hotseatIconsAlpha = (elements & HOTSEAT_ICONS) != 0 ? 1 : 0; @@ -114,14 +116,14 @@ public class WorkspaceStateTransitionAnimation { Interpolator translationInterpolator = !playAtomicComponent ? LINEAR : ZOOM_OUT; propertySetter.setFloat(mWorkspace, View.TRANSLATION_X, - scaleAndTranslation[1], translationInterpolator); + scaleAndTranslation.translationX, translationInterpolator); propertySetter.setFloat(mWorkspace, View.TRANSLATION_Y, - scaleAndTranslation[2], translationInterpolator); + scaleAndTranslation.translationY, translationInterpolator); propertySetter.setFloat(hotseat, View.TRANSLATION_Y, - hotseatScaleAndTranslation[2], translationInterpolator); + hotseatScaleAndTranslation.translationX, translationInterpolator); propertySetter.setFloat(mWorkspace.getPageIndicator(), View.TRANSLATION_Y, - hotseatScaleAndTranslation[2], translationInterpolator); + hotseatScaleAndTranslation.translationY, translationInterpolator); // Set scrim WorkspaceAndHotseatScrim scrim = mLauncher.getDragLayer().getScrim(); diff --git a/src/com/android/launcher3/anim/AnimatorSetBuilder.java b/src/com/android/launcher3/anim/AnimatorSetBuilder.java index e135c0d7d8..3ac9d3c276 100644 --- a/src/com/android/launcher3/anim/AnimatorSetBuilder.java +++ b/src/com/android/launcher3/anim/AnimatorSetBuilder.java @@ -32,8 +32,9 @@ public class AnimatorSetBuilder { public static final int ANIM_WORKSPACE_SCALE = 1; public static final int ANIM_WORKSPACE_FADE = 2; public static final int ANIM_OVERVIEW_SCALE = 3; - public static final int ANIM_OVERVIEW_FADE = 4; - public static final int ANIM_ALL_APPS_FADE = 5; + public static final int ANIM_OVERVIEW_TRANSLATE = 4; + public static final int ANIM_OVERVIEW_FADE = 5; + public static final int ANIM_ALL_APPS_FADE = 6; public static final int FLAG_DONT_ANIMATE_OVERVIEW = 1 << 0; diff --git a/src/com/android/launcher3/states/SpringLoadedState.java b/src/com/android/launcher3/states/SpringLoadedState.java index fcace98c21..be3e6c9cbc 100644 --- a/src/com/android/launcher3/states/SpringLoadedState.java +++ b/src/com/android/launcher3/states/SpringLoadedState.java @@ -41,7 +41,7 @@ public class SpringLoadedState extends LauncherState { } @Override - public float[] getWorkspaceScaleAndTranslation(Launcher launcher) { + public ScaleAndTranslation getWorkspaceScaleAndTranslation(Launcher launcher) { DeviceProfile grid = launcher.getDeviceProfile(); Workspace ws = launcher.getWorkspace(); if (ws.getChildCount() == 0) { @@ -50,7 +50,7 @@ public class SpringLoadedState extends LauncherState { if (grid.isVerticalBarLayout()) { float scale = grid.workspaceSpringLoadShrinkFactor; - return new float[] {scale, 0, 0}; + return new ScaleAndTranslation(scale, 0, 0); } float scale = grid.workspaceSpringLoadShrinkFactor; @@ -69,12 +69,12 @@ public class SpringLoadedState extends LauncherState { float myCenter = ws.getTop() + halfHeight; float cellTopFromCenter = halfHeight - ws.getChildAt(0).getTop(); float actualCellTop = myCenter - cellTopFromCenter * scale; - return new float[] { scale, 0, (desiredCellTop - actualCellTop) / scale}; + return new ScaleAndTranslation(scale, 0, (desiredCellTop - actualCellTop) / scale); } @Override - public float[] getHotseatScaleAndTranslation(Launcher launcher) { - return new float[] {1, 0, 0}; + public ScaleAndTranslation getHotseatScaleAndTranslation(Launcher launcher) { + return new ScaleAndTranslation(1, 0, 0); } @Override diff --git a/src_ui_overrides/com/android/launcher3/uioverrides/AllAppsState.java b/src_ui_overrides/com/android/launcher3/uioverrides/AllAppsState.java index f7bb254565..bca335d873 100644 --- a/src_ui_overrides/com/android/launcher3/uioverrides/AllAppsState.java +++ b/src_ui_overrides/com/android/launcher3/uioverrides/AllAppsState.java @@ -66,9 +66,9 @@ public class AllAppsState extends LauncherState { } @Override - public float[] getWorkspaceScaleAndTranslation(Launcher launcher) { - return new float[] { 1f, 0, - -launcher.getAllAppsController().getShiftRange() * PARALLAX_COEFFICIENT}; + public ScaleAndTranslation getWorkspaceScaleAndTranslation(Launcher launcher) { + return new ScaleAndTranslation(1f, 0, + -launcher.getAllAppsController().getShiftRange() * PARALLAX_COEFFICIENT); } @Override From 83fb1b0ed8e82d98d960843ab21e65b09b5d21b9 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Wed, 27 Mar 2019 14:09:56 -0700 Subject: [PATCH 16/19] Temp remove fade animation. Bug: 129421279 Change-Id: I7c1a9906ea9dbf888c0f156cc21d10109d92e85d --- src/com/android/launcher3/views/FloatingIconView.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java index a4f89a7180..d1e2c88d38 100644 --- a/src/com/android/launcher3/views/FloatingIconView.java +++ b/src/com/android/launcher3/views/FloatingIconView.java @@ -434,6 +434,8 @@ public class FloatingIconView extends View implements Animator.AnimatorListener, fade.play(ObjectAnimator.ofFloat(originalView, ALPHA, 0f, 1f)); } fade.start(); + // TODO: Do not run fade animation until we fix b/129421279. + fade.end(); }; } return view; From cbf82cc06275d582d9c2dbe636d12d00cceb9bb3 Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Wed, 27 Mar 2019 14:48:14 -0700 Subject: [PATCH 17/19] Reconcile difference between master and ub-launcher3-master b/129423457 Change-Id: I63e2a1a6b40ced849e852f1b7bffa4e9fa177f18 --- Android.mk | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Android.mk b/Android.mk index b3b1c825fc..06ee66fdd2 100644 --- a/Android.mk +++ b/Android.mk @@ -33,10 +33,7 @@ LOCAL_USE_AAPT2 := true LOCAL_AAPT2_ONLY := true LOCAL_MODULE_TAGS := optional -ifneq (,$(wildcard frameworks/base)) -else - LOCAL_STATIC_JAVA_LIBRARIES:= libPluginCore -endif +LOCAL_STATIC_JAVA_LIBRARIES:= libPluginCore LOCAL_SRC_FILES := \ $(call all-java-files-under, src_plugins) From 2ed8936da143de7f99d9bbf212df37ee3361c1ca Mon Sep 17 00:00:00 2001 From: Tony Date: Wed, 27 Mar 2019 17:03:00 -0500 Subject: [PATCH 18/19] Fix translationX that should be translationY Change-Id: Ie1dc8b327a312d206050926ea9f5572113727c57 --- .../android/launcher3/WorkspaceStateTransitionAnimation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java index d0f1920e73..bed61a1884 100644 --- a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java +++ b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java @@ -121,7 +121,7 @@ public class WorkspaceStateTransitionAnimation { scaleAndTranslation.translationY, translationInterpolator); propertySetter.setFloat(hotseat, View.TRANSLATION_Y, - hotseatScaleAndTranslation.translationX, translationInterpolator); + hotseatScaleAndTranslation.translationY, translationInterpolator); propertySetter.setFloat(mWorkspace.getPageIndicator(), View.TRANSLATION_Y, hotseatScaleAndTranslation.translationY, translationInterpolator); From f78f47ddeff057cb5256bbbcd05fb976f7abecbd Mon Sep 17 00:00:00 2001 From: vadimt Date: Wed, 27 Mar 2019 15:36:58 -0700 Subject: [PATCH 19/19] TAPL: Not starting all apps scroll gestures over nav bar This is important for zero-button navigation. Change-Id: Ib281762dbb995e6c89ae55b808343ddb9f4963ae --- tests/tapl/com/android/launcher3/tapl/AllApps.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/tapl/com/android/launcher3/tapl/AllApps.java b/tests/tapl/com/android/launcher3/tapl/AllApps.java index b78500788b..e4dced5232 100644 --- a/tests/tapl/com/android/launcher3/tapl/AllApps.java +++ b/tests/tapl/com/android/launcher3/tapl/AllApps.java @@ -63,6 +63,8 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer { try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer( "want to get app icon on all apps")) { final UiObject2 allAppsContainer = verifyActiveContainer(); + final UiObject2 navBar = mLauncher.waitForSystemUiObject("navigation_bar_frame"); + allAppsContainer.setGestureMargins(0, 0, 0, navBar.getVisibleBounds().height()); final BySelector appIconSelector = AppIcon.getAppIconSelector(appName, mLauncher); if (!hasClickableIcon(allAppsContainer, appIconSelector)) { scrollBackToBeginning();