Merge "Revert "Add testSplitFromOverview test (for phones)"" into tm-qpr-dev
diff --git a/Android.bp b/Android.bp
index 4adbf53..330c32e 100644
--- a/Android.bp
+++ b/Android.bp
@@ -35,9 +35,7 @@
],
srcs: [
"tests/tapl/**/*.java",
- "src/com/android/launcher3/ResourceUtils.java",
- "src/com/android/launcher3/testing/TestProtocol.java",
- "src/com/android/launcher3/testing/*Request.java",
+ "src/com/android/launcher3/testing/shared/**/*.java",
],
resource_dirs: [ ],
manifest: "tests/tapl/AndroidManifest.xml",
diff --git a/ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java b/ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java
index d16e12c..a91ff44 100644
--- a/ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java
+++ b/ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java
@@ -33,6 +33,7 @@
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.ShortcutAndWidgetContainer;
+import com.android.launcher3.testing.shared.TestProtocol;
import java.util.ArrayList;
import java.util.Collection;
diff --git a/quickstep/ext_tests/src/com/android/quickstep/DebugQuickstepTestInformationHandler.java b/quickstep/ext_tests/src/com/android/quickstep/DebugQuickstepTestInformationHandler.java
index e5f0295..84b907f 100644
--- a/quickstep/ext_tests/src/com/android/quickstep/DebugQuickstepTestInformationHandler.java
+++ b/quickstep/ext_tests/src/com/android/quickstep/DebugQuickstepTestInformationHandler.java
@@ -28,7 +28,7 @@
import com.android.launcher3.R;
import com.android.launcher3.taskbar.LauncherTaskbarUIController;
import com.android.launcher3.testing.DebugTestInformationHandler;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import java.util.concurrent.ExecutionException;
diff --git a/quickstep/res/layout/activity_allset.xml b/quickstep/res/layout/activity_allset.xml
index 0cae733..56e1d16 100644
--- a/quickstep/res/layout/activity_allset.xml
+++ b/quickstep/res/layout/activity_allset.xml
@@ -26,7 +26,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/content_view"
- android:fitsSystemWindows="true">
+ android:fitsSystemWindows="false">
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/animated_background"
diff --git a/quickstep/res/layout/taskbar.xml b/quickstep/res/layout/taskbar.xml
index 3b1d217..94388b4 100644
--- a/quickstep/res/layout/taskbar.xml
+++ b/quickstep/res/layout/taskbar.xml
@@ -45,8 +45,8 @@
android:id="@+id/start_contextual_buttons"
android:layout_width="wrap_content"
android:layout_height="match_parent"
- android:paddingLeft="@dimen/taskbar_nav_buttons_spacing"
- android:paddingRight="@dimen/taskbar_nav_buttons_spacing"
+ android:paddingStart="@dimen/taskbar_contextual_button_padding"
+ android:paddingEnd="@dimen/taskbar_contextual_button_padding"
android:paddingTop="@dimen/taskbar_contextual_padding_top"
android:gravity="center_vertical"
android:layout_gravity="start"/>
@@ -56,9 +56,6 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
- android:paddingLeft="@dimen/taskbar_nav_buttons_spacing"
- android:paddingRight="@dimen/taskbar_nav_buttons_spacing"
- android:layout_marginEnd="@dimen/taskbar_contextual_button_margin"
android:gravity="center_vertical"
android:layout_gravity="end"/>
@@ -66,8 +63,6 @@
android:id="@+id/end_contextual_buttons"
android:layout_width="wrap_content"
android:layout_height="match_parent"
- android:paddingLeft="@dimen/taskbar_nav_buttons_spacing"
- android:paddingRight="@dimen/taskbar_nav_buttons_spacing"
android:paddingTop="@dimen/taskbar_contextual_padding_top"
android:gravity="center_vertical"
android:layout_gravity="end"/>
diff --git a/quickstep/res/values-land/dimens.xml b/quickstep/res/values-land/dimens.xml
index 732f511..8368069 100644
--- a/quickstep/res/values-land/dimens.xml
+++ b/quickstep/res/values-land/dimens.xml
@@ -74,4 +74,10 @@
<!-- Gesture Tutorial mock taskbar -->
<dimen name="gesture_tutorial_taskbar_padding_start_end">218dp</dimen>
+
+ <!-- Taskbar 3 button spacing -->
+ <dimen name="taskbar_button_margin_5_5">94.5dp</dimen>
+ <dimen name="taskbar_button_margin_6_5">94.5dp</dimen>
+ <dimen name="taskbar_button_margin_4_5">84dp</dimen>
+ <dimen name="taskbar_button_margin_4_4">79dp</dimen>
</resources>
\ No newline at end of file
diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml
index fa4eaed..0232f86 100644
--- a/quickstep/res/values/dimens.xml
+++ b/quickstep/res/values/dimens.xml
@@ -250,11 +250,11 @@
<dimen name="taskbar_icon_touch_size">48dp</dimen>
<dimen name="taskbar_icon_drag_icon_size">54dp</dimen>
<dimen name="taskbar_folder_margin">16dp</dimen>
- <dimen name="taskbar_nav_buttons_spacing">16dp</dimen>
+ <dimen name="taskbar_contextual_button_padding">16dp</dimen>
<dimen name="taskbar_contextual_padding_top">8dp</dimen>
<dimen name="taskbar_nav_buttons_size">44dp</dimen>
- <dimen name="taskbar_contextual_button_margin">40dp</dimen>
- <dimen name="taskbar_hotseat_nav_spacing">42dp</dimen>
+ <dimen name="taskbar_contextual_button_margin">47dp</dimen>
+ <dimen name="taskbar_hotseat_nav_spacing">24dp</dimen>
<dimen name="taskbar_contextual_buttons_size">35dp</dimen>
<dimen name="taskbar_stashed_size">24dp</dimen>
<dimen name="taskbar_stashed_handle_width">220dp</dimen>
@@ -268,4 +268,12 @@
<dimen name="taskbar_back_button_left_margin_kids">48dp</dimen>
<dimen name="taskbar_home_button_left_margin_kids">48dp</dimen>
<dimen name="taskbar_icon_size_kids">32dp</dimen>
+
+ <!-- Taskbar 3 button spacing -->
+ <dimen name="taskbar_button_space_inbetween">24dp</dimen>
+ <dimen name="taskbar_button_margin_5_5">26dp</dimen>
+ <dimen name="taskbar_button_margin_6_5">26dp</dimen>
+ <dimen name="taskbar_button_margin_4_5">47dp</dimen>
+ <dimen name="taskbar_button_margin_4_4">47dp</dimen>
+ <dimen name="taskbar_button_margin_default">47dp</dimen>
</resources>
diff --git a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
index ec497ef..e21dcba 100644
--- a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
+++ b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
@@ -337,7 +337,7 @@
new SplitSelectStateController(this, mHandler, getStateManager(),
getDepthController());
overviewPanel.init(mActionsView, controller);
- mActionsView.updateDimension(getDeviceProfile());
+ mActionsView.updateDimension(getDeviceProfile(), overviewPanel.getLastComputedTaskSize());
mActionsView.updateVerticalMargin(DisplayController.getNavigationMode(this));
mAppTransitionManager = new QuickstepTransitionManager(this);
diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
index bb79c1b..3e13a44 100644
--- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
+++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
@@ -43,7 +43,7 @@
import static com.android.launcher3.config.FeatureFlags.SEPARATE_RECENTS_ACTIVITY;
import static com.android.launcher3.model.data.ItemInfo.NO_MATCHING_ID;
import static com.android.launcher3.statehandlers.DepthController.DEPTH;
-import static com.android.launcher3.testing.TestProtocol.BAD_STATE;
+import static com.android.launcher3.testing.shared.TestProtocol.BAD_STATE;
import static com.android.launcher3.util.window.RefreshRateTracker.getSingleFrameMs;
import static com.android.launcher3.views.FloatingIconView.SHAPE_PROGRESS_DURATION;
import static com.android.launcher3.views.FloatingIconView.getFloatingIconView;
@@ -100,6 +100,7 @@
import com.android.launcher3.shortcuts.DeepShortcutView;
import com.android.launcher3.statehandlers.DepthController;
import com.android.launcher3.taskbar.LauncherTaskbarUIController;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.touch.PagedOrientationHandler;
import com.android.launcher3.util.ActivityOptionsWrapper;
import com.android.launcher3.util.DynamicResource;
diff --git a/quickstep/src/com/android/launcher3/taskbar/DesktopTaskbarRecentAppsController.java b/quickstep/src/com/android/launcher3/taskbar/DesktopTaskbarRecentAppsController.java
new file mode 100644
index 0000000..acfbea3
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/taskbar/DesktopTaskbarRecentAppsController.java
@@ -0,0 +1,153 @@
+/*
+ * Copyright (C) 2022 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.taskbar;
+
+import android.app.ActivityManager;
+import android.content.ComponentName;
+import android.util.SparseArray;
+
+import com.android.launcher3.model.data.AppInfo;
+import com.android.launcher3.model.data.ItemInfo;
+import com.android.launcher3.model.data.WorkspaceItemInfo;
+import com.android.quickstep.RecentsModel;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Provides recent apps functionality specifically in a desktop environment.
+ */
+public class DesktopTaskbarRecentAppsController extends TaskbarRecentAppsController {
+
+ private final TaskbarActivityContext mContext;
+ private ArrayList<ItemInfo> mRunningApps = new ArrayList<>();
+ private AppInfo[] mApps;
+
+ public DesktopTaskbarRecentAppsController(TaskbarActivityContext context) {
+ mContext = context;
+ }
+
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ mApps = null;
+ }
+
+ @Override
+ protected void setApps(AppInfo[] apps) {
+ mApps = apps;
+ }
+
+ @Override
+ protected boolean isEnabled() {
+ return true;
+ }
+
+ /**
+ * Set mRunningApps to hold currently running applications using the list of currently running
+ * tasks. Filtering is also done to ignore applications that are already on the taskbar in the
+ * original hotseat.
+ */
+ @Override
+ protected void updateRunningApps(SparseArray<ItemInfo> hotseatItems) {
+ ArrayList<AppInfo> runningApps = getRunningAppsFromTasks();
+ ArrayList<ItemInfo> filteredRunningApps = new ArrayList<>();
+ for (AppInfo runningApp : runningApps) {
+ boolean shouldAddOnTaskbar = true;
+ for (int i = 0; i < hotseatItems.size(); i++) {
+ if (hotseatItems.keyAt(i) >= mControllers.taskbarActivityContext.getDeviceProfile()
+ .numShownHotseatIcons) {
+ break;
+ }
+ if (hotseatItems.valueAt(i).getTargetPackage()
+ .equals(runningApp.getTargetPackage())) {
+ shouldAddOnTaskbar = false;
+ break;
+ }
+ }
+ if (shouldAddOnTaskbar) {
+ filteredRunningApps.add(new WorkspaceItemInfo(runningApp));
+ }
+ }
+ mRunningApps = filteredRunningApps;
+ mControllers.taskbarViewController.commitRunningAppsToUI();
+ }
+
+ /**
+ * Returns a copy of hotseatItems with the addition of currently running applications.
+ */
+ @Override
+ protected ItemInfo[] updateHotseatItemInfos(ItemInfo[] hotseatItemInfos) {
+ // hotseatItemInfos.length would be 0 if deviceProfile.numShownHotseatIcons is 0, so we
+ // don't want to show anything in the hotseat
+ if (hotseatItemInfos.length == 0) return hotseatItemInfos;
+
+ int runningAppsIndex = 0;
+ ItemInfo[] newHotseatItemsInfo = Arrays.copyOf(
+ hotseatItemInfos, hotseatItemInfos.length + mRunningApps.size());
+ for (int i = hotseatItemInfos.length; i < newHotseatItemsInfo.length; i++) {
+ newHotseatItemsInfo[i] = mRunningApps.get(runningAppsIndex);
+ runningAppsIndex++;
+ }
+ return newHotseatItemsInfo;
+ }
+
+
+ /**
+ * Returns a list of running applications from the list of currently running tasks.
+ */
+ private ArrayList<AppInfo> getRunningAppsFromTasks() {
+ ArrayList<ActivityManager.RunningTaskInfo> tasks =
+ RecentsModel.INSTANCE.get(mContext).getRunningTasks();
+ ArrayList<AppInfo> runningApps = new ArrayList<>();
+ // early return if apps is empty, since we would have no AppInfo to compare
+ if (mApps == null) {
+ return runningApps;
+ }
+
+ Set<String> seenPackages = new HashSet<>();
+ for (ActivityManager.RunningTaskInfo taskInfo : tasks) {
+ if (taskInfo.realActivity == null) continue;
+
+ // If a different task for the same package has already been handled, skip this one
+ String taskPackage = taskInfo.realActivity.getPackageName();
+ if (seenPackages.contains(taskPackage)) continue;
+
+ // Otherwise, get the corresponding AppInfo and add it to the list
+ seenPackages.add(taskPackage);
+ AppInfo app = getAppInfo(taskInfo.realActivity);
+ if (app == null) continue;
+ runningApps.add(app);
+ }
+ return runningApps;
+ }
+
+ /**
+ * Retrieves the corresponding AppInfo for the activity.
+ */
+ private AppInfo getAppInfo(ComponentName activity) {
+ String packageName = activity.getPackageName();
+ for (AppInfo app : mApps) {
+ if (!packageName.equals(app.getTargetPackage())) {
+ continue;
+ }
+ return app;
+ }
+ return null;
+ }
+}
diff --git a/quickstep/src/com/android/launcher3/taskbar/DesktopTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/DesktopTaskbarUIController.java
index e2359c0..3c76e8e 100644
--- a/quickstep/src/com/android/launcher3/taskbar/DesktopTaskbarUIController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/DesktopTaskbarUIController.java
@@ -32,11 +32,14 @@
@Override
protected void init(TaskbarControllers taskbarControllers) {
+ super.init(taskbarControllers);
mLauncher.getHotseat().setIconsAlpha(0f);
+ mControllers.taskbarViewController.updateRunningApps();
}
@Override
protected void onDestroy() {
+ super.onDestroy();
mLauncher.getHotseat().setIconsAlpha(1f);
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
index 6df31e5..62a11d4 100644
--- a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
@@ -354,6 +354,13 @@
}
@Override
+ public void onExpandPip() {
+ super.onExpandPip();
+ mTaskbarLauncherStateController.updateStateForFlag(FLAG_RESUMED, false);
+ mTaskbarLauncherStateController.applyState();
+ }
+
+ @Override
public void dumpLogs(String prefix, PrintWriter pw) {
super.dumpLogs(prefix, pw);
diff --git a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
index 17da0d9..b01168d 100644
--- a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
@@ -46,6 +46,7 @@
import android.content.pm.ActivityInfo.Config;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
+import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.Region;
@@ -67,6 +68,7 @@
import android.widget.ImageView;
import android.widget.LinearLayout;
+import com.android.launcher3.DeviceProfile;
import com.android.launcher3.LauncherAnimUtils;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
@@ -94,7 +96,7 @@
private final Rect mTempRect = new Rect();
- private static final int FLAG_SWITCHER_SUPPORTED = 1 << 0;
+ private static final int FLAG_SWITCHER_SHOWING = 1 << 0;
private static final int FLAG_IME_VISIBLE = 1 << 1;
private static final int FLAG_ROTATION_BUTTON_VISIBLE = 1 << 2;
private static final int FLAG_A11Y_VISIBLE = 1 << 3;
@@ -189,7 +191,7 @@
isThreeButtonNav ? mStartContextualContainer : mEndContextualContainer,
mControllers.navButtonController, R.id.ime_switcher);
mPropertyHolders.add(new StatePropertyHolder(imeSwitcherButton,
- flags -> ((flags & FLAG_SWITCHER_SUPPORTED) != 0)
+ flags -> ((flags & FLAG_SWITCHER_SHOWING) != 0)
&& ((flags & FLAG_ROTATION_BUTTON_VISIBLE) == 0)));
}
@@ -228,6 +230,7 @@
if (alwaysShowButtons) {
initButtons(mNavButtonContainer, mEndContextualContainer,
mControllers.navButtonController);
+ updateButtonLayoutSpacing();
if (isInSetup) {
// Since setup wizard only has back button enabled, it looks strange to be
@@ -451,7 +454,7 @@
// TODO(b/202218289) we're getting IME as not visible on lockscreen from system
updateStateForFlag(FLAG_IME_VISIBLE, isImeVisible);
- updateStateForFlag(FLAG_SWITCHER_SUPPORTED, isImeSwitcherShowing);
+ updateStateForFlag(FLAG_SWITCHER_SHOWING, isImeSwitcherShowing);
updateStateForFlag(FLAG_A11Y_VISIBLE, a11yVisible);
updateStateForFlag(FLAG_DISABLE_HOME, isHomeDisabled);
updateStateForFlag(FLAG_DISABLE_RECENTS, isRecentsDisabled);
@@ -465,6 +468,7 @@
boolean a11yLongClickable =
(sysUiStateFlags & SYSUI_STATE_A11Y_BUTTON_LONG_CLICKABLE) != 0;
mA11yButton.setLongClickable(a11yLongClickable);
+ updateButtonLayoutSpacing();
}
}
@@ -480,6 +484,13 @@
}
/**
+ * @return {@code true} if A11y is showing in 3 button nav taskbar
+ */
+ private boolean isContextualButtonShowing() {
+ return mContext.isThreeButtonNav() && (mState & FLAG_A11Y_VISIBLE) != 0;
+ }
+
+ /**
* Should be called when we need to show back button for bouncer
*/
public void setBackForBouncer(boolean isBouncerVisible) {
@@ -508,7 +519,7 @@
* Returns true if IME switcher is visible
*/
public boolean isImeSwitcherVisible() {
- return (mState & FLAG_SWITCHER_SUPPORTED) != 0;
+ return (mState & FLAG_SWITCHER_SHOWING) != 0;
}
/**
@@ -662,6 +673,46 @@
if (mFloatingRotationButton != null) {
mFloatingRotationButton.onConfigurationChanged(configChanges);
}
+ updateButtonLayoutSpacing();
+ }
+
+ /** Adds the correct spacing to 3 button nav container. No-op if using gesture nav */
+ private void updateButtonLayoutSpacing() {
+ if (!mContext.isThreeButtonNav()) {
+ return;
+ }
+ DeviceProfile dp = mContext.getDeviceProfile();
+ Resources res = mContext.getResources();
+
+ // Add spacing after the end of the last nav button
+ FrameLayout.LayoutParams navButtonParams =
+ (FrameLayout.LayoutParams) mNavButtonContainer.getLayoutParams();
+ int navMarginEnd = (int) res.getDimension(dp.inv.inlineNavButtonsEndSpacing);
+ int contextualWidth = mEndContextualContainer.getWidth();
+ // If contextual buttons are showing, we check if the end margin is enough for the
+ // contextual button to be showing - if not, move the nav buttons over a smidge
+ if (isContextualButtonShowing() && navMarginEnd < contextualWidth) {
+ // Additional spacing, eat up half of space between last icon and nav button
+ navMarginEnd += res.getDimensionPixelSize(R.dimen.taskbar_hotseat_nav_spacing) / 2;
+ }
+ navButtonParams.setMarginEnd(navMarginEnd);
+ mNavButtonContainer.setLayoutParams(navButtonParams);
+
+ // Add the spaces in between the nav buttons
+ int spaceInBetween = res.getDimensionPixelSize(R.dimen.taskbar_button_space_inbetween);
+ for (int i = 0; i < mNavButtonContainer.getChildCount(); i++) {
+ View navButton = mNavButtonContainer.getChildAt(i);
+ LinearLayout.LayoutParams buttonLayoutParams =
+ (LinearLayout.LayoutParams) navButton.getLayoutParams();
+ if (i == 0) {
+ buttonLayoutParams.setMarginEnd(spaceInBetween / 2);
+ } else if (i == mNavButtonContainer.getChildCount() - 1) {
+ buttonLayoutParams.setMarginStart(spaceInBetween / 2);
+ } else {
+ buttonLayoutParams.setMarginStart(spaceInBetween / 2);
+ buttonLayoutParams.setMarginEnd(spaceInBetween / 2);
+ }
+ }
}
public void onDestroy() {
@@ -734,22 +785,17 @@
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "NavbarButtonsViewController:");
- pw.println(String.format("%s\tmState=%s", prefix, getStateString(mState)));
- pw.println(String.format(
- "%s\tmLightIconColor=0x%s", prefix, Integer.toHexString(mLightIconColor)));
- pw.println(String.format(
- "%s\tmDarkIconColor=0x%s", prefix, Integer.toHexString(mDarkIconColor)));
- pw.println(String.format(
- "%s\tmFloatingRotationButtonBounds=%s", prefix, mFloatingRotationButtonBounds));
- pw.println(String.format(
- "%s\tmSysuiStateFlags=%s",
- prefix,
- QuickStepContract.getSystemUiStateString(mSysuiStateFlags)));
+ pw.println(prefix + "\tmState=" + getStateString(mState));
+ pw.println(prefix + "\tmLightIconColor=" + Integer.toHexString(mLightIconColor));
+ pw.println(prefix + "\tmDarkIconColor=" + Integer.toHexString(mDarkIconColor));
+ pw.println(prefix + "\tmFloatingRotationButtonBounds=" + mFloatingRotationButtonBounds);
+ pw.println(prefix + "\tmSysuiStateFlags=" + QuickStepContract.getSystemUiStateString(
+ mSysuiStateFlags));
}
private static String getStateString(int flags) {
StringJoiner str = new StringJoiner("|");
- appendFlag(str, flags, FLAG_SWITCHER_SUPPORTED, "FLAG_SWITCHER_SUPPORTED");
+ appendFlag(str, flags, FLAG_SWITCHER_SHOWING, "FLAG_SWITCHER_SHOWING");
appendFlag(str, flags, FLAG_IME_VISIBLE, "FLAG_IME_VISIBLE");
appendFlag(str, flags, FLAG_ROTATION_BUTTON_VISIBLE, "FLAG_ROTATION_BUTTON_VISIBLE");
appendFlag(str, flags, FLAG_A11Y_VISIBLE, "FLAG_A11Y_VISIBLE");
diff --git a/quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java b/quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java
index f472427..800e162 100644
--- a/quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java
@@ -209,10 +209,9 @@
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "StashedHandleViewController:");
- pw.println(String.format(
- "%s\tisStashedHandleVisible=%b", prefix, isStashedHandleVisible()));
- pw.println(String.format("%s\tmStashedHandleWidth=%dpx", prefix, mStashedHandleWidth));
- pw.println(String.format("%s\tmStashedHandleHeight=%dpx", prefix, mStashedHandleHeight));
+ pw.println(prefix + "\tisStashedHandleVisible=" + isStashedHandleVisible());
+ pw.println(prefix + "\tmStashedHandleWidth=" + mStashedHandleWidth);
+ pw.println(prefix + "\tmStashedHandleHeight=" + mStashedHandleHeight);
mRegionSamplingHelper.dump(prefix, pw);
}
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
index 6b12e9c..3145ec3 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
@@ -23,7 +23,7 @@
import static com.android.launcher3.AbstractFloatingView.TYPE_ALL;
import static com.android.launcher3.AbstractFloatingView.TYPE_REBIND_SAFE;
-import static com.android.launcher3.ResourceUtils.getBoolByName;
+import static com.android.launcher3.testing.shared.ResourceUtils.getBoolByName;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_OPEN;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED;
@@ -76,7 +76,7 @@
import com.android.launcher3.popup.PopupDataProvider;
import com.android.launcher3.taskbar.allapps.TaskbarAllAppsController;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.touch.ItemClickHandler;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.DisplayController.NavigationMode;
@@ -173,13 +173,15 @@
mAccessibilityDelegate = new TaskbarShortcutMenuAccessibilityDelegate(this);
+ final boolean isDesktopMode = getPackageManager().hasSystemFeature(FEATURE_PC);
+
// Construct controllers.
mControllers = new TaskbarControllers(this,
new TaskbarDragController(this),
buttonController,
- getPackageManager().hasSystemFeature(FEATURE_PC)
- ? new DesktopNavbarButtonsViewController(this, navButtonsView) :
- new NavbarButtonsViewController(this, navButtonsView),
+ isDesktopMode
+ ? new DesktopNavbarButtonsViewController(this, navButtonsView)
+ : new NavbarButtonsViewController(this, navButtonsView),
new RotationButtonController(this,
c.getColor(R.color.taskbar_nav_icon_light_color),
c.getColor(R.color.taskbar_nav_icon_dark_color),
@@ -202,7 +204,10 @@
new TaskbarForceVisibleImmersiveController(this),
new TaskbarAllAppsController(this, dp),
new TaskbarInsetsController(this),
- new VoiceInteractionWindowController(this));
+ new VoiceInteractionWindowController(this),
+ isDesktopMode
+ ? new DesktopTaskbarRecentAppsController(this)
+ : TaskbarRecentAppsController.DEFAULT);
}
public void init(@NonNull TaskbarSharedState sharedState) {
@@ -622,7 +627,9 @@
/** Adds the given view to WindowManager with the provided LayoutParams (creates new window). */
public void addWindowView(View view, WindowManager.LayoutParams windowLayoutParams) {
- mWindowManager.addView(view, windowLayoutParams);
+ if (!view.isAttachedToWindow()) {
+ mWindowManager.addView(view, windowLayoutParams);
+ }
}
/** Removes the given view from WindowManager. See {@link #addWindowView}. */
@@ -839,6 +846,6 @@
pw.println(String.format(
"%s\tmBindInProgress=%b", prefix, mBindingItems));
mControllers.dumpLogs(prefix + "\t", pw);
- mDeviceProfile.dump(this, prefix, pw);
+ mDeviceProfile.dump(prefix, pw);
}
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarAutohideSuspendController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarAutohideSuspendController.java
index c5615c7..3cf9c99 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarAutohideSuspendController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarAutohideSuspendController.java
@@ -71,8 +71,7 @@
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "TaskbarAutohideSuspendController:");
- pw.println(String.format(
- "%s\tmAutohideSuspendFlags=%s", prefix, getStateString(mAutohideSuspendFlags)));
+ pw.println(prefix + "\tmAutohideSuspendFlags=" + getStateString(mAutohideSuspendFlags));
}
private static String getStateString(int flags) {
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java
index d7b50b0..2b80b75 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java
@@ -53,6 +53,7 @@
public final TaskbarAllAppsController taskbarAllAppsController;
public final TaskbarInsetsController taskbarInsetsController;
public final VoiceInteractionWindowController voiceInteractionWindowController;
+ public final TaskbarRecentAppsController taskbarRecentAppsController;
@Nullable private LoggableTaskbarController[] mControllersToLog = null;
@@ -82,7 +83,8 @@
TaskbarForceVisibleImmersiveController taskbarForceVisibleImmersiveController,
TaskbarAllAppsController taskbarAllAppsController,
TaskbarInsetsController taskbarInsetsController,
- VoiceInteractionWindowController voiceInteractionWindowController) {
+ VoiceInteractionWindowController voiceInteractionWindowController,
+ TaskbarRecentAppsController taskbarRecentAppsController) {
this.taskbarActivityContext = taskbarActivityContext;
this.taskbarDragController = taskbarDragController;
this.navButtonController = navButtonController;
@@ -102,6 +104,7 @@
this.taskbarAllAppsController = taskbarAllAppsController;
this.taskbarInsetsController = taskbarInsetsController;
this.voiceInteractionWindowController = voiceInteractionWindowController;
+ this.taskbarRecentAppsController = taskbarRecentAppsController;
}
/**
@@ -130,6 +133,7 @@
navButtonController.init(this);
taskbarInsetsController.init(this);
voiceInteractionWindowController.init(this);
+ taskbarRecentAppsController.init(this);
mControllersToLog = new LoggableTaskbarController[] {
taskbarDragController, navButtonController, navbarButtonsViewController,
@@ -178,6 +182,7 @@
navButtonController.onDestroy();
taskbarInsetsController.onDestroy();
voiceInteractionWindowController.onDestroy();
+ taskbarRecentAppsController.onDestroy();
mControllersToLog = null;
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java
index 04fcc44..97029fe 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java
@@ -66,7 +66,7 @@
import com.android.launcher3.shortcuts.DeepShortcutView;
import com.android.launcher3.shortcuts.ShortcutDragPreviewProvider;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.IntSet;
import com.android.launcher3.util.ItemInfoMatcher;
import com.android.systemui.shared.recents.model.Task;
@@ -559,13 +559,11 @@
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "TaskbarDragController:");
- pw.println(String.format("%s\tmDragIconSize=%dpx", prefix, mDragIconSize));
- pw.println(String.format("%s\tmTempXY=%s", prefix, Arrays.toString(mTempXY)));
- pw.println(String.format("%s\tmRegistrationX=%d", prefix, mRegistrationX));
- pw.println(String.format("%s\tmRegistrationY=%d", prefix, mRegistrationY));
- pw.println(String.format(
- "%s\tmIsSystemDragInProgress=%b", prefix, mIsSystemDragInProgress));
- pw.println(String.format(
- "%s\tisInternalDragInProgess=%b", prefix, super.isDragging()));
+ pw.println(prefix + "\tmDragIconSize=" + mDragIconSize);
+ pw.println(prefix + "\tmTempXY=" + Arrays.toString(mTempXY));
+ pw.println(prefix + "\tmRegistrationX=" + mRegistrationX);
+ pw.println(prefix + "\tmRegistrationY=" + mRegistrationY);
+ pw.println(prefix + "\tmIsSystemDragInProgress=" + mIsSystemDragInProgress);
+ pw.println(prefix + "\tisInternalDragInProgess=" + super.isDragging());
}
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java
index c1a6185..1c8148b 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java
@@ -30,7 +30,7 @@
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.views.BaseDragLayer;
import com.android.systemui.shared.system.ViewTreeObserverWrapper;
import com.android.systemui.shared.system.ViewTreeObserverWrapper.InsetsInfo;
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java
index 99c59a8..77ef83c 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java
@@ -144,10 +144,9 @@
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "TaskbarDragLayerController:");
- pw.println(String.format("%s\tmBgOffset=%.2f", prefix, mBgOffset.value));
- pw.println(String.format("%s\tmFolderMargin=%dpx", prefix, mFolderMargin));
- pw.println(String.format(
- "%s\tmLastSetBackgroundAlpha=%.2f", prefix, mLastSetBackgroundAlpha));
+ pw.println(prefix + "\tmBgOffset=" + mBgOffset.value);
+ pw.println(prefix + "\tmFolderMargin=" + mFolderMargin);
+ pw.println(prefix + "\tmLastSetBackgroundAlpha=" + mLastSetBackgroundAlpha);
}
/**
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarEduController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarEduController.java
index e29b14b..32a3c10 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarEduController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarEduController.java
@@ -191,12 +191,10 @@
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "TaskbarEduController:");
- pw.println(String.format("%s\tisShowingEdu=%b", prefix, mTaskbarEduView != null));
- pw.println(String.format("%s\tmWaveAnimTranslationY=%.2f", prefix, mWaveAnimTranslationY));
- pw.println(String.format(
- "%s\tmWaveAnimTranslationYReturnOvershoot=%.2f",
- prefix,
- mWaveAnimTranslationYReturnOvershoot));
+ pw.println(prefix + "\tisShowingEdu=" + (mTaskbarEduView != null));
+ pw.println(prefix + "\tmWaveAnimTranslationY=" + mWaveAnimTranslationY);
+ pw.println(prefix + "\tmWaveAnimTranslationYReturnOvershoot="
+ + mWaveAnimTranslationYReturnOvershoot);
}
/**
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarKeyguardController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarKeyguardController.java
index 56648ea..0808fab 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarKeyguardController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarKeyguardController.java
@@ -111,11 +111,9 @@
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "TaskbarKeyguardController:");
- pw.println(String.format(
- "%s\tmKeyguardSysuiFlags=%s",
- prefix,
- QuickStepContract.getSystemUiStateString(mKeyguardSysuiFlags)));
- pw.println(String.format("%s\tmBouncerShowing=%b", prefix, mBouncerShowing));
- pw.println(String.format("%s\tmIsScreenOff=%b", prefix, mIsScreenOff));
+ pw.println(prefix + "\tmKeyguardSysuiFlags=" + QuickStepContract.getSystemUiStateString(
+ mKeyguardSysuiFlags));
+ pw.println(prefix + "\tmBouncerShowing=" + mBouncerShowing);
+ pw.println(prefix + "\tmIsScreenOff=" + mIsScreenOff);
}
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
index ff11f67..85e76b2 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
@@ -35,6 +35,7 @@
import com.android.launcher3.LauncherState;
import com.android.launcher3.QuickstepTransitionManager;
import com.android.launcher3.Utilities;
+import com.android.launcher3.anim.AnimatorListeners;
import com.android.launcher3.statemanager.StateManager;
import com.android.launcher3.util.MultiValueAlpha;
import com.android.quickstep.AnimatedFloat;
@@ -367,11 +368,14 @@
private void playStateTransitionAnim(AnimatorSet animatorSet, long duration,
boolean committed) {
boolean isInStashedState = mLauncherState.isTaskbarStashed(mLauncher);
- float toAlignment = mLauncherState.isTaskbarAlignedWithHotseat(mLauncher) ? 1 : 0;
+ boolean willStashVisually =
+ isInStashedState && mControllers.taskbarStashController.supportsVisualStashing();
+ float toAlignment =
+ mLauncherState.isTaskbarAlignedWithHotseat(mLauncher) && !willStashVisually ? 1 : 0;
- TaskbarStashController controller = mControllers.taskbarStashController;
- controller.updateStateForFlag(FLAG_IN_STASHED_LAUNCHER_STATE, isInStashedState);
- Animator stashAnimator = controller.applyStateWithoutStart(duration);
+ TaskbarStashController stashController = mControllers.taskbarStashController;
+ stashController.updateStateForFlag(FLAG_IN_STASHED_LAUNCHER_STATE, isInStashedState);
+ Animator stashAnimator = stashController.applyStateWithoutStart(duration);
if (stashAnimator != null) {
stashAnimator.addListener(new AnimatorListenerAdapter() {
@Override
@@ -391,9 +395,13 @@
});
animatorSet.play(stashAnimator);
}
-
- // If we're already animating to the value, just leave it be instead of restarting it.
+ if (mIconAlignmentForLauncherState.value == toAlignment) {
+ // Already at expected value, but make sure we run the callback at the end.
+ animatorSet.addListener(AnimatorListeners.forEndCallback(
+ this::onIconAlignmentRatioChangedForStateTransition));
+ }
if (!mIconAlignmentForLauncherState.isAnimatingToValue(toAlignment)) {
+ // If we're already animating to the value, just leave it be instead of restarting it.
mIconAlignmentForLauncherState.finishAnimation();
animatorSet.play(mIconAlignmentForLauncherState.animateToValue(toAlignment)
.setDuration(duration));
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarModelCallbacks.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarModelCallbacks.java
index 75881a3..5e670d294 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarModelCallbacks.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarModelCallbacks.java
@@ -29,6 +29,7 @@
import com.android.launcher3.util.IntSet;
import com.android.launcher3.util.ItemInfoMatcher;
import com.android.launcher3.util.LauncherBindableItemsContainer;
+import com.android.quickstep.RecentsModel;
import java.io.PrintWriter;
import java.util.ArrayList;
@@ -42,7 +43,7 @@
* Launcher model Callbacks for rendering taskbar.
*/
public class TaskbarModelCallbacks implements
- BgDataModel.Callbacks, LauncherBindableItemsContainer {
+ BgDataModel.Callbacks, LauncherBindableItemsContainer, RecentsModel.RunningTasksListener {
private final SparseArray<ItemInfo> mHotseatItems = new SparseArray<>();
private List<ItemInfo> mPredictedItems = Collections.emptyList();
@@ -61,6 +62,16 @@
public void init(TaskbarControllers controllers) {
mControllers = controllers;
+ if (mControllers.taskbarRecentAppsController.isEnabled()) {
+ RecentsModel.INSTANCE.get(mContext).registerRunningTasksListener(this);
+ }
+ }
+
+ /**
+ * Unregisters listeners in this class.
+ */
+ public void unregisterListeners() {
+ RecentsModel.INSTANCE.get(mContext).unregisterRunningTasksListener();
}
@Override
@@ -185,6 +196,8 @@
isHotseatEmpty = false;
}
}
+ hotseatItemInfos = mControllers.taskbarRecentAppsController
+ .updateHotseatItemInfos(hotseatItemInfos);
mContainer.updateHotseatItems(hotseatItemInfos);
final boolean finalIsHotseatEmpty = isHotseatEmpty;
@@ -196,6 +209,21 @@
}
@Override
+ public void onRunningTasksChanged() {
+ updateRunningApps();
+ }
+
+ /** Called when there's a change in running apps to update the UI. */
+ public void commitRunningAppsToUI() {
+ commitItemsToUI();
+ }
+
+ /** Call TaskbarRecentAppsController to update running apps with mHotseatItems. */
+ public void updateRunningApps() {
+ mControllers.taskbarRecentAppsController.updateRunningApps(mHotseatItems);
+ }
+
+ @Override
public void bindDeepShortcutMap(HashMap<ComponentKey, Integer> deepShortcutMapCopy) {
mControllers.taskbarPopupController.setDeepShortcutMap(deepShortcutMapCopy);
}
@@ -203,6 +231,7 @@
@Override
public void bindAllApplications(AppInfo[] apps, int flags) {
mControllers.taskbarAllAppsController.setApps(apps, flags);
+ mControllers.taskbarRecentAppsController.setApps(apps);
}
protected void dumpLogs(String prefix, PrintWriter pw) {
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java
index 3392b6b..a395548 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java
@@ -18,7 +18,6 @@
import static com.android.internal.app.AssistUtils.INVOCATION_TYPE_HOME_BUTTON_LONG_PRESS;
import static com.android.internal.app.AssistUtils.INVOCATION_TYPE_KEY;
-import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_A11Y_BUTTON_LONGPRESS;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_A11Y_BUTTON_TAP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_BACK_BUTTON_LONGPRESS;
@@ -28,6 +27,7 @@
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_TAP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_OVERVIEW_BUTTON_LONGPRESS;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_OVERVIEW_BUTTON_TAP;
+import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_SCREEN_PINNING;
import android.os.Bundle;
@@ -43,7 +43,7 @@
import com.android.launcher3.R;
import com.android.launcher3.logging.StatsLogManager;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.quickstep.OverviewCommandHelper;
import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.TaskUtils;
@@ -72,9 +72,8 @@
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "TaskbarNavButtonController:");
- pw.println(String.format(
- "%s\tmLastScreenPinLongPress=%dms", prefix, mLastScreenPinLongPress));
- pw.println(String.format("%s\tmScreenPinned=%b", prefix, mScreenPinned));
+ pw.println(prefix + "\tmLastScreenPinLongPress=" + mLastScreenPinLongPress);
+ pw.println(prefix + "\tmScreenPinned=" + mScreenPinned);
}
@Retention(RetentionPolicy.SOURCE)
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarRecentAppsController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarRecentAppsController.java
new file mode 100644
index 0000000..8445cff
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarRecentAppsController.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2022 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.taskbar;
+
+import android.util.SparseArray;
+
+import androidx.annotation.CallSuper;
+
+import com.android.launcher3.model.data.AppInfo;
+import com.android.launcher3.model.data.ItemInfo;
+
+/**
+ * Base class for providing recent apps functionality
+ */
+public class TaskbarRecentAppsController {
+
+ public static final TaskbarRecentAppsController DEFAULT = new TaskbarRecentAppsController();
+
+ // Initialized in init.
+ protected TaskbarControllers mControllers;
+
+ @CallSuper
+ protected void init(TaskbarControllers taskbarControllers) {
+ mControllers = taskbarControllers;
+ }
+
+ @CallSuper
+ protected void onDestroy() {
+ mControllers = null;
+ }
+
+ /** Stores the current {@link AppInfo} instances, no-op except in desktop environment. */
+ protected void setApps(AppInfo[] apps) { }
+
+ /**
+ * Indicates whether recent apps functionality is enabled, should return false except in
+ * desktop environment.
+ */
+ protected boolean isEnabled() {
+ return false;
+ }
+
+ /** Called to update hotseatItems, no-op except in desktop environment. */
+ protected ItemInfo[] updateHotseatItemInfos(ItemInfo[] hotseatItems) {
+ return hotseatItems;
+ }
+
+ /** Called to update the list of currently running apps, no-op except in desktop environment. */
+ protected void updateRunningApps(SparseArray<ItemInfo> hotseatItems) { }
+}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarScrimViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarScrimViewController.java
index 58ace17..c3b0f57 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarScrimViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarScrimViewController.java
@@ -98,6 +98,6 @@
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "TaskbarScrimViewController:");
- pw.println(String.format("%s\tmScrimAlpha.value=%.2f", prefix, mScrimAlpha.value));
+ pw.println(prefix + "\tmScrimAlpha.value=" + mScrimAlpha.value);
}
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
index 2b8fdd1..8533145 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
@@ -40,7 +40,7 @@
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimatorListeners;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.MultiValueAlpha.AlphaProperty;
import com.android.quickstep.AnimatedFloat;
import com.android.quickstep.SystemUiProxy;
@@ -728,16 +728,14 @@
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "TaskbarStashController:");
- pw.println(String.format("%s\tmStashedHeight=%dpx", prefix, mStashedHeight));
- pw.println(String.format("%s\tmUnstashedHeight=%dpx", prefix, mUnstashedHeight));
- pw.println(String.format("%s\tmIsStashed=%b", prefix, mIsStashed));
- pw.println(String.format(
- "%s\tappliedState=%s", prefix, getStateString(mStatePropertyHolder.mPrevFlags)));
- pw.println(String.format("%s\tmState=%s", prefix, getStateString(mState)));
- pw.println(String.format(
- "%s\tmIsSystemGestureInProgress=%b", prefix, mIsSystemGestureInProgress));
- pw.println(String.format("%s\tmIsImeShowing=%b", prefix, mIsImeShowing));
- pw.println(String.format("%s\tmIsImeSwitcherShowing=%b", prefix, mIsImeSwitcherShowing));
+ pw.println(prefix + "\tmStashedHeight=" + mStashedHeight);
+ pw.println(prefix + "\tmUnstashedHeight=" + mUnstashedHeight);
+ pw.println(prefix + "\tmIsStashed=" + mIsStashed);
+ pw.println(prefix + "\tappliedState=" + getStateString(mStatePropertyHolder.mPrevFlags));
+ pw.println(prefix + "\tmState=" + getStateString(mState));
+ pw.println(prefix + "\tmIsSystemGestureInProgress=" + mIsSystemGestureInProgress);
+ pw.println(prefix + "\tmIsImeShowing=" + mIsImeShowing);
+ pw.println(prefix + "\tmIsImeSwitcherShowing=" + mIsImeSwitcherShowing);
}
private static String getStateString(int flags) {
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
index db7dc78..077172d 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
@@ -126,6 +126,7 @@
public void onDestroy() {
LauncherAppState.getInstance(mActivity).getModel().removeCallbacks(mModelCallbacks);
+ mModelCallbacks.unregisterListeners();
}
public boolean areIconsVisible() {
@@ -373,9 +374,32 @@
@Override
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "TaskbarViewController:");
+
+ mTaskbarIconAlpha.dump(
+ prefix + "\t",
+ pw,
+ "mTaskbarIconAlpha",
+ "ALPHA_INDEX_HOME",
+ "ALPHA_INDEX_KEYGUARD",
+ "ALPHA_INDEX_STASH",
+ "ALPHA_INDEX_RECENTS_DISABLED",
+ "ALPHA_INDEX_NOTIFICATION_EXPANDED",
+ "ALPHA_INDEX_ASSISTANT_INVOKED",
+ "ALPHA_INDEX_IME_BUTTON_NAV");
+
mModelCallbacks.dumpLogs(prefix + "\t", pw);
}
+ /** Called when there's a change in running apps to update the UI. */
+ public void commitRunningAppsToUI() {
+ mModelCallbacks.commitRunningAppsToUI();
+ }
+
+ /** Call TaskbarModelCallbacks to update running apps. */
+ public void updateRunningApps() {
+ mModelCallbacks.updateRunningApps();
+ }
+
/**
* Callbacks for {@link TaskbarView} to interact with its controller.
*/
diff --git a/quickstep/src/com/android/launcher3/taskbar/VoiceInteractionWindowController.kt b/quickstep/src/com/android/launcher3/taskbar/VoiceInteractionWindowController.kt
index 946873e..81acda3 100644
--- a/quickstep/src/com/android/launcher3/taskbar/VoiceInteractionWindowController.kt
+++ b/quickstep/src/com/android/launcher3/taskbar/VoiceInteractionWindowController.kt
@@ -36,7 +36,10 @@
override fun draw(canvas: Canvas) {
super.draw(canvas)
- taskbarBackgroundRenderer.draw(canvas)
+ if (this@VoiceInteractionWindowController.context.isGestureNav
+ && controllers.taskbarStashController.isInAppAndNotStashed) {
+ taskbarBackgroundRenderer.draw(canvas)
+ }
}
}
separateWindowForTaskbarBackground.recreateControllers()
@@ -74,18 +77,20 @@
fadeStashedHandle.end()
}
- if (context.isGestureNav && controllers.taskbarStashController.isInAppAndNotStashed) {
- moveTaskbarBackgroundToLowerLayer()
- }
+ moveTaskbarBackgroundToAppropriateLayer()
}
/**
+ * Either:
* Hides the TaskbarDragLayer background and creates a new window to draw just that background.
+ * OR
+ * Removes the temporary window and show the TaskbarDragLayer background again.
*/
- private fun moveTaskbarBackgroundToLowerLayer() {
+ private fun moveTaskbarBackgroundToAppropriateLayer() {
val taskbarBackgroundOverride = controllers.taskbarDragLayerController
.overrideBackgroundAlpha
- if (isVoiceInteractionWindowVisible) {
+ val moveToLowerLayer = isVoiceInteractionWindowVisible
+ if (moveToLowerLayer) {
// First add the temporary window, then hide the overlapping taskbar background.
context.addWindowView(separateWindowForTaskbarBackground, separateWindowLayoutParams)
ViewRootSync.synchronizeNextDraw(separateWindowForTaskbarBackground, context.dragLayer
diff --git a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContext.java b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContext.java
index e2f7522..c76180e 100644
--- a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContext.java
+++ b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContext.java
@@ -43,7 +43,7 @@
import com.android.launcher3.taskbar.TaskbarDragController;
import com.android.launcher3.taskbar.TaskbarStashController;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.OnboardingPrefs;
import com.android.launcher3.util.TouchController;
import com.android.launcher3.views.BaseDragLayer;
diff --git a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java
index 7166a3e..dc1046b 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java
@@ -26,7 +26,7 @@
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TRANSLATE_X;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TRANSLATE_Y;
import static com.android.launcher3.states.StateAnimationConfig.SKIP_OVERVIEW;
-import static com.android.launcher3.testing.TestProtocol.BAD_STATE;
+import static com.android.launcher3.testing.shared.TestProtocol.BAD_STATE;
import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_HORIZONTAL_OFFSET;
import static com.android.quickstep.views.RecentsView.OVERVIEW_PROGRESS;
import static com.android.quickstep.views.RecentsView.RECENTS_GRID_PROGRESS;
diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
index 4bb4343..21f03be 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
@@ -28,10 +28,10 @@
import static com.android.launcher3.compat.AccessibilityManagerCompat.sendCustomAccessibilityEvent;
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_WIDGET_APP_START;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP;
-import static com.android.launcher3.testing.TestProtocol.HINT_STATE_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.HINT_STATE_TWO_BUTTON_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.OVERVIEW_STATE_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.QUICK_SWITCH_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.HINT_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.HINT_STATE_TWO_BUTTON_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.OVERVIEW_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.QUICK_SWITCH_STATE_ORDINAL;
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_HOME_KEY;
import android.content.Intent;
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java b/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java
index 297a61a..b733007 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java
@@ -50,7 +50,8 @@
return super.getVerticalProgress(launcher);
}
RecentsView recentsView = launcher.getOverviewPanel();
- int transitionLength = LayoutUtils.getShelfTrackingDistance(launcher.getDeviceProfile(),
+ int transitionLength = LayoutUtils.getShelfTrackingDistance(launcher,
+ launcher.getDeviceProfile(),
recentsView.getPagedOrientationHandler());
AllAppsTransitionController controller = launcher.getAllAppsController();
float scrollRange = Math.max(controller.getShiftRange(), 1);
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java
index 0f02e26..0c49e5f 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java
@@ -18,6 +18,8 @@
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_OVERVIEW;
import android.content.Context;
+import android.graphics.Point;
+import android.graphics.Rect;
import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.Launcher;
@@ -69,6 +71,13 @@
}
public static float[] getOverviewScaleAndOffsetForModalState(BaseDraggingActivity activity) {
- return new float[] {activity.getDeviceProfile().overviewModalTaskScale, NO_OFFSET};
+ Point taskSize = activity.<RecentsView>getOverviewPanel().getSelectedTaskSize();
+ Rect modalTaskSize = new Rect();
+ activity.<RecentsView>getOverviewPanel().getModalTaskSize(modalTaskSize);
+
+ float scale = Math.min((float) modalTaskSize.height() / taskSize.y,
+ (float) modalTaskSize.width() / taskSize.x);
+
+ return new float[] {scale, NO_OFFSET};
}
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
index c0810b9..c4c9038 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
@@ -22,12 +22,10 @@
import android.graphics.Rect;
import android.os.SystemProperties;
-import com.android.launcher3.BaseQuickstepLauncher;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.R;
-import com.android.launcher3.taskbar.LauncherTaskbarUIController;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.Themes;
import com.android.quickstep.util.LayoutUtils;
@@ -65,9 +63,12 @@
@Override
public ScaleAndTranslation getWorkspaceScaleAndTranslation(Launcher launcher) {
+ RecentsView recentsView = launcher.getOverviewPanel();
+ float workspacePageHeight = launcher.getDeviceProfile().getCellLayoutHeight();
+ recentsView.getTaskSize(sTempRect);
+ float scale = (float) sTempRect.height() / workspacePageHeight;
float parallaxFactor = 0.5f;
- return new ScaleAndTranslation(launcher.getDeviceProfile().overviewTaskWorkspaceScale, 0,
- -getDefaultSwipeHeight(launcher) * parallaxFactor);
+ return new ScaleAndTranslation(scale, 0, -getDefaultSwipeHeight(launcher) * parallaxFactor);
}
@Override
@@ -92,13 +93,7 @@
@Override
public boolean isTaskbarStashed(Launcher launcher) {
- if (launcher instanceof BaseQuickstepLauncher) {
- LauncherTaskbarUIController uiController =
- ((BaseQuickstepLauncher) launcher).getTaskbarUIController();
-
- return uiController != null && uiController.supportsVisualStashing();
- }
- return super.isTaskbarStashed(launcher);
+ return true;
}
@Override
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java
index d06f64a..4092a73 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java
@@ -39,7 +39,7 @@
import static com.android.launcher3.states.StateAnimationConfig.SKIP_ALL_ANIMATIONS;
import static com.android.launcher3.states.StateAnimationConfig.SKIP_OVERVIEW;
import static com.android.launcher3.states.StateAnimationConfig.SKIP_SCRIM;
-import static com.android.launcher3.testing.TestProtocol.BAD_STATE;
+import static com.android.launcher3.testing.shared.TestProtocol.BAD_STATE;
import static com.android.launcher3.touch.BothAxesSwipeDetector.DIRECTION_RIGHT;
import static com.android.launcher3.touch.BothAxesSwipeDetector.DIRECTION_UP;
import static com.android.launcher3.util.window.RefreshRateTracker.getSingleFrameMs;
@@ -120,8 +120,8 @@
mSwipeDetector = new BothAxesSwipeDetector(mLauncher, this);
mRecentsView = mLauncher.getOverviewPanel();
mXRange = mLauncher.getDeviceProfile().widthPx / 2f;
- mYRange = LayoutUtils.getShelfTrackingDistance(mLauncher.getDeviceProfile(),
- mRecentsView.getPagedOrientationHandler());
+ mYRange = LayoutUtils.getShelfTrackingDistance(
+ mLauncher, mLauncher.getDeviceProfile(), mRecentsView.getPagedOrientationHandler());
mMaxYProgress = mLauncher.getDeviceProfile().heightPx / mYRange;
mMotionPauseDetector = new MotionPauseDetector(mLauncher);
mMotionPauseMinDisplacement = mLauncher.getResources().getDimension(
@@ -232,6 +232,7 @@
mRecentsView.setFullscreenProgress(fromState.getOverviewFullscreenProgress());
mLauncher.getActionsView().getVisibilityAlpha().setValue(
(fromState.getVisibleElements(mLauncher) & OVERVIEW_ACTIONS) != 0 ? 1f : 0f);
+ mRecentsView.setTaskIconScaledDown(true);
float[] scaleAndOffset = toState.getOverviewScaleAndOffset(mLauncher);
// As we drag right, animate the following properties:
@@ -321,6 +322,7 @@
boolean verticalFling = mSwipeDetector.isFling(velocity.y);
boolean noFling = !horizontalFling && !verticalFling;
if (mMotionPauseDetector.isPaused() && noFling) {
+ // Going to Overview.
cancelAnimations();
StateAnimationConfig config = new StateAnimationConfig();
@@ -331,6 +333,8 @@
@Override
public void onAnimationEnd(Animator animation) {
onAnimationToStateCompleted(OVERVIEW);
+ // Animate the icon after onAnimationToStateCompleted() so it doesn't clobber.
+ mRecentsView.animateUpTaskIconScale();
}
});
overviewAnim.start();
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java
index 7394945..9efbc34 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java
@@ -144,8 +144,8 @@
.createPlaybackController();
mLauncher.getStateManager().setCurrentUserControlledAnimation(mCurrentAnimation);
RecentsView recentsView = mLauncher.getOverviewPanel();
- totalShift = LayoutUtils.getShelfTrackingDistance(mLauncher.getDeviceProfile(),
- recentsView.getPagedOrientationHandler());
+ totalShift = LayoutUtils.getShelfTrackingDistance(mLauncher,
+ mLauncher.getDeviceProfile(), recentsView.getPagedOrientationHandler());
} else {
mCurrentAnimation = mLauncher.getStateManager()
.createAnimationToNewWorkspace(mToState, config);
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java
index d1b0a9c..f607aa3 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java
@@ -29,7 +29,7 @@
import static com.android.launcher3.states.StateAnimationConfig.ANIM_VERTICAL_PROGRESS;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_WORKSPACE_FADE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_WORKSPACE_TRANSLATE;
-import static com.android.launcher3.testing.TestProtocol.BAD_STATE;
+import static com.android.launcher3.testing.shared.TestProtocol.BAD_STATE;
import static com.android.launcher3.util.SystemUiController.UI_STATE_FULLSCREEN_TASK;
import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_HORIZONTAL_OFFSET;
import static com.android.quickstep.views.RecentsView.RECENTS_SCALE_PROPERTY;
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TwoButtonNavbarTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TwoButtonNavbarTouchController.java
index e2747df..9f2c1d4 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TwoButtonNavbarTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TwoButtonNavbarTouchController.java
@@ -24,13 +24,11 @@
import android.animation.ValueAnimator;
import android.os.SystemClock;
-import android.util.Log;
import android.view.MotionEvent;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
-import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.touch.AbstractStateChangeTouchController;
import com.android.launcher3.touch.SingleAxisSwipeDetector;
import com.android.quickstep.SystemUiProxy;
diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
index 045530c..8f1872b 100644
--- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
+++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
@@ -2049,8 +2049,8 @@
float scrollOffset = Math.abs(mRecentsView.getScrollOffset(mRecentsView.getCurrentPage()));
int maxScrollOffset = mRecentsView.getPagedOrientationHandler().getPrimaryValue(
- mActivity.getDeviceProfile().overviewTaskRect.width(),
- mActivity.getDeviceProfile().overviewTaskRect.height());
+ mRecentsView.getLastComputedTaskSize().width(),
+ mRecentsView.getLastComputedTaskSize().height());
maxScrollOffset += mRecentsView.getPageSpacing();
float maxScaleProgress =
diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java
index a922f58..6354282 100644
--- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java
+++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java
@@ -33,9 +33,12 @@
import android.animation.ObjectAnimator;
import android.annotation.TargetApi;
import android.content.Context;
+import android.content.res.Resources;
import android.graphics.Color;
+import android.graphics.PointF;
import android.graphics.Rect;
import android.os.Build;
+import android.view.Gravity;
import android.view.MotionEvent;
import android.view.View;
@@ -43,6 +46,7 @@
import androidx.annotation.UiThread;
import com.android.launcher3.DeviceProfile;
+import com.android.launcher3.R;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.statehandlers.DepthController;
@@ -105,8 +109,8 @@
activity.getStateManager().goToState(startState, activityVisible);
}
- /** Gets swipe-up destination and length. */
- public abstract int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context,
+ public abstract int getSwipeUpDestinationAndLength(
+ DeviceProfile dp, Context context, Rect outRect,
PagedOrientationHandler orientationHandler);
/** Called when the animation to home has fully settled. */
@@ -211,6 +215,129 @@
}
/**
+ * Calculates the taskView size for the provided device configuration.
+ */
+ public final void calculateTaskSize(Context context, DeviceProfile dp, Rect outRect) {
+ Resources res = context.getResources();
+ float maxScale = res.getFloat(R.dimen.overview_max_scale);
+ if (dp.isTablet) {
+ Rect gridRect = new Rect();
+ calculateGridSize(dp, gridRect);
+
+ calculateTaskSizeInternal(context, dp, gridRect, maxScale, Gravity.CENTER, outRect);
+ } else {
+ int taskMargin = dp.overviewTaskMarginPx;
+ calculateTaskSizeInternal(context, dp,
+ dp.overviewTaskThumbnailTopMarginPx,
+ dp.getOverviewActionsClaimedSpace(),
+ res.getDimensionPixelSize(R.dimen.overview_minimum_next_prev_size) + taskMargin,
+ maxScale,
+ Gravity.CENTER,
+ outRect);
+ }
+ }
+
+ private void calculateTaskSizeInternal(Context context, DeviceProfile dp, int claimedSpaceAbove,
+ int claimedSpaceBelow, int minimumHorizontalPadding, float maxScale, int gravity,
+ Rect outRect) {
+ Rect insets = dp.getInsets();
+
+ Rect potentialTaskRect = new Rect(0, 0, dp.widthPx, dp.heightPx);
+ potentialTaskRect.inset(insets.left, insets.top, insets.right, insets.bottom);
+ potentialTaskRect.inset(
+ minimumHorizontalPadding,
+ claimedSpaceAbove,
+ minimumHorizontalPadding,
+ claimedSpaceBelow);
+
+ calculateTaskSizeInternal(context, dp, potentialTaskRect, maxScale, gravity, outRect);
+ }
+
+ private void calculateTaskSizeInternal(Context context, DeviceProfile dp,
+ Rect potentialTaskRect, float maxScale, int gravity, Rect outRect) {
+ PointF taskDimension = getTaskDimension(dp);
+
+ float scale = Math.min(
+ potentialTaskRect.width() / taskDimension.x,
+ potentialTaskRect.height() / taskDimension.y);
+ scale = Math.min(scale, maxScale);
+ int outWidth = Math.round(scale * taskDimension.x);
+ int outHeight = Math.round(scale * taskDimension.y);
+
+ Gravity.apply(gravity, outWidth, outHeight, potentialTaskRect, outRect);
+ }
+
+ private static PointF getTaskDimension(DeviceProfile dp) {
+ PointF dimension = new PointF();
+ getTaskDimension(dp, dimension);
+ return dimension;
+ }
+
+ /**
+ * Gets the dimension of the task in the current system state.
+ */
+ public static void getTaskDimension(DeviceProfile dp, PointF out) {
+ out.x = dp.widthPx;
+ out.y = dp.heightPx;
+ if (dp.isTablet) {
+ out.y -= dp.taskbarSize;
+ }
+ }
+
+ /**
+ * Calculates the overview grid size for the provided device configuration.
+ */
+ public final void calculateGridSize(DeviceProfile dp, Rect outRect) {
+ Rect insets = dp.getInsets();
+ int topMargin = dp.overviewTaskThumbnailTopMarginPx;
+ int bottomMargin = dp.getOverviewActionsClaimedSpace();
+ int sideMargin = dp.overviewGridSideMargin;
+
+ outRect.set(0, 0, dp.widthPx, dp.heightPx);
+ outRect.inset(Math.max(insets.left, sideMargin), insets.top + topMargin,
+ Math.max(insets.right, sideMargin), Math.max(insets.bottom, bottomMargin));
+ }
+
+ /**
+ * Calculates the overview grid non-focused task size for the provided device configuration.
+ */
+ public final void calculateGridTaskSize(Context context, DeviceProfile dp, Rect outRect,
+ PagedOrientationHandler orientedState) {
+ Resources res = context.getResources();
+ Rect taskRect = new Rect();
+ calculateTaskSize(context, dp, taskRect);
+
+ float rowHeight =
+ (taskRect.height() + dp.overviewTaskThumbnailTopMarginPx - dp.overviewRowSpacing)
+ / 2f;
+
+ PointF taskDimension = getTaskDimension(dp);
+ float scale = (rowHeight - dp.overviewTaskThumbnailTopMarginPx) / taskDimension.y;
+ int outWidth = Math.round(scale * taskDimension.x);
+ int outHeight = Math.round(scale * taskDimension.y);
+
+ int gravity = Gravity.TOP;
+ gravity |= orientedState.getRecentsRtlSetting(res) ? Gravity.RIGHT : Gravity.LEFT;
+ Gravity.apply(gravity, outWidth, outHeight, taskRect, outRect);
+ }
+
+ /**
+ * Calculates the modal taskView size for the provided device configuration
+ */
+ public final void calculateModalTaskSize(Context context, DeviceProfile dp, Rect outRect) {
+ calculateTaskSize(context, dp, outRect);
+ float maxScale = context.getResources().getFloat(R.dimen.overview_modal_max_scale);
+ calculateTaskSizeInternal(
+ context, dp,
+ dp.overviewTaskMarginPx,
+ dp.heightPx - outRect.bottom - dp.getInsets().bottom,
+ Math.round((dp.availableWidthPx - outRect.width() * maxScale) / 2),
+ 1f /*maxScale*/,
+ Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM,
+ outRect);
+ }
+
+ /**
* Called when the gesture ends and the animation starts towards the given target. Used to add
* an optional additional animation with the same duration.
*/
diff --git a/quickstep/src/com/android/quickstep/FallbackActivityInterface.java b/quickstep/src/com/android/quickstep/FallbackActivityInterface.java
index 2ca5a2e..ba61574 100644
--- a/quickstep/src/com/android/quickstep/FallbackActivityInterface.java
+++ b/quickstep/src/com/android/quickstep/FallbackActivityInterface.java
@@ -60,13 +60,13 @@
/** 2 */
@Override
- public int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context,
+ public int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context, Rect outRect,
PagedOrientationHandler orientationHandler) {
+ calculateTaskSize(context, dp, outRect);
if (dp.isVerticalBarLayout() && DisplayController.getNavigationMode(context) != NO_BUTTON) {
- return dp.isSeascape()
- ? dp.overviewTaskRect.left : (dp.widthPx - dp.overviewTaskRect.right);
+ return dp.isSeascape() ? outRect.left : (dp.widthPx - outRect.right);
} else {
- return dp.heightPx - dp.overviewTaskRect.bottom;
+ return dp.heightPx - outRect.bottom;
}
}
diff --git a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java
index d3065bd..c13b95f 100644
--- a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java
+++ b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java
@@ -70,14 +70,14 @@
}
@Override
- public int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context,
+ public int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context, Rect outRect,
PagedOrientationHandler orientationHandler) {
+ calculateTaskSize(context, dp, outRect);
if (dp.isVerticalBarLayout()
&& DisplayController.getNavigationMode(context) != NavigationMode.NO_BUTTON) {
- return dp.isSeascape()
- ? dp.overviewTaskRect.left : (dp.widthPx - dp.overviewTaskRect.right);
+ return dp.isSeascape() ? outRect.left : (dp.widthPx - outRect.right);
} else {
- return LayoutUtils.getShelfTrackingDistance(dp, orientationHandler);
+ return LayoutUtils.getShelfTrackingDistance(context, dp, orientationHandler);
}
}
diff --git a/quickstep/src/com/android/quickstep/OrientationTouchTransformer.java b/quickstep/src/com/android/quickstep/OrientationTouchTransformer.java
index 895cf89..47c5dd0 100644
--- a/quickstep/src/com/android/quickstep/OrientationTouchTransformer.java
+++ b/quickstep/src/com/android/quickstep/OrientationTouchTransformer.java
@@ -32,7 +32,7 @@
import android.view.Surface;
import com.android.launcher3.R;
-import com.android.launcher3.ResourceUtils;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.util.DisplayController.Info;
import com.android.launcher3.util.DisplayController.NavigationMode;
import com.android.launcher3.util.window.CachedDisplayInfo;
diff --git a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
index d216a6a..9bd0cb9 100644
--- a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
+++ b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
@@ -2,12 +2,13 @@
import android.app.Activity;
import android.content.Context;
+import android.graphics.Rect;
import android.os.Bundle;
import androidx.annotation.Nullable;
import com.android.launcher3.testing.TestInformationHandler;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.touch.PagedOrientationHandler;
import com.android.quickstep.util.LayoutUtils;
@@ -31,7 +32,8 @@
}
case TestProtocol.REQUEST_BACKGROUND_TO_OVERVIEW_SWIPE_HEIGHT: {
- final float swipeHeight = LayoutUtils.getShelfTrackingDistance(mDeviceProfile,
+ final float swipeHeight =
+ LayoutUtils.getShelfTrackingDistance(mContext, mDeviceProfile,
PagedOrientationHandler.PORTRAIT);
response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, (int) swipeHeight);
return response;
@@ -41,8 +43,10 @@
if (!mDeviceProfile.isTablet) {
return null;
}
- response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD,
- mDeviceProfile.overviewTaskRect.height());
+ Rect focusedTaskRect = new Rect();
+ LauncherActivityInterface.INSTANCE.calculateTaskSize(mContext, mDeviceProfile,
+ focusedTaskRect);
+ response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, focusedTaskRect.height());
return response;
}
@@ -50,10 +54,10 @@
if (!mDeviceProfile.isTablet) {
return null;
}
- boolean isRecentsRtl = PagedOrientationHandler.PORTRAIT.getRecentsRtlSetting(
- mContext.getResources());
- response.putParcelable(TestProtocol.TEST_INFO_RESPONSE_FIELD,
- mDeviceProfile.getOverviewGridTaskRect(isRecentsRtl));
+ Rect gridTaskRect = new Rect();
+ LauncherActivityInterface.INSTANCE.calculateGridTaskSize(mContext, mDeviceProfile,
+ gridTaskRect, PagedOrientationHandler.PORTRAIT);
+ response.putParcelable(TestProtocol.TEST_INFO_RESPONSE_FIELD, gridTaskRect);
return response;
}
diff --git a/quickstep/src/com/android/quickstep/RecentTasksList.java b/quickstep/src/com/android/quickstep/RecentTasksList.java
index cd93dbe..813e687 100644
--- a/quickstep/src/com/android/quickstep/RecentTasksList.java
+++ b/quickstep/src/com/android/quickstep/RecentTasksList.java
@@ -62,6 +62,10 @@
private TaskLoadResult mResultsBg = INVALID_RESULT;
private TaskLoadResult mResultsUi = INVALID_RESULT;
+ private RecentsModel.RunningTasksListener mRunningTasksListener;
+ // Tasks are stored in order of least recently launched to most recently launched.
+ private ArrayList<ActivityManager.RunningTaskInfo> mRunningTasks;
+
public RecentTasksList(LooperExecutor mainThreadExecutor,
KeyguardManagerCompat keyguardManager, SystemUiProxy sysUiProxy) {
mMainThreadExecutor = mainThreadExecutor;
@@ -73,7 +77,26 @@
public void onRecentTasksChanged() throws RemoteException {
mMainThreadExecutor.execute(RecentTasksList.this::onRecentTasksChanged);
}
+
+ @Override
+ public void onRunningTaskAppeared(ActivityManager.RunningTaskInfo taskInfo) {
+ mMainThreadExecutor.execute(() -> {
+ RecentTasksList.this.onRunningTaskAppeared(taskInfo);
+ });
+ }
+
+ @Override
+ public void onRunningTaskVanished(ActivityManager.RunningTaskInfo taskInfo) {
+ mMainThreadExecutor.execute(() -> {
+ RecentTasksList.this.onRunningTaskVanished(taskInfo);
+ });
+ }
});
+ // We may receive onRunningTaskAppeared events later for tasks which have already been
+ // included in the list returned by mSysUiProxy.getRunningTasks(), or may receive
+ // onRunningTaskVanished for tasks not included in the returned list. These cases will be
+ // addressed when the tasks are added to/removed from mRunningTasks.
+ initRunningTasks(mSysUiProxy.getRunningTasks(Integer.MAX_VALUE));
}
@VisibleForTesting
@@ -154,6 +177,59 @@
mChangeId++;
}
+ /**
+ * Registers a listener for running tasks
+ */
+ public void registerRunningTasksListener(RecentsModel.RunningTasksListener listener) {
+ mRunningTasksListener = listener;
+ }
+
+ /**
+ * Removes the previously registered running tasks listener
+ */
+ public void unregisterRunningTasksListener() {
+ mRunningTasksListener = null;
+ }
+
+ private void initRunningTasks(ArrayList<ActivityManager.RunningTaskInfo> runningTasks) {
+ // Tasks are retrieved in order of most recently launched/used to least recently launched.
+ mRunningTasks = new ArrayList<>(runningTasks);
+ Collections.reverse(mRunningTasks);
+ }
+
+ /**
+ * Gets the set of running tasks.
+ */
+ public ArrayList<ActivityManager.RunningTaskInfo> getRunningTasks() {
+ return mRunningTasks;
+ }
+
+ private void onRunningTaskAppeared(ActivityManager.RunningTaskInfo taskInfo) {
+ // Make sure this task is not already in the list
+ for (ActivityManager.RunningTaskInfo existingTask : mRunningTasks) {
+ if (taskInfo.taskId == existingTask.taskId) {
+ return;
+ }
+ }
+ mRunningTasks.add(taskInfo);
+ if (mRunningTasksListener != null) {
+ mRunningTasksListener.onRunningTasksChanged();
+ }
+ }
+
+ private void onRunningTaskVanished(ActivityManager.RunningTaskInfo taskInfo) {
+ // Find the task from the list of running tasks, if it exists
+ for (ActivityManager.RunningTaskInfo existingTask : mRunningTasks) {
+ if (existingTask.taskId != taskInfo.taskId) continue;
+
+ mRunningTasks.remove(existingTask);
+ if (mRunningTasksListener != null) {
+ mRunningTasksListener.onRunningTasksChanged();
+ }
+ return;
+ }
+ }
+
/**
* Loads and creates a list of all the recent tasks.
*/
diff --git a/quickstep/src/com/android/quickstep/RecentsActivity.java b/quickstep/src/com/android/quickstep/RecentsActivity.java
index 67ce606..98824eb 100644
--- a/quickstep/src/com/android/quickstep/RecentsActivity.java
+++ b/quickstep/src/com/android/quickstep/RecentsActivity.java
@@ -23,8 +23,8 @@
import static com.android.launcher3.QuickstepTransitionManager.STATUS_BAR_TRANSITION_PRE_DELAY;
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
import static com.android.launcher3.graphics.SysUiScrim.SYSUI_PROGRESS;
-import static com.android.launcher3.testing.TestProtocol.BAD_STATE;
-import static com.android.launcher3.testing.TestProtocol.OVERVIEW_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.BAD_STATE;
+import static com.android.launcher3.testing.shared.TestProtocol.OVERVIEW_STATE_ORDINAL;
import static com.android.quickstep.OverviewComponentObserver.startHomeIntentSafely;
import static com.android.quickstep.TaskUtils.taskIsATargetWithMode;
import static com.android.quickstep.TaskViewUtils.createRecentsWindowAnimator;
diff --git a/quickstep/src/com/android/quickstep/RecentsModel.java b/quickstep/src/com/android/quickstep/RecentsModel.java
index 442578e..3074dbb 100644
--- a/quickstep/src/com/android/quickstep/RecentsModel.java
+++ b/quickstep/src/com/android/quickstep/RecentsModel.java
@@ -236,4 +236,35 @@
writer.println(prefix + "RecentsModel:");
mTaskList.dump(" ", writer);
}
+
+ /**
+ * Registers a listener for running tasks
+ */
+ public void registerRunningTasksListener(RunningTasksListener listener) {
+ mTaskList.registerRunningTasksListener(listener);
+ }
+
+ /**
+ * Removes the previously registered running tasks listener
+ */
+ public void unregisterRunningTasksListener() {
+ mTaskList.unregisterRunningTasksListener();
+ }
+
+ /**
+ * Gets the set of running tasks.
+ */
+ public ArrayList<ActivityManager.RunningTaskInfo> getRunningTasks() {
+ return mTaskList.getRunningTasks();
+ }
+
+ /**
+ * Listener for receiving running tasks changes
+ */
+ public interface RunningTasksListener {
+ /**
+ * Called when there's a change to running tasks
+ */
+ void onRunningTasksChanged();
+ }
}
diff --git a/quickstep/src/com/android/quickstep/RotationTouchHelper.java b/quickstep/src/com/android/quickstep/RotationTouchHelper.java
index f1e20db..2186a3b 100644
--- a/quickstep/src/com/android/quickstep/RotationTouchHelper.java
+++ b/quickstep/src/com/android/quickstep/RotationTouchHelper.java
@@ -31,7 +31,7 @@
import android.view.MotionEvent;
import android.view.OrientationEventListener;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.DisplayController.DisplayInfoChangeListener;
import com.android.launcher3.util.DisplayController.Info;
diff --git a/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java b/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java
index 3c15d0f..baeb514 100644
--- a/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java
+++ b/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java
@@ -49,6 +49,7 @@
public abstract class SwipeUpAnimationLogic implements
RecentsAnimationCallbacks.RecentsAnimationListener{
+ protected static final Rect TEMP_RECT = new Rect();
protected final RemoteTargetGluer mTargetGluer;
protected DeviceProfile mDp;
@@ -91,7 +92,7 @@
protected void initTransitionEndpoints(DeviceProfile dp) {
mDp = dp;
mTransitionDragLength = mGestureState.getActivityInterface().getSwipeUpDestinationAndLength(
- dp, mContext, mRemoteTargetHandles[0].getTaskViewSimulator()
+ dp, mContext, TEMP_RECT, mRemoteTargetHandles[0].getTaskViewSimulator()
.getOrientationState().getOrientationHandler());
mDragLengthFactor = (float) dp.heightPx / mTransitionDragLength;
diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java
index 9a2619b..0ec7e62 100644
--- a/quickstep/src/com/android/quickstep/SystemUiProxy.java
+++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java
@@ -20,12 +20,14 @@
import static com.android.launcher3.util.DisplayController.CHANGE_NAVIGATION_MODE;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
+import android.app.ActivityManager;
import android.app.PendingIntent;
import android.app.PictureInPictureParams;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
+import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.Insets;
import android.graphics.Rect;
@@ -96,7 +98,7 @@
private IPipAnimationListener mPipAnimationListener;
private ISplitScreenListener mSplitScreenListener;
private IStartingWindowListener mStartingWindowListener;
- private ILauncherUnlockAnimationController mPendingLauncherUnlockAnimationController;
+ private ILauncherUnlockAnimationController mLauncherUnlockAnimationController;
private IRecentTasksListener mRecentTasksListener;
private final ArrayList<RemoteTransitionCompat> mRemoteTransitions = new ArrayList<>();
private IOnBackInvokedCallback mBackToLauncherCallback;
@@ -108,12 +110,14 @@
private boolean mLastNavButtonAnimate;
private boolean mHasNavButtonAlphaBeenSet = false;
private Runnable mPendingSetNavButtonAlpha = null;
+ private Context mContext;
// TODO(141886704): Find a way to remove this
private int mLastSystemUiStateFlags;
public SystemUiProxy(Context context) {
DisplayController.INSTANCE.get(context).addChangeListener(this);
+ mContext = context;
}
@Override
@@ -189,10 +193,8 @@
if (mStartingWindowListener != null && mStartingWindow != null) {
setStartingWindowListener(mStartingWindowListener);
}
- if (mPendingLauncherUnlockAnimationController != null
- && mSysuiUnlockAnimationController != null) {
- setLauncherUnlockAnimationController(mPendingLauncherUnlockAnimationController);
- mPendingLauncherUnlockAnimationController = null;
+ if (mSysuiUnlockAnimationController != null && mLauncherUnlockAnimationController != null) {
+ setLauncherUnlockAnimationController(mLauncherUnlockAnimationController);
}
for (int i = mRemoteTransitions.size() - 1; i >= 0; --i) {
registerRemoteTransition(mRemoteTransitions.get(i));
@@ -757,11 +759,11 @@
controller.dispatchSmartspaceStateToSysui();
}
} catch (RemoteException e) {
- Log.w(TAG, "Failed call setStartingWindowListener", e);
+ Log.w(TAG, "Failed call setLauncherUnlockAnimationController", e);
}
- } else {
- mPendingLauncherUnlockAnimationController = controller;
}
+
+ mLauncherUnlockAnimationController = controller;
}
/**
@@ -870,4 +872,20 @@
}
return new ArrayList<>();
}
+
+ /**
+ * Gets the set of running tasks.
+ */
+ public ArrayList<ActivityManager.RunningTaskInfo> getRunningTasks(int numTasks) {
+ if (mRecentTasks != null
+ && mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_PC)) {
+ try {
+ return new ArrayList<ActivityManager.RunningTaskInfo>(
+ Arrays.asList(mRecentTasks.getRunningTasks(numTasks)));
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed call getRunningTasks", e);
+ }
+ }
+ return new ArrayList<>();
+ }
}
diff --git a/quickstep/src/com/android/quickstep/TaskShortcutFactory.java b/quickstep/src/com/android/quickstep/TaskShortcutFactory.java
index 092854f..69a295b 100644
--- a/quickstep/src/com/android/quickstep/TaskShortcutFactory.java
+++ b/quickstep/src/com/android/quickstep/TaskShortcutFactory.java
@@ -27,6 +27,7 @@
import android.os.Handler;
import android.os.Looper;
import android.view.View;
+import android.view.WindowInsets;
import android.window.SplashScreen;
import androidx.annotation.Nullable;
@@ -101,40 +102,10 @@
}
};
- abstract class MultiWindowFactory implements TaskShortcutFactory {
-
- private final int mIconRes;
- private final int mTextRes;
- private final LauncherEvent mLauncherEvent;
-
- MultiWindowFactory(int iconRes, int textRes, LauncherEvent launcherEvent) {
- mIconRes = iconRes;
- mTextRes = textRes;
- mLauncherEvent = launcherEvent;
- }
-
- protected abstract boolean isAvailable(BaseDraggingActivity activity, int displayId);
- protected abstract ActivityOptions makeLaunchOptions(Activity activity);
- protected abstract boolean onActivityStarted(BaseDraggingActivity activity);
-
- @Override
- public List<SystemShortcut> getShortcuts(BaseDraggingActivity activity,
- TaskIdAttributeContainer taskContainer) {
- final Task task = taskContainer.getTask();
- if (!task.isDockable) {
- return null;
- }
- if (!isAvailable(activity, task.key.displayId)) {
- return null;
- }
- return Collections.singletonList(new MultiWindowSystemShortcut(mIconRes,
- mTextRes, activity, taskContainer, this, mLauncherEvent));
- }
- }
-
class SplitSelectSystemShortcut extends SystemShortcut {
private final TaskView mTaskView;
private final SplitPositionOption mSplitPositionOption;
+
public SplitSelectSystemShortcut(BaseDraggingActivity target, TaskView taskView,
SplitPositionOption option) {
super(option.iconResId, option.textResId, target, taskView.getItemInfo(), taskView);
@@ -148,19 +119,17 @@
}
}
- class MultiWindowSystemShortcut extends SystemShortcut<BaseDraggingActivity> {
+ class FreeformSystemShortcut extends SystemShortcut<BaseDraggingActivity> {
private Handler mHandler;
private final RecentsView mRecentsView;
private final TaskThumbnailView mThumbnailView;
private final TaskView mTaskView;
- private final MultiWindowFactory mFactory;
private final LauncherEvent mLauncherEvent;
- public MultiWindowSystemShortcut(int iconRes, int textRes, BaseDraggingActivity activity,
- TaskIdAttributeContainer taskContainer, MultiWindowFactory factory,
- LauncherEvent launcherEvent) {
+ public FreeformSystemShortcut(int iconRes, int textRes, BaseDraggingActivity activity,
+ TaskIdAttributeContainer taskContainer, LauncherEvent launcherEvent) {
super(iconRes, textRes, activity, taskContainer.getItemInfo(),
taskContainer.getTaskView());
mLauncherEvent = launcherEvent;
@@ -168,55 +137,30 @@
mTaskView = taskContainer.getTaskView();
mRecentsView = activity.getOverviewPanel();
mThumbnailView = taskContainer.getThumbnailView();
- mFactory = factory;
}
@Override
public void onClick(View view) {
- Task.TaskKey taskKey = mTaskView.getTask().key;
- final int taskId = taskKey.id;
-
- final View.OnLayoutChangeListener onLayoutChangeListener =
- new View.OnLayoutChangeListener() {
- @Override
- public void onLayoutChange(View v, int l, int t, int r, int b,
- int oldL, int oldT, int oldR, int oldB) {
- mTaskView.getRootView().removeOnLayoutChangeListener(this);
- mRecentsView.clearIgnoreResetTask(taskId);
-
- // Start animating in the side pages once launcher has been resized
- mRecentsView.dismissTask(mTaskView, false, false);
- }
- };
-
- final DeviceProfile.OnDeviceProfileChangeListener onDeviceProfileChangeListener =
- new DeviceProfile.OnDeviceProfileChangeListener() {
- @Override
- public void onDeviceProfileChanged(DeviceProfile dp) {
- mTarget.removeOnDeviceProfileChangeListener(this);
- if (dp.isMultiWindowMode) {
- mTaskView.getRootView().addOnLayoutChangeListener(
- onLayoutChangeListener);
- }
- }
- };
-
dismissTaskMenuView(mTarget);
+ RecentsView rv = mTarget.getOverviewPanel();
+ rv.switchToScreenshot(() -> {
+ rv.finishRecentsAnimation(true /* toHome */, () -> {
+ mTarget.returnToHomescreen();
+ rv.getHandler().post(this::startActivity);
+ });
+ });
+ }
- ActivityOptions options = mFactory.makeLaunchOptions(mTarget);
+ private void startActivity() {
+ final Task.TaskKey taskKey = mTaskView.getTask().key;
+ final int taskId = taskKey.id;
+ final ActivityOptions options = makeLaunchOptions(mTarget);
if (options != null) {
options.setSplashScreenStyle(SplashScreen.SPLASH_SCREEN_STYLE_ICON);
}
if (options != null
&& ActivityManagerWrapper.getInstance().startActivityFromRecents(taskId,
options)) {
- if (!mFactory.onActivityStarted(mTarget)) {
- return;
- }
- // Add a device profile change listener to kick off animating the side tasks
- // once we enter multiwindow mode and relayout
- mTarget.addOnDeviceProfileChangeListener(onDeviceProfileChangeListener);
-
final Runnable animStartedListener = () -> {
// Hide the task view and wait for the window to be resized
// TODO: Consider animating in launcher and do an in-place start activity
@@ -255,6 +199,18 @@
.log(mLauncherEvent);
}
}
+
+ private ActivityOptions makeLaunchOptions(Activity activity) {
+ ActivityOptions activityOptions = ActivityOptionsCompat.makeFreeformOptions();
+ // Arbitrary bounds only because freeform is in dev mode right now
+ final View decorView = activity.getWindow().getDecorView();
+ final WindowInsets insets = decorView.getRootWindowInsets();
+ final Rect r = new Rect(0, 0, decorView.getWidth() / 2, decorView.getHeight() / 2);
+ r.offsetTo(insets.getSystemWindowInsetLeft() + 50,
+ insets.getSystemWindowInsetTop() + 50);
+ activityOptions.setLaunchBounds(r);
+ return activityOptions;
+ }
}
/**
@@ -304,28 +260,26 @@
}
};
- TaskShortcutFactory FREE_FORM = new MultiWindowFactory(R.drawable.ic_split_screen,
- R.string.recent_task_option_freeform, LAUNCHER_SYSTEM_SHORTCUT_FREE_FORM_TAP) {
-
+ TaskShortcutFactory FREE_FORM = new TaskShortcutFactory() {
@Override
- protected boolean isAvailable(BaseDraggingActivity activity, int displayId) {
+ public List<SystemShortcut> getShortcuts(BaseDraggingActivity activity,
+ TaskIdAttributeContainer taskContainer) {
+ final Task task = taskContainer.getTask();
+ if (!task.isDockable) {
+ return null;
+ }
+ if (!isAvailable(activity, task.key.displayId)) {
+ return null;
+ }
+
+ return Collections.singletonList(new FreeformSystemShortcut(R.drawable.ic_split_screen,
+ R.string.recent_task_option_freeform, activity, taskContainer,
+ LAUNCHER_SYSTEM_SHORTCUT_FREE_FORM_TAP));
+ }
+
+ private boolean isAvailable(BaseDraggingActivity activity, int displayId) {
return ActivityManagerWrapper.getInstance().supportsFreeformMultiWindow(activity);
}
-
- @Override
- protected ActivityOptions makeLaunchOptions(Activity activity) {
- ActivityOptions activityOptions = ActivityOptionsCompat.makeFreeformOptions();
- // Arbitrary bounds only because freeform is in dev mode right now
- Rect r = new Rect(50, 50, 200, 200);
- activityOptions.setLaunchBounds(r);
- return activityOptions;
- }
-
- @Override
- protected boolean onActivityStarted(BaseDraggingActivity activity) {
- activity.returnToHomescreen();
- return true;
- }
};
TaskShortcutFactory PIN = new TaskShortcutFactory() {
diff --git a/quickstep/src/com/android/quickstep/TaskViewUtils.java b/quickstep/src/com/android/quickstep/TaskViewUtils.java
index a030568..c28fc9d 100644
--- a/quickstep/src/com/android/quickstep/TaskViewUtils.java
+++ b/quickstep/src/com/android/quickstep/TaskViewUtils.java
@@ -37,7 +37,7 @@
import static com.android.launcher3.anim.Interpolators.clampToProgress;
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
import static com.android.launcher3.statehandlers.DepthController.DEPTH;
-import static com.android.launcher3.testing.TestProtocol.BAD_STATE;
+import static com.android.launcher3.testing.shared.TestProtocol.BAD_STATE;
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING;
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_OPENING;
diff --git a/quickstep/src/com/android/quickstep/TopTaskTracker.java b/quickstep/src/com/android/quickstep/TopTaskTracker.java
index 42fa86d..cfcba4c 100644
--- a/quickstep/src/com/android/quickstep/TopTaskTracker.java
+++ b/quickstep/src/com/android/quickstep/TopTaskTracker.java
@@ -20,6 +20,7 @@
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.content.Intent.ACTION_CHOOSER;
import static android.content.Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS;
+import static android.view.Display.DEFAULT_DISPLAY;
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT;
@@ -31,9 +32,9 @@
import com.android.launcher3.util.MainThreadInitializedObject;
import com.android.launcher3.util.SplitConfigurationOptions;
+import com.android.launcher3.util.SplitConfigurationOptions.SplitStageInfo;
import com.android.launcher3.util.SplitConfigurationOptions.StagePosition;
import com.android.launcher3.util.SplitConfigurationOptions.StageType;
-import com.android.launcher3.util.SplitConfigurationOptions.SplitStageInfo;
import com.android.launcher3.util.TraceHelper;
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.recents.model.Task.TaskKey;
@@ -85,6 +86,19 @@
public void onTaskMovedToFront(RunningTaskInfo taskInfo) {
mOrderedTaskList.removeIf(rto -> rto.taskId == taskInfo.taskId);
mOrderedTaskList.addFirst(taskInfo);
+
+ // Keep the home display's top running task in the first while adding a non-home
+ // display's task to the list, to avoid showing non-home display's task upon going to
+ // Recents animation.
+ if (taskInfo.displayId != DEFAULT_DISPLAY) {
+ final RunningTaskInfo topTaskOnHomeDisplay = mOrderedTaskList.stream()
+ .filter(rto -> rto.displayId == DEFAULT_DISPLAY).findFirst().orElse(null);
+ if (topTaskOnHomeDisplay != null) {
+ mOrderedTaskList.removeIf(rto -> rto.taskId == topTaskOnHomeDisplay.taskId);
+ mOrderedTaskList.addFirst(topTaskOnHomeDisplay);
+ }
+ }
+
if (mOrderedTaskList.size() >= HISTORY_SIZE) {
// If we grow in size, remove the last taskInfo which is not part of the split task.
Iterator<RunningTaskInfo> itr = mOrderedTaskList.descendingIterator();
diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java
index 149af98..2df9b9c 100644
--- a/quickstep/src/com/android/quickstep/TouchInteractionService.java
+++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java
@@ -65,7 +65,7 @@
import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.R;
-import com.android.launcher3.ResourceUtils;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.Utilities;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.provider.RestoreDbTask;
@@ -73,7 +73,7 @@
import com.android.launcher3.taskbar.TaskbarActivityContext;
import com.android.launcher3.taskbar.TaskbarManager;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.tracing.LauncherTraceProto;
import com.android.launcher3.tracing.TouchInteractionServiceProto;
import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper;
@@ -1015,7 +1015,7 @@
pw.println("ProtoTrace:");
pw.println(" file=" + ProtoTracer.INSTANCE.get(this).getTraceFile());
if (createdOverviewActivity != null) {
- createdOverviewActivity.getDeviceProfile().dump(this, "", pw);
+ createdOverviewActivity.getDeviceProfile().dump("", pw);
}
mTaskbarManager.dumpLogs("", pw);
}
diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java
index ab3201a..3734f11 100644
--- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java
+++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java
@@ -15,7 +15,7 @@
*/
package com.android.quickstep.fallback;
-import static com.android.launcher3.testing.TestProtocol.BAD_STATE;
+import static com.android.launcher3.testing.shared.TestProtocol.BAD_STATE;
import static com.android.quickstep.GestureState.GestureEndTarget.RECENTS;
import static com.android.quickstep.fallback.RecentsState.DEFAULT;
import static com.android.quickstep.fallback.RecentsState.HOME;
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/DelegateInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/DelegateInputConsumer.java
index 8da2fd3..03f8eef 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/DelegateInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/DelegateInputConsumer.java
@@ -3,7 +3,7 @@
import android.view.MotionEvent;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.tracing.InputConsumerProto;
import com.android.quickstep.InputConsumer;
import com.android.systemui.shared.system.InputMonitorCompat;
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java
index c1750b5..6bc24f2 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java
@@ -42,7 +42,7 @@
import com.android.launcher3.R;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.DisplayController;
import com.android.quickstep.AnimatedFloat;
import com.android.quickstep.GestureState;
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/OneHandedModeInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/OneHandedModeInputConsumer.java
index bc20902..d7ed79b 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/OneHandedModeInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/OneHandedModeInputConsumer.java
@@ -21,7 +21,7 @@
import static android.view.MotionEvent.ACTION_MOVE;
import static android.view.MotionEvent.ACTION_UP;
-import static com.android.launcher3.ResourceUtils.NAVBAR_BOTTOM_GESTURE_SIZE;
+import static com.android.launcher3.testing.shared.ResourceUtils.NAVBAR_BOTTOM_GESTURE_SIZE;
import static com.android.launcher3.Utilities.squaredHypot;
import android.content.Context;
@@ -30,7 +30,7 @@
import android.view.MotionEvent;
import com.android.launcher3.R;
-import com.android.launcher3.ResourceUtils;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.Utilities;
import com.android.launcher3.util.DisplayController;
import com.android.quickstep.InputConsumer;
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java
index 641385d..92d3d23 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java
@@ -50,7 +50,7 @@
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.tracing.InputConsumerProto;
import com.android.launcher3.util.Preconditions;
import com.android.launcher3.util.TraceHelper;
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/OverviewInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/OverviewInputConsumer.java
index 02ac48e..7899c55 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/OverviewInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/OverviewInputConsumer.java
@@ -29,7 +29,7 @@
import com.android.launcher3.statemanager.BaseState;
import com.android.launcher3.statemanager.StatefulActivity;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.views.BaseDragLayer;
import com.android.quickstep.BaseActivityInterface;
import com.android.quickstep.GestureState;
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/OverviewWithoutFocusInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/OverviewWithoutFocusInputConsumer.java
index a730183..bde4240 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/OverviewWithoutFocusInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/OverviewWithoutFocusInputConsumer.java
@@ -28,7 +28,7 @@
import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.logger.LauncherAtom;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.quickstep.GestureState;
import com.android.quickstep.InputConsumer;
import com.android.quickstep.RecentsAnimationDeviceState;
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java
index 71dca66..2462394 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java
@@ -30,7 +30,7 @@
import com.android.launcher3.anim.AnimatorListeners;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.touch.SingleAxisSwipeDetector;
import com.android.launcher3.util.DisplayController;
import com.android.quickstep.AnimatedFloat;
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/SysUiOverlayInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/SysUiOverlayInputConsumer.java
index 878f132..4806ac1 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/SysUiOverlayInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/SysUiOverlayInputConsumer.java
@@ -23,7 +23,7 @@
import android.view.MotionEvent;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.quickstep.InputConsumer;
import com.android.quickstep.RecentsAnimationDeviceState;
import com.android.quickstep.util.TriggerSwipeUpTouchTracker;
diff --git a/quickstep/src/com/android/quickstep/interaction/EdgeBackGestureHandler.java b/quickstep/src/com/android/quickstep/interaction/EdgeBackGestureHandler.java
index d059d82..8660d87 100644
--- a/quickstep/src/com/android/quickstep/interaction/EdgeBackGestureHandler.java
+++ b/quickstep/src/com/android/quickstep/interaction/EdgeBackGestureHandler.java
@@ -29,7 +29,7 @@
import androidx.annotation.Nullable;
-import com.android.launcher3.ResourceUtils;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.Utilities;
import com.android.launcher3.util.DisplayController;
diff --git a/quickstep/src/com/android/quickstep/interaction/EdgeBackGesturePanel.java b/quickstep/src/com/android/quickstep/interaction/EdgeBackGesturePanel.java
index b2b2f59..437572b 100644
--- a/quickstep/src/com/android/quickstep/interaction/EdgeBackGesturePanel.java
+++ b/quickstep/src/com/android/quickstep/interaction/EdgeBackGesturePanel.java
@@ -41,7 +41,7 @@
import androidx.dynamicanimation.animation.SpringForce;
import com.android.launcher3.R;
-import com.android.launcher3.ResourceUtils;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.anim.Interpolators;
import com.android.quickstep.util.VibratorWrapper;
diff --git a/quickstep/src/com/android/quickstep/interaction/NavBarGestureHandler.java b/quickstep/src/com/android/quickstep/interaction/NavBarGestureHandler.java
index f981860..4badf30 100644
--- a/quickstep/src/com/android/quickstep/interaction/NavBarGestureHandler.java
+++ b/quickstep/src/com/android/quickstep/interaction/NavBarGestureHandler.java
@@ -44,7 +44,7 @@
import androidx.annotation.Nullable;
import com.android.launcher3.R;
-import com.android.launcher3.ResourceUtils;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.DisplayController.NavigationMode;
diff --git a/quickstep/src/com/android/quickstep/util/AnimatorControllerWithResistance.java b/quickstep/src/com/android/quickstep/util/AnimatorControllerWithResistance.java
index ded4fb0..7c83833 100644
--- a/quickstep/src/com/android/quickstep/util/AnimatorControllerWithResistance.java
+++ b/quickstep/src/com/android/quickstep/util/AnimatorControllerWithResistance.java
@@ -36,6 +36,7 @@
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.touch.PagedOrientationHandler;
+import com.android.quickstep.LauncherActivityInterface;
import com.android.quickstep.views.RecentsView;
/**
@@ -154,9 +155,10 @@
*/
public static <SCALE, TRANSLATION> PendingAnimation createRecentsResistanceAnim(
RecentsParams<SCALE, TRANSLATION> params) {
- Rect startRect = new Rect(params.dp.overviewTaskRect);
+ Rect startRect = new Rect();
PagedOrientationHandler orientationHandler = params.recentsOrientedState
.getOrientationHandler();
+ LauncherActivityInterface.INSTANCE.calculateTaskSize(params.context, params.dp, startRect);
long distanceToCover = startRect.bottom;
PendingAnimation resistAnim = params.resistAnim != null
? params.resistAnim
diff --git a/quickstep/src/com/android/quickstep/util/LayoutUtils.java b/quickstep/src/com/android/quickstep/util/LayoutUtils.java
index d4eb880..d0856be 100644
--- a/quickstep/src/com/android/quickstep/util/LayoutUtils.java
+++ b/quickstep/src/com/android/quickstep/util/LayoutUtils.java
@@ -16,6 +16,7 @@
package com.android.quickstep.util;
import android.content.Context;
+import android.graphics.Rect;
import android.view.View;
import android.view.ViewGroup;
@@ -23,6 +24,7 @@
import com.android.launcher3.touch.PagedOrientationHandler;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.DisplayController.NavigationMode;
+import com.android.quickstep.LauncherActivityInterface;
public class LayoutUtils {
@@ -37,12 +39,12 @@
return swipeHeight;
}
- /**
- * Returns the shelf tracking distance.
- */
- public static int getShelfTrackingDistance(DeviceProfile dp,
+ public static int getShelfTrackingDistance(Context context, DeviceProfile dp,
PagedOrientationHandler orientationHandler) {
- return orientationHandler.getDistanceToBottomOfRect(dp, dp.overviewTaskRect);
+ // Track the bottom of the window.
+ Rect taskSize = new Rect();
+ LauncherActivityInterface.INSTANCE.calculateTaskSize(context, dp, taskSize);
+ return orientationHandler.getDistanceToBottomOfRect(dp, taskSize);
}
/**
diff --git a/quickstep/src/com/android/quickstep/util/RecentsAtomicAnimationFactory.java b/quickstep/src/com/android/quickstep/util/RecentsAtomicAnimationFactory.java
index edaa326..ac77c67 100644
--- a/quickstep/src/com/android/quickstep/util/RecentsAtomicAnimationFactory.java
+++ b/quickstep/src/com/android/quickstep/util/RecentsAtomicAnimationFactory.java
@@ -15,7 +15,7 @@
*/
package com.android.quickstep.util;
-import static com.android.launcher3.testing.TestProtocol.BAD_STATE;
+import static com.android.launcher3.testing.shared.TestProtocol.BAD_STATE;
import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_HORIZONTAL_OFFSET;
import android.animation.Animator;
diff --git a/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java b/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
index 39e3797..c459f30 100644
--- a/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
+++ b/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
@@ -25,6 +25,7 @@
import static com.android.launcher3.states.RotationHelper.ALLOW_ROTATION_PREFERENCE_KEY;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.launcher3.util.SettingsCache.ROTATION_SETTING_URI;
+import static com.android.quickstep.BaseActivityInterface.getTaskDimension;
import static java.lang.annotation.RetentionPolicy.SOURCE;
@@ -45,7 +46,7 @@
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.Utilities;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.touch.PagedOrientationHandler;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.SettingsCache;
@@ -397,8 +398,8 @@
* Returns the scale and pivot so that the provided taskRect can fit the provided full size
*/
public float getFullScreenScaleAndPivot(Rect taskView, DeviceProfile dp, PointF outPivot) {
- float scale = Math.min(dp.taskDimension.x / taskView.width(),
- dp.taskDimension.y / taskView.height());
+ getTaskDimension(dp, outPivot);
+ float scale = Math.min(outPivot.x / taskView.width(), outPivot.y / taskView.height());
if (scale == 1) {
outPivot.set(taskView.centerX(), taskView.centerY());
} else {
diff --git a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java
index e89c842..d2a2f36 100644
--- a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java
+++ b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java
@@ -43,7 +43,7 @@
import com.android.launcher3.statehandlers.DepthController;
import com.android.launcher3.statemanager.StateManager;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.SplitConfigurationOptions;
import com.android.launcher3.util.SplitConfigurationOptions.StagePosition;
import com.android.quickstep.SystemUiProxy;
diff --git a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java
index c626b0a..d37300c 100644
--- a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java
+++ b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java
@@ -22,6 +22,7 @@
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT;
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_UNDEFINED;
import static com.android.launcher3.util.SplitConfigurationOptions.StagePosition;
+import static com.android.quickstep.TaskAnimationManager.ENABLE_SHELL_TRANSITIONS;
import static com.android.quickstep.util.RecentsOrientedState.postDisplayRotation;
import static com.android.quickstep.util.RecentsOrientedState.preDisplayRotation;
import static com.android.systemui.shared.system.WindowManagerWrapper.WINDOWING_MODE_FULLSCREEN;
@@ -144,8 +145,12 @@
if (mDp == null) {
return 1;
}
- mTaskRect.set(
- mIsGridTask ? mDp.getOverviewGridTaskRect(mIsRecentsRtl) : mDp.overviewTaskRect);
+ if (mIsGridTask) {
+ mSizeStrategy.calculateGridTaskSize(mContext, mDp, mTaskRect,
+ mOrientationState.getOrientationHandler());
+ } else {
+ mSizeStrategy.calculateTaskSize(mContext, mDp, mTaskRect);
+ }
Rect fullTaskSize;
if (mSplitBounds != null) {
@@ -387,7 +392,14 @@
.withCornerRadius(getCurrentCornerRadius());
if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
- builder.withLayer(mDrawsBelowRecents ? Integer.MIN_VALUE + 1 : Integer.MAX_VALUE);
+ // In legacy transitions, the animation leashes remain in same hierarchy in the
+ // TaskDisplayArea, so we don't want to bump the layer too high otherwise it will
+ // conflict with layers that WM core positions (ie. the input consumers). For shell
+ // transitions, the animation leashes are reparented to an animation container so we
+ // can bump layers as needed.
+ builder.withLayer(mDrawsBelowRecents
+ ? Integer.MIN_VALUE + 1
+ : ENABLE_SHELL_TRANSITIONS ? Integer.MAX_VALUE : 0);
}
}
diff --git a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
index a736583..8b8558a 100644
--- a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
@@ -21,7 +21,7 @@
import static com.android.launcher3.LauncherState.OVERVIEW_MODAL_TASK;
import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT;
import static com.android.launcher3.LauncherState.SPRING_LOADED;
-import static com.android.launcher3.testing.TestProtocol.BAD_STATE;
+import static com.android.launcher3.testing.shared.TestProtocol.BAD_STATE;
import android.annotation.TargetApi;
import android.content.Context;
diff --git a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
index c178175..62ec0ef 100644
--- a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
+++ b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
@@ -93,6 +93,7 @@
@Nullable
protected DeviceProfile mDp;
+ private final Rect mTaskSize = new Rect();
public OverviewActionsView(Context context) {
this(context, null);
@@ -243,15 +244,16 @@
}
// Align to bottom of task Rect.
- return mDp.heightPx - mDp.overviewTaskRect.bottom - mDp.overviewActionsTopMarginPx
+ return mDp.heightPx - mTaskSize.bottom - mDp.overviewActionsTopMarginPx
- mDp.overviewActionsHeight;
}
/**
- * Updates device profile for this view to draw with.
+ * Updates device profile and task size for this view to draw with.
*/
- public void updateDimension(DeviceProfile dp) {
+ public void updateDimension(DeviceProfile dp, Rect taskSize) {
mDp = dp;
+ mTaskSize.set(taskSize);
updateVerticalMargin(DisplayController.getNavigationMode(getContext()));
requestLayout();
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index dc886f6..3aa24ac 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -428,6 +428,9 @@
@Nullable
protected RemoteTargetHandle[] mRemoteTargetHandles;
+ protected final Rect mLastComputedTaskSize = new Rect();
+ protected final Rect mLastComputedGridSize = new Rect();
+ protected final Rect mLastComputedGridTaskSize = new Rect();
// How much a task that is directly offscreen will be pushed out due to RecentsView scale/pivot.
@Nullable
protected Float mLastComputedTaskStartPushOutDistance = null;
@@ -1136,8 +1139,7 @@
int targetScroll = getScrollForPage(indexOfChild(getFocusedTaskView()));
if (!isClearAllHidden) {
int clearAllWidth = mOrientationHandler.getPrimarySize(mClearAllButton);
- int taskGridHorizontalDiff = mActivity.getDeviceProfile().overviewTaskRect.right
- - mActivity.getDeviceProfile().overviewGridRect.right;
+ int taskGridHorizontalDiff = mLastComputedTaskSize.right - mLastComputedGridSize.right;
int clearAllFocusScrollDiff = taskGridHorizontalDiff - clearAllWidth;
targetScroll += mIsRtl ? clearAllFocusScrollDiff : -clearAllFocusScrollDiff;
}
@@ -1676,7 +1678,7 @@
// Update RecentsView and TaskView's DeviceProfile dependent layout.
updateOrientationHandler();
- mActionsView.updateDimension(dp);
+ mActionsView.updateDimension(dp, mLastComputedTaskSize);
}
private void updateOrientationHandler() {
@@ -1732,7 +1734,7 @@
// Update task size and padding that are dependent on DeviceProfile and insets.
private void updateSizeAndPadding() {
DeviceProfile dp = mActivity.getDeviceProfile();
- mTempRect.set(dp.overviewTaskRect);
+ getTaskSize(mTempRect);
mTaskWidth = mTempRect.width();
mTaskHeight = mTempRect.height();
@@ -1741,9 +1743,14 @@
dp.widthPx - mInsets.right - mTempRect.right,
dp.heightPx - mInsets.bottom - mTempRect.bottom);
- mTaskGridVerticalDiff = dp.getOverviewGridTaskRect(mIsRtl).top - dp.overviewTaskRect.top;
+ mSizeStrategy.calculateGridSize(mActivity.getDeviceProfile(),
+ mLastComputedGridSize);
+ mSizeStrategy.calculateGridTaskSize(mActivity, mActivity.getDeviceProfile(),
+ mLastComputedGridTaskSize, mOrientationHandler);
+
+ mTaskGridVerticalDiff = mLastComputedGridTaskSize.top - mLastComputedTaskSize.top;
mTopBottomRowHeightDiff =
- dp.overviewGridTaskDimension.y + dp.overviewTaskThumbnailTopMarginPx
+ mLastComputedGridTaskSize.height() + dp.overviewTaskThumbnailTopMarginPx
+ dp.overviewRowSpacing;
// Force TaskView to update size from thumbnail
@@ -1785,6 +1792,34 @@
updateGridProperties(isTaskDismissal);
}
+ public void getTaskSize(Rect outRect) {
+ mSizeStrategy.calculateTaskSize(mActivity, mActivity.getDeviceProfile(), outRect);
+ mLastComputedTaskSize.set(outRect);
+ }
+
+ /**
+ * Returns the size of task selected to enter modal state.
+ */
+ public Point getSelectedTaskSize() {
+ mSizeStrategy.calculateTaskSize(mActivity, mActivity.getDeviceProfile(),
+ mTempRect);
+ return new Point(mTempRect.width(), mTempRect.height());
+ }
+
+ /** Gets the last computed task size */
+ public Rect getLastComputedTaskSize() {
+ return mLastComputedTaskSize;
+ }
+
+ public Rect getLastComputedGridTaskSize() {
+ return mLastComputedGridTaskSize;
+ }
+
+ /** Gets the task size for modal state. */
+ public void getModalTaskSize(Rect outRect) {
+ mSizeStrategy.calculateModalTaskSize(mActivity, mActivity.getDeviceProfile(), outRect);
+ }
+
@Override
protected boolean computeScrollHelper() {
boolean scrolling = super.computeScrollHelper();
@@ -2417,8 +2452,7 @@
return;
}
- DeviceProfile dp = mActivity.getDeviceProfile();
- int taskTopMargin = dp.overviewTaskThumbnailTopMarginPx;
+ int taskTopMargin = mActivity.getDeviceProfile().overviewTaskThumbnailTopMarginPx;
int topRowWidth = 0;
int bottomRowWidth = 0;
@@ -2461,7 +2495,7 @@
gridTranslations[i] += mIsRtl ? taskWidthAndSpacing : -taskWidthAndSpacing;
// Center view vertically in case it's from different orientation.
- taskView.setGridTranslationY((dp.overviewTaskRect.height() + taskTopMargin
+ taskView.setGridTranslationY((mLastComputedTaskSize.height() + taskTopMargin
- taskView.getLayoutParams().height) / 2f);
if (taskView == snappedTaskView) {
@@ -2577,11 +2611,11 @@
// accordingly. Update longRowWidth if ClearAllButton has been moved.
float clearAllShortTotalCompensation = 0;
int longRowWidth = Math.max(topRowWidth, bottomRowWidth);
- if (longRowWidth < dp.overviewGridRect.width()) {
- float shortTotalCompensation = dp.overviewGridRect.width() - longRowWidth;
+ if (longRowWidth < mLastComputedGridSize.width()) {
+ float shortTotalCompensation = mLastComputedGridSize.width() - longRowWidth;
clearAllShortTotalCompensation =
mIsRtl ? -shortTotalCompensation : shortTotalCompensation;
- longRowWidth = dp.overviewGridRect.width();
+ longRowWidth = mLastComputedGridSize.width();
}
float clearAllTotalTranslationX =
@@ -2598,8 +2632,9 @@
if (snappedTaskView != null) {
int distanceFromClearAll = longRowWidth - snappedTaskRowWidth + mPageSpacing;
// ClearAllButton should be off screen when snapped task is in its snapped position.
- int minimumDistance = mTaskWidth - snappedTaskView.getLayoutParams().width
- + (dp.overviewGridRect.width() - mTaskWidth) / 2;
+ int minimumDistance =
+ mTaskWidth - snappedTaskView.getLayoutParams().width
+ + (mLastComputedGridSize.width() - mTaskWidth) / 2;
if (distanceFromClearAll < minimumDistance) {
int distanceDifference = minimumDistance - distanceFromClearAll;
snappedTaskGridTranslationX += mIsRtl ? distanceDifference : -distanceDifference;
@@ -2614,9 +2649,9 @@
mClearAllButton.setGridTranslationPrimary(
clearAllTotalTranslationX - snappedTaskGridTranslationX);
- mClearAllButton.setGridScrollOffset(mIsRtl
- ? dp.overviewTaskRect.left - dp.overviewGridRect.left
- : dp.overviewTaskRect.right - dp.overviewGridRect.right);
+ mClearAllButton.setGridScrollOffset(
+ mIsRtl ? mLastComputedTaskSize.left - mLastComputedGridSize.left
+ : mLastComputedTaskSize.right - mLastComputedGridSize.right);
setGridProgress(mGridProgress);
}
@@ -2869,8 +2904,8 @@
boolean closeGapBetweenClearAll = false;
boolean isClearAllHidden = isClearAllHidden();
boolean snapToLastTask = false;
- DeviceProfile dp = mActivity.getDeviceProfile();
- boolean isLandscapeSplit = dp.isLandscape && isSplitSelectionActive();
+ boolean isLandscapeSplit =
+ mActivity.getDeviceProfile().isLandscape && isSplitSelectionActive();
boolean isSplitPlaceholderFirstInGrid = isSplitPlaceholderFirstInGrid();
boolean isSplitPlaceholderLastInGrid = isSplitPlaceholderLastInGrid();
TaskView lastGridTaskView = showAsGrid ? getLastGridTaskView() : null;
@@ -3061,7 +3096,7 @@
dismissTranslationInterpolationEnd);
if (taskView == nextFocusedTaskView) {
// Enlarge the task to be focused next, and translate into focus position.
- float scale = mTaskWidth / (float) dp.overviewGridTaskDimension.x;
+ float scale = mTaskWidth / (float) mLastComputedGridTaskSize.width();
anim.setFloat(taskView, TaskView.SNAPSHOT_SCALE, scale,
clampToProgress(LINEAR, animationStartProgress,
dismissTranslationInterpolationEnd));
@@ -3107,7 +3142,9 @@
anim.addOnFrameCallback(this::updateCurveProperties);
}
- // Add a tiny bit of translation Z, so that it draws on top of other views
+ // Add a tiny bit of translation Z, so that it draws on top of other views. This is relevant
+ // (e.g.) when we dismiss a task by sliding it upward: if there is a row of icons above, we
+ // want the dragged task to stay above all other views.
if (animateTaskView) {
dismissedTaskView.setTranslationZ(0.1f);
}
@@ -3317,7 +3354,7 @@
// Update various scroll-dependent UI.
dispatchScrollChanged();
updateActionsViewFocusedScroll();
- if (isClearAllHidden() && !dp.isTablet) {
+ if (isClearAllHidden() && !mActivity.getDeviceProfile().isTablet) {
mActionsView.updateDisabledFlags(OverviewActionsView.DISABLED_SCROLLING,
false);
}
@@ -3715,6 +3752,7 @@
updateEmptyStateUi(changed);
// Update the pivots such that when the task is scaled, it fills the full page
+ getTaskSize(mTempRect);
updatePivots();
setTaskModalness(mTaskModalness);
mLastComputedTaskStartPushOutDistance = null;
@@ -3728,13 +3766,12 @@
}
private void updatePivots() {
- DeviceProfile dp = mActivity.getDeviceProfile();
if (mOverviewSelectEnabled) {
- setPivotX(dp.overviewTaskRect.centerX());
- setPivotY(dp.overviewTaskRect.bottom);
+ setPivotX(mLastComputedTaskSize.centerX());
+ setPivotY(mLastComputedTaskSize.bottom);
} else {
- getPagedViewOrientedState().getFullScreenScaleAndPivot(dp.overviewTaskRect, dp,
- mTempPointF);
+ getPagedViewOrientedState().getFullScreenScaleAndPivot(mTempRect,
+ mActivity.getDeviceProfile(), mTempPointF);
setPivotX(mTempPointF.x);
setPivotY(mTempPointF.y);
}
@@ -4007,8 +4044,8 @@
}
public void initiateSplitSelect(TaskView taskView) {
- int defaultSplitPosition =
- mOrientationHandler.getDefaultSplitPosition(mActivity.getDeviceProfile());
+ int defaultSplitPosition = mOrientationHandler
+ .getDefaultSplitPosition(mActivity.getDeviceProfile());
initiateSplitSelect(taskView, defaultSplitPosition);
}
@@ -4313,9 +4350,9 @@
* Returns the scale up required on the view, so that it coves the screen completely
*/
public float getMaxScaleForFullScreen() {
- DeviceProfile dp = mActivity.getDeviceProfile();
- return getPagedViewOrientedState().getFullScreenScaleAndPivot(dp.overviewTaskRect,
- dp, mTempPointF);
+ getTaskSize(mTempRect);
+ return getPagedViewOrientedState().getFullScreenScaleAndPivot(
+ mTempRect, mActivity.getDeviceProfile(), mTempPointF);
}
public PendingAnimation createTaskLaunchAnimation(
@@ -4822,15 +4859,17 @@
int lastGridTaskViewPosition =
getPositionInRow(lastGridTaskView, topRowIdArray, bottomRowIdArray);
int taskViewPosition = getPositionInRow(taskView, topRowIdArray, bottomRowIdArray);
- DeviceProfile dp = mActivity.getDeviceProfile();
- Rect gridTaskRect = dp.getOverviewGridTaskRect(mIsRtl);
- int gridTaskSizeAndSpacing = gridTaskRect.width() + mPageSpacing;
+ int gridTaskSizeAndSpacing = mLastComputedGridTaskSize.width() + mPageSpacing;
int positionDiff = gridTaskSizeAndSpacing * (lastGridTaskViewPosition - taskViewPosition);
- int lastTaskEnd = (mIsRtl ? dp.overviewGridRect.left : dp.overviewGridRect.right)
+ int lastTaskEnd = (mIsRtl
+ ? mLastComputedGridSize.left
+ : mLastComputedGridSize.right)
+ (mIsRtl ? mPageSpacing : -mPageSpacing);
int taskEnd = lastTaskEnd + (mIsRtl ? positionDiff : -positionDiff);
- int normalTaskEnd = mIsRtl ? gridTaskRect.left : gridTaskRect.right;
+ int normalTaskEnd = mIsRtl
+ ? mLastComputedGridTaskSize.left
+ : mLastComputedGridTaskSize.right;
return taskEnd - normalTaskEnd;
}
@@ -5136,12 +5175,14 @@
while ((taskView == null || isTaskViewFullyVisible(taskView)) && targetPage - 1 >= 0) {
taskView = getTaskViewAt(--targetPage);
}
- DeviceProfile dp = mActivity.getDeviceProfile();
- Rect gridTaskRect = dp.getOverviewGridTaskRect(mIsRtl);
// Target a scroll where targetPage is on left of screen but still fully visible.
- int lastTaskEnd = (mIsRtl ? dp.overviewGridRect.left : dp.overviewGridRect.right)
+ int lastTaskEnd = (mIsRtl
+ ? mLastComputedGridSize.left
+ : mLastComputedGridSize.right)
+ (mIsRtl ? mPageSpacing : -mPageSpacing);
- int normalTaskEnd = mIsRtl ? gridTaskRect.left : gridTaskRect.right;
+ int normalTaskEnd = mIsRtl
+ ? mLastComputedGridTaskSize.left
+ : mLastComputedGridTaskSize.right;
int targetScroll = getScrollForPage(targetPage) + normalTaskEnd - lastTaskEnd;
// Find a page that is close to targetScroll while not over it.
while (targetPage - 1 >= 0
diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java
index ba56af1..2ccd703 100644
--- a/quickstep/src/com/android/quickstep/views/TaskView.java
+++ b/quickstep/src/com/android/quickstep/views/TaskView.java
@@ -74,7 +74,7 @@
import com.android.launcher3.popup.SystemShortcut;
import com.android.launcher3.statemanager.StatefulActivity;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.touch.PagedOrientationHandler;
import com.android.launcher3.util.ActivityOptionsWrapper;
import com.android.launcher3.util.ComponentKey;
@@ -1391,8 +1391,9 @@
DeviceProfile deviceProfile = mActivity.getDeviceProfile();
if (deviceProfile.isTablet) {
final int thumbnailPadding = deviceProfile.overviewTaskThumbnailTopMarginPx;
- final int taskWidth = deviceProfile.overviewTaskRect.width();
- final int taskHeight = deviceProfile.overviewTaskRect.height();
+ final Rect lastComputedTaskSize = getRecentsView().getLastComputedTaskSize();
+ final int taskWidth = lastComputedTaskSize.width();
+ final int taskHeight = lastComputedTaskSize.height();
int boxWidth;
int boxHeight;
@@ -1403,9 +1404,10 @@
boxWidth = taskWidth;
boxHeight = taskHeight;
} else {
- // Otherwise task is in grid.
- boxWidth = deviceProfile.overviewGridTaskDimension.x;
- boxHeight = deviceProfile.overviewGridTaskDimension.y;
+ // Otherwise task is in grid, and should use lastComputedGridTaskSize.
+ Rect lastComputedGridTaskSize = getRecentsView().getLastComputedGridTaskSize();
+ boxWidth = lastComputedGridTaskSize.width();
+ boxHeight = lastComputedGridTaskSize.height();
}
// Bound width/height to the box size.
diff --git a/quickstep/tests/src/com/android/quickstep/AbstractQuickStepTest.java b/quickstep/tests/src/com/android/quickstep/AbstractQuickStepTest.java
index 09f0858..f190e27 100644
--- a/quickstep/tests/src/com/android/quickstep/AbstractQuickStepTest.java
+++ b/quickstep/tests/src/com/android/quickstep/AbstractQuickStepTest.java
@@ -35,7 +35,7 @@
* Base class for all instrumentation tests that deal with Quickstep.
*/
public abstract class AbstractQuickStepTest extends AbstractLauncherUiTest {
- static final boolean ENABLE_SHELL_TRANSITIONS =
+ public static final boolean ENABLE_SHELL_TRANSITIONS =
SystemProperties.getBoolean("persist.wm.debug.shell_transit", false);
@Override
protected TestRule getRulesInsideActivityMonitor() {
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfilePhone3ButtonTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfilePhone3ButtonTest.kt
index 588e346..3daf81d 100644
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfilePhone3ButtonTest.kt
+++ b/quickstep/tests/src/com/android/quickstep/DeviceProfilePhone3ButtonTest.kt
@@ -483,114 +483,4 @@
fun hotseatBarEndOffset() {
assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
}
-
- @Test
- fun overviewGridRectLeft() {
- assertThat(dp.overviewGridRect.left).isEqualTo(0)
- }
-
- @Test
- fun overviewGridRectTop() {
- assertThat(dp.overviewGridRect.top).isEqualTo(280)
- }
-
- @Test
- fun overviewGridRectRight() {
- assertThat(dp.overviewGridRect.right).isEqualTo(1440)
- }
-
- @Test
- fun overviewGridRectBottom() {
- assertThat(dp.overviewGridRect.bottom).isEqualTo(2768)
- }
-
- @Test
- fun taskDimensionX() {
- assertThat(dp.taskDimension.x).isEqualTo(1440)
- }
-
- @Test
- fun taskDimensionY() {
- assertThat(dp.taskDimension.y).isEqualTo(3120)
- }
-
- @Test
- fun overviewTaskRectLeft() {
- assertThat(dp.overviewTaskRect.left).isEqualTo(231)
- }
-
- @Test
- fun overviewTaskRectTop() {
- assertThat(dp.overviewTaskRect.top).isEqualTo(414)
- }
-
- @Test
- fun overviewTaskRectRight() {
- assertThat(dp.overviewTaskRect.right).isEqualTo(1209)
- }
-
- @Test
- fun overviewTaskRectBottom() {
- assertThat(dp.overviewTaskRect.bottom).isEqualTo(2533)
- }
-
- @Test
- fun overviewGridTaskDimensionX() {
- assertThat(dp.overviewGridTaskDimension.x).isEqualTo(450)
- }
-
- @Test
- fun overviewGridTaskDimensionY() {
- assertThat(dp.overviewGridTaskDimension.y).isEqualTo(976)
- }
-
- @Test
- fun overviewModalTaskRectLeft() {
- assertThat(dp.overviewModalTaskRect.left).isEqualTo(182)
- }
-
- @Test
- fun overviewModalTaskRectTop() {
- assertThat(dp.overviewModalTaskRect.top).isEqualTo(202)
- }
-
- @Test
- fun overviewModalTaskRectRight() {
- assertThat(dp.overviewModalTaskRect.right).isEqualTo(1258)
- }
-
- @Test
- fun overviewModalTaskRectBottom() {
- assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(2533)
- }
-
- @Test
- fun getGridTaskRectLeft() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(759)
- }
-
- @Test
- fun getGridTaskRectTop() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(414)
- }
-
- @Test
- fun getGridTaskRectRight() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(1209)
- }
-
- @Test
- fun getGridTaskRectBottom() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(1390)
- }
-
- @Test
- fun overviewTaskScale() {
- assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.86595833f)
- }
-
- @Test
- fun overviewModalTaskScale() {
- assertThat(dp.overviewModalTaskScale).isEqualTo(1.1000472f)
- }
}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfilePhoneTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfilePhoneTest.kt
index f91d03d..e588c71 100644
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfilePhoneTest.kt
+++ b/quickstep/tests/src/com/android/quickstep/DeviceProfilePhoneTest.kt
@@ -483,114 +483,4 @@
fun hotseatBarEndOffset() {
assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
}
-
- @Test
- fun overviewGridRectLeft() {
- assertThat(dp.overviewGridRect.left).isEqualTo(0)
- }
-
- @Test
- fun overviewGridRectTop() {
- assertThat(dp.overviewGridRect.top).isEqualTo(280)
- }
-
- @Test
- fun overviewGridRectRight() {
- assertThat(dp.overviewGridRect.right).isEqualTo(1440)
- }
-
- @Test
- fun overviewGridRectBottom() {
- assertThat(dp.overviewGridRect.bottom).isEqualTo(2768)
- }
-
- @Test
- fun taskDimensionX() {
- assertThat(dp.taskDimension.x).isEqualTo(1440)
- }
-
- @Test
- fun taskDimensionY() {
- assertThat(dp.taskDimension.y).isEqualTo(3120)
- }
-
- @Test
- fun overviewTaskRectLeft() {
- assertThat(dp.overviewTaskRect.left).isEqualTo(231)
- }
-
- @Test
- fun overviewTaskRectTop() {
- assertThat(dp.overviewTaskRect.top).isEqualTo(414)
- }
-
- @Test
- fun overviewTaskRectRight() {
- assertThat(dp.overviewTaskRect.right).isEqualTo(1209)
- }
-
- @Test
- fun overviewTaskRectBottom() {
- assertThat(dp.overviewTaskRect.bottom).isEqualTo(2533)
- }
-
- @Test
- fun overviewGridTaskDimensionX() {
- assertThat(dp.overviewGridTaskDimension.x).isEqualTo(450)
- }
-
- @Test
- fun overviewGridTaskDimensionY() {
- assertThat(dp.overviewGridTaskDimension.y).isEqualTo(976)
- }
-
- @Test
- fun overviewModalTaskRectLeft() {
- assertThat(dp.overviewModalTaskRect.left).isEqualTo(182)
- }
-
- @Test
- fun overviewModalTaskRectTop() {
- assertThat(dp.overviewModalTaskRect.top).isEqualTo(202)
- }
-
- @Test
- fun overviewModalTaskRectRight() {
- assertThat(dp.overviewModalTaskRect.right).isEqualTo(1258)
- }
-
- @Test
- fun overviewModalTaskRectBottom() {
- assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(2533)
- }
-
- @Test
- fun getGridTaskRectLeft() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(759)
- }
-
- @Test
- fun getGridTaskRectTop() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(414)
- }
-
- @Test
- fun getGridTaskRectRight() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(1209)
- }
-
- @Test
- fun getGridTaskRectBottom() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(1390)
- }
-
- @Test
- fun overviewTaskScale() {
- assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.86595833f)
- }
-
- @Test
- fun overviewModalTaskScale() {
- assertThat(dp.overviewModalTaskScale).isEqualTo(1.1000472f)
- }
}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscape3ButtonTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscape3ButtonTest.kt
index 2d9e263..d0c9346 100644
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscape3ButtonTest.kt
+++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscape3ButtonTest.kt
@@ -461,7 +461,7 @@
@Test
fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(1443)
+ assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(1305)
}
@Test
@@ -471,7 +471,7 @@
@Test
fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(428)
+ assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(566)
}
@Test
@@ -481,116 +481,6 @@
@Test
fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(428)
- }
-
- @Test
- fun overviewGridRectLeft() {
- assertThat(dp.overviewGridRect.left).isEqualTo(128)
- }
-
- @Test
- fun overviewGridRectTop() {
- assertThat(dp.overviewGridRect.top).isEqualTo(160)
- }
-
- @Test
- fun overviewGridRectRight() {
- assertThat(dp.overviewGridRect.right).isEqualTo(2432)
- }
-
- @Test
- fun overviewGridRectBottom() {
- assertThat(dp.overviewGridRect.bottom).isEqualTo(1340)
- }
-
- @Test
- fun taskDimensionX() {
- assertThat(dp.taskDimension.x).isEqualTo(2560)
- }
-
- @Test
- fun taskDimensionY() {
- assertThat(dp.taskDimension.y).isEqualTo(1480)
- }
-
- @Test
- fun overviewTaskRectLeft() {
- assertThat(dp.overviewTaskRect.left).isEqualTo(384)
- }
-
- @Test
- fun overviewTaskRectTop() {
- assertThat(dp.overviewTaskRect.top).isEqualTo(232)
- }
-
- @Test
- fun overviewTaskRectRight() {
- assertThat(dp.overviewTaskRect.right).isEqualTo(2176)
- }
-
- @Test
- fun overviewTaskRectBottom() {
- assertThat(dp.overviewTaskRect.bottom).isEqualTo(1268)
- }
-
- @Test
- fun overviewGridTaskDimensionX() {
- assertThat(dp.overviewGridTaskDimension.x).isEqualTo(723)
- }
-
- @Test
- fun overviewGridTaskDimensionY() {
- assertThat(dp.overviewGridTaskDimension.y).isEqualTo(418)
- }
-
- @Test
- fun overviewModalTaskRectLeft() {
- assertThat(dp.overviewModalTaskRect.left).isEqualTo(294)
- }
-
- @Test
- fun overviewModalTaskRectTop() {
- assertThat(dp.overviewModalTaskRect.top).isEqualTo(128)
- }
-
- @Test
- fun overviewModalTaskRectRight() {
- assertThat(dp.overviewModalTaskRect.right).isEqualTo(2266)
- }
-
- @Test
- fun overviewModalTaskRectBottom() {
- assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(1268)
- }
-
- @Test
- fun getGridTaskRectLeft() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(1453)
- }
-
- @Test
- fun getGridTaskRectTop() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(232)
- }
-
- @Test
- fun getGridTaskRectRight() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(2176)
- }
-
- @Test
- fun getGridTaskRectBottom() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(650)
- }
-
- @Test
- fun overviewTaskScale() {
- assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.7363184f)
- }
-
- @Test
- fun overviewModalTaskScale() {
- assertThat(dp.overviewModalTaskScale).isEqualTo(1.1003861f)
+ assertThat(dp.hotseatBarEndOffset).isEqualTo(566)
}
}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscapeTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscapeTest.kt
index 3add2c7..456ed2c 100644
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscapeTest.kt
+++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscapeTest.kt
@@ -483,114 +483,4 @@
fun hotseatBarEndOffset() {
assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
}
-
- @Test
- fun overviewGridRectLeft() {
- assertThat(dp.overviewGridRect.left).isEqualTo(128)
- }
-
- @Test
- fun overviewGridRectTop() {
- assertThat(dp.overviewGridRect.top).isEqualTo(160)
- }
-
- @Test
- fun overviewGridRectRight() {
- assertThat(dp.overviewGridRect.right).isEqualTo(2432)
- }
-
- @Test
- fun overviewGridRectBottom() {
- assertThat(dp.overviewGridRect.bottom).isEqualTo(1416)
- }
-
- @Test
- fun taskDimensionX() {
- assertThat(dp.taskDimension.x).isEqualTo(2560)
- }
-
- @Test
- fun taskDimensionY() {
- assertThat(dp.taskDimension.y).isEqualTo(1480)
- }
-
- @Test
- fun overviewTaskRectLeft() {
- assertThat(dp.overviewTaskRect.left).isEqualTo(384)
- }
-
- @Test
- fun overviewTaskRectTop() {
- assertThat(dp.overviewTaskRect.top).isEqualTo(270)
- }
-
- @Test
- fun overviewTaskRectRight() {
- assertThat(dp.overviewTaskRect.right).isEqualTo(2176)
- }
-
- @Test
- fun overviewTaskRectBottom() {
- assertThat(dp.overviewTaskRect.bottom).isEqualTo(1306)
- }
-
- @Test
- fun overviewGridTaskDimensionX() {
- assertThat(dp.overviewGridTaskDimension.x).isEqualTo(723)
- }
-
- @Test
- fun overviewGridTaskDimensionY() {
- assertThat(dp.overviewGridTaskDimension.y).isEqualTo(418)
- }
-
- @Test
- fun overviewModalTaskRectLeft() {
- assertThat(dp.overviewModalTaskRect.left).isEqualTo(294)
- }
-
- @Test
- fun overviewModalTaskRectTop() {
- assertThat(dp.overviewModalTaskRect.top).isEqualTo(166)
- }
-
- @Test
- fun overviewModalTaskRectRight() {
- assertThat(dp.overviewModalTaskRect.right).isEqualTo(2266)
- }
-
- @Test
- fun overviewModalTaskRectBottom() {
- assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(1306)
- }
-
- @Test
- fun getGridTaskRectLeft() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(1453)
- }
-
- @Test
- fun getGridTaskRectTop() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(270)
- }
-
- @Test
- fun getGridTaskRectRight() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(2176)
- }
-
- @Test
- fun getGridTaskRectBottom() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(688)
- }
-
- @Test
- fun overviewTaskScale() {
- assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.7363184f)
- }
-
- @Test
- fun overviewModalTaskScale() {
- assertThat(dp.overviewModalTaskScale).isEqualTo(1.1003861f)
- }
}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortrait3ButtonTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortrait3ButtonTest.kt
index 7f0d6ca..eed3598 100644
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortrait3ButtonTest.kt
+++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortrait3ButtonTest.kt
@@ -481,116 +481,6 @@
@Test
fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(428)
- }
-
- @Test
- fun overviewGridRectLeft() {
- assertThat(dp.overviewGridRect.left).isEqualTo(128)
- }
-
- @Test
- fun overviewGridRectTop() {
- assertThat(dp.overviewGridRect.top).isEqualTo(160)
- }
-
- @Test
- fun overviewGridRectRight() {
- assertThat(dp.overviewGridRect.right).isEqualTo(1472)
- }
-
- @Test
- fun overviewGridRectBottom() {
- assertThat(dp.overviewGridRect.bottom).isEqualTo(2292)
- }
-
- @Test
- fun taskDimensionX() {
- assertThat(dp.taskDimension.x).isEqualTo(1600)
- }
-
- @Test
- fun taskDimensionY() {
- assertThat(dp.taskDimension.y).isEqualTo(2440)
- }
-
- @Test
- fun overviewTaskRectLeft() {
- assertThat(dp.overviewTaskRect.left).isEqualTo(240)
- }
-
- @Test
- fun overviewTaskRectTop() {
- assertThat(dp.overviewTaskRect.top).isEqualTo(372)
- }
-
- @Test
- fun overviewTaskRectRight() {
- assertThat(dp.overviewTaskRect.right).isEqualTo(1360)
- }
-
- @Test
- fun overviewTaskRectBottom() {
- assertThat(dp.overviewTaskRect.bottom).isEqualTo(2080)
- }
-
- @Test
- fun overviewGridTaskDimensionX() {
- assertThat(dp.overviewGridTaskDimension.x).isEqualTo(494)
- }
-
- @Test
- fun overviewGridTaskDimensionY() {
- assertThat(dp.overviewGridTaskDimension.y).isEqualTo(754)
- }
-
- @Test
- fun overviewModalTaskRectLeft() {
- assertThat(dp.overviewModalTaskRect.left).isEqualTo(184)
- }
-
- @Test
- fun overviewModalTaskRectTop() {
- assertThat(dp.overviewModalTaskRect.top).isEqualTo(201)
- }
-
- @Test
- fun overviewModalTaskRectRight() {
- assertThat(dp.overviewModalTaskRect.right).isEqualTo(1416)
- }
-
- @Test
- fun overviewModalTaskRectBottom() {
- assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(2080)
- }
-
- @Test
- fun getGridTaskRectLeft() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(866)
- }
-
- @Test
- fun getGridTaskRectTop() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(372)
- }
-
- @Test
- fun getGridTaskRectRight() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(1360)
- }
-
- @Test
- fun getGridTaskRectBottom() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(1126)
- }
-
- @Test
- fun overviewTaskScale() {
- assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.7686769f)
- }
-
- @Test
- fun overviewModalTaskScale() {
- assertThat(dp.overviewModalTaskScale).isEqualTo(1.1f)
+ assertThat(dp.hotseatBarEndOffset).isEqualTo(502)
}
}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortraitTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortraitTest.kt
index 1a709e6..4be3e45 100644
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortraitTest.kt
+++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortraitTest.kt
@@ -483,114 +483,4 @@
fun hotseatBarEndOffset() {
assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
}
-
- @Test
- fun overviewGridRectLeft() {
- assertThat(dp.overviewGridRect.left).isEqualTo(128)
- }
-
- @Test
- fun overviewGridRectTop() {
- assertThat(dp.overviewGridRect.top).isEqualTo(160)
- }
-
- @Test
- fun overviewGridRectRight() {
- assertThat(dp.overviewGridRect.right).isEqualTo(1472)
- }
-
- @Test
- fun overviewGridRectBottom() {
- assertThat(dp.overviewGridRect.bottom).isEqualTo(2368)
- }
-
- @Test
- fun taskDimensionX() {
- assertThat(dp.taskDimension.x).isEqualTo(1600)
- }
-
- @Test
- fun taskDimensionY() {
- assertThat(dp.taskDimension.y).isEqualTo(2440)
- }
-
- @Test
- fun overviewTaskRectLeft() {
- assertThat(dp.overviewTaskRect.left).isEqualTo(240)
- }
-
- @Test
- fun overviewTaskRectTop() {
- assertThat(dp.overviewTaskRect.top).isEqualTo(410)
- }
-
- @Test
- fun overviewTaskRectRight() {
- assertThat(dp.overviewTaskRect.right).isEqualTo(1360)
- }
-
- @Test
- fun overviewTaskRectBottom() {
- assertThat(dp.overviewTaskRect.bottom).isEqualTo(2118)
- }
-
- @Test
- fun overviewGridTaskDimensionX() {
- assertThat(dp.overviewGridTaskDimension.x).isEqualTo(494)
- }
-
- @Test
- fun overviewGridTaskDimensionY() {
- assertThat(dp.overviewGridTaskDimension.y).isEqualTo(754)
- }
-
- @Test
- fun overviewModalTaskRectLeft() {
- assertThat(dp.overviewModalTaskRect.left).isEqualTo(184)
- }
-
- @Test
- fun overviewModalTaskRectTop() {
- assertThat(dp.overviewModalTaskRect.top).isEqualTo(239)
- }
-
- @Test
- fun overviewModalTaskRectRight() {
- assertThat(dp.overviewModalTaskRect.right).isEqualTo(1416)
- }
-
- @Test
- fun overviewModalTaskRectBottom() {
- assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(2118)
- }
-
- @Test
- fun getGridTaskRectLeft() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(866)
- }
-
- @Test
- fun getGridTaskRectTop() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(410)
- }
-
- @Test
- fun getGridTaskRectRight() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(1360)
- }
-
- @Test
- fun getGridTaskRectBottom() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(1164)
- }
-
- @Test
- fun overviewTaskScale() {
- assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.7686769f)
- }
-
- @Test
- fun overviewModalTaskScale() {
- assertThat(dp.overviewModalTaskScale).isEqualTo(1.1f)
- }
}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscape3ButtonTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscape3ButtonTest.kt
index 0eeb23d..6728540 100644
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscape3ButtonTest.kt
+++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscape3ButtonTest.kt
@@ -481,116 +481,6 @@
@Test
fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(428)
- }
-
- @Test
- fun overviewGridRectLeft() {
- assertThat(dp.overviewGridRect.left).isEqualTo(128)
- }
-
- @Test
- fun overviewGridRectTop() {
- assertThat(dp.overviewGridRect.top).isEqualTo(160)
- }
-
- @Test
- fun overviewGridRectRight() {
- assertThat(dp.overviewGridRect.right).isEqualTo(2432)
- }
-
- @Test
- fun overviewGridRectBottom() {
- assertThat(dp.overviewGridRect.bottom).isEqualTo(1340)
- }
-
- @Test
- fun taskDimensionX() {
- assertThat(dp.taskDimension.x).isEqualTo(2560)
- }
-
- @Test
- fun taskDimensionY() {
- assertThat(dp.taskDimension.y).isEqualTo(1480)
- }
-
- @Test
- fun overviewTaskRectLeft() {
- assertThat(dp.overviewTaskRect.left).isEqualTo(384)
- }
-
- @Test
- fun overviewTaskRectTop() {
- assertThat(dp.overviewTaskRect.top).isEqualTo(232)
- }
-
- @Test
- fun overviewTaskRectRight() {
- assertThat(dp.overviewTaskRect.right).isEqualTo(2176)
- }
-
- @Test
- fun overviewTaskRectBottom() {
- assertThat(dp.overviewTaskRect.bottom).isEqualTo(1268)
- }
-
- @Test
- fun overviewGridTaskDimensionX() {
- assertThat(dp.overviewGridTaskDimension.x).isEqualTo(723)
- }
-
- @Test
- fun overviewGridTaskDimensionY() {
- assertThat(dp.overviewGridTaskDimension.y).isEqualTo(418)
- }
-
- @Test
- fun overviewModalTaskRectLeft() {
- assertThat(dp.overviewModalTaskRect.left).isEqualTo(294)
- }
-
- @Test
- fun overviewModalTaskRectTop() {
- assertThat(dp.overviewModalTaskRect.top).isEqualTo(128)
- }
-
- @Test
- fun overviewModalTaskRectRight() {
- assertThat(dp.overviewModalTaskRect.right).isEqualTo(2266)
- }
-
- @Test
- fun overviewModalTaskRectBottom() {
- assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(1268)
- }
-
- @Test
- fun getGridTaskRectLeft() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(1453)
- }
-
- @Test
- fun getGridTaskRectTop() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(232)
- }
-
- @Test
- fun getGridTaskRectRight() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(2176)
- }
-
- @Test
- fun getGridTaskRectBottom() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(650)
- }
-
- @Test
- fun overviewTaskScale() {
- assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.8526749f)
- }
-
- @Test
- fun overviewModalTaskScale() {
- assertThat(dp.overviewModalTaskScale).isEqualTo(1.1003861f)
+ assertThat(dp.hotseatBarEndOffset).isEqualTo(566)
}
}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscapeTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscapeTest.kt
index 7bf53d7..ba3ef55 100644
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscapeTest.kt
+++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscapeTest.kt
@@ -483,114 +483,4 @@
fun hotseatBarEndOffset() {
assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
}
-
- @Test
- fun overviewGridRectLeft() {
- assertThat(dp.overviewGridRect.left).isEqualTo(128)
- }
-
- @Test
- fun overviewGridRectTop() {
- assertThat(dp.overviewGridRect.top).isEqualTo(160)
- }
-
- @Test
- fun overviewGridRectRight() {
- assertThat(dp.overviewGridRect.right).isEqualTo(2432)
- }
-
- @Test
- fun overviewGridRectBottom() {
- assertThat(dp.overviewGridRect.bottom).isEqualTo(1416)
- }
-
- @Test
- fun taskDimensionX() {
- assertThat(dp.taskDimension.x).isEqualTo(2560)
- }
-
- @Test
- fun taskDimensionY() {
- assertThat(dp.taskDimension.y).isEqualTo(1480)
- }
-
- @Test
- fun overviewTaskRectLeft() {
- assertThat(dp.overviewTaskRect.left).isEqualTo(384)
- }
-
- @Test
- fun overviewTaskRectTop() {
- assertThat(dp.overviewTaskRect.top).isEqualTo(270)
- }
-
- @Test
- fun overviewTaskRectRight() {
- assertThat(dp.overviewTaskRect.right).isEqualTo(2176)
- }
-
- @Test
- fun overviewTaskRectBottom() {
- assertThat(dp.overviewTaskRect.bottom).isEqualTo(1306)
- }
-
- @Test
- fun overviewGridTaskDimensionX() {
- assertThat(dp.overviewGridTaskDimension.x).isEqualTo(723)
- }
-
- @Test
- fun overviewGridTaskDimensionY() {
- assertThat(dp.overviewGridTaskDimension.y).isEqualTo(418)
- }
-
- @Test
- fun overviewModalTaskRectLeft() {
- assertThat(dp.overviewModalTaskRect.left).isEqualTo(294)
- }
-
- @Test
- fun overviewModalTaskRectTop() {
- assertThat(dp.overviewModalTaskRect.top).isEqualTo(166)
- }
-
- @Test
- fun overviewModalTaskRectRight() {
- assertThat(dp.overviewModalTaskRect.right).isEqualTo(2266)
- }
-
- @Test
- fun overviewModalTaskRectBottom() {
- assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(1306)
- }
-
- @Test
- fun getGridTaskRectLeft() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(1453)
- }
-
- @Test
- fun getGridTaskRectTop() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(270)
- }
-
- @Test
- fun getGridTaskRectRight() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(2176)
- }
-
- @Test
- fun getGridTaskRectBottom() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(688)
- }
-
- @Test
- fun overviewTaskScale() {
- assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.8526749f)
- }
-
- @Test
- fun overviewModalTaskScale() {
- assertThat(dp.overviewModalTaskScale).isEqualTo(1.1003861f)
- }
}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortrait3ButtonTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortrait3ButtonTest.kt
index 9b6d7d5..a4b446a 100644
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortrait3ButtonTest.kt
+++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortrait3ButtonTest.kt
@@ -461,7 +461,7 @@
@Test
fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(340)
+ assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(266)
}
@Test
@@ -471,7 +471,7 @@
@Test
fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(428)
+ assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(502)
}
@Test
@@ -481,116 +481,6 @@
@Test
fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(428)
- }
-
- @Test
- fun overviewGridRectLeft() {
- assertThat(dp.overviewGridRect.left).isEqualTo(128)
- }
-
- @Test
- fun overviewGridRectTop() {
- assertThat(dp.overviewGridRect.top).isEqualTo(160)
- }
-
- @Test
- fun overviewGridRectRight() {
- assertThat(dp.overviewGridRect.right).isEqualTo(1472)
- }
-
- @Test
- fun overviewGridRectBottom() {
- assertThat(dp.overviewGridRect.bottom).isEqualTo(2292)
- }
-
- @Test
- fun taskDimensionX() {
- assertThat(dp.taskDimension.x).isEqualTo(1600)
- }
-
- @Test
- fun taskDimensionY() {
- assertThat(dp.taskDimension.y).isEqualTo(2440)
- }
-
- @Test
- fun overviewTaskRectLeft() {
- assertThat(dp.overviewTaskRect.left).isEqualTo(240)
- }
-
- @Test
- fun overviewTaskRectTop() {
- assertThat(dp.overviewTaskRect.top).isEqualTo(372)
- }
-
- @Test
- fun overviewTaskRectRight() {
- assertThat(dp.overviewTaskRect.right).isEqualTo(1360)
- }
-
- @Test
- fun overviewTaskRectBottom() {
- assertThat(dp.overviewTaskRect.bottom).isEqualTo(2080)
- }
-
- @Test
- fun overviewGridTaskDimensionX() {
- assertThat(dp.overviewGridTaskDimension.x).isEqualTo(494)
- }
-
- @Test
- fun overviewGridTaskDimensionY() {
- assertThat(dp.overviewGridTaskDimension.y).isEqualTo(754)
- }
-
- @Test
- fun overviewModalTaskRectLeft() {
- assertThat(dp.overviewModalTaskRect.left).isEqualTo(184)
- }
-
- @Test
- fun overviewModalTaskRectTop() {
- assertThat(dp.overviewModalTaskRect.top).isEqualTo(201)
- }
-
- @Test
- fun overviewModalTaskRectRight() {
- assertThat(dp.overviewModalTaskRect.right).isEqualTo(1416)
- }
-
- @Test
- fun overviewModalTaskRectBottom() {
- assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(2080)
- }
-
- @Test
- fun getGridTaskRectLeft() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(866)
- }
-
- @Test
- fun getGridTaskRectTop() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(372)
- }
-
- @Test
- fun getGridTaskRectRight() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(1360)
- }
-
- @Test
- fun getGridTaskRectBottom() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(1126)
- }
-
- @Test
- fun overviewTaskScale() {
- assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.7874597f)
- }
-
- @Test
- fun overviewModalTaskScale() {
- assertThat(dp.overviewModalTaskScale).isEqualTo(1.1f)
+ assertThat(dp.hotseatBarEndOffset).isEqualTo(502)
}
}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortraitTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortraitTest.kt
index 6702eb5..0c5968e 100644
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortraitTest.kt
+++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortraitTest.kt
@@ -483,114 +483,4 @@
fun hotseatBarEndOffset() {
assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
}
-
- @Test
- fun overviewGridRectLeft() {
- assertThat(dp.overviewGridRect.left).isEqualTo(128)
- }
-
- @Test
- fun overviewGridRectTop() {
- assertThat(dp.overviewGridRect.top).isEqualTo(160)
- }
-
- @Test
- fun overviewGridRectRight() {
- assertThat(dp.overviewGridRect.right).isEqualTo(1472)
- }
-
- @Test
- fun overviewGridRectBottom() {
- assertThat(dp.overviewGridRect.bottom).isEqualTo(2368)
- }
-
- @Test
- fun taskDimensionX() {
- assertThat(dp.taskDimension.x).isEqualTo(1600)
- }
-
- @Test
- fun taskDimensionY() {
- assertThat(dp.taskDimension.y).isEqualTo(2440)
- }
-
- @Test
- fun overviewTaskRectLeft() {
- assertThat(dp.overviewTaskRect.left).isEqualTo(240)
- }
-
- @Test
- fun overviewTaskRectTop() {
- assertThat(dp.overviewTaskRect.top).isEqualTo(410)
- }
-
- @Test
- fun overviewTaskRectRight() {
- assertThat(dp.overviewTaskRect.right).isEqualTo(1360)
- }
-
- @Test
- fun overviewTaskRectBottom() {
- assertThat(dp.overviewTaskRect.bottom).isEqualTo(2118)
- }
-
- @Test
- fun overviewGridTaskDimensionX() {
- assertThat(dp.overviewGridTaskDimension.x).isEqualTo(494)
- }
-
- @Test
- fun overviewGridTaskDimensionY() {
- assertThat(dp.overviewGridTaskDimension.y).isEqualTo(754)
- }
-
- @Test
- fun overviewModalTaskRectLeft() {
- assertThat(dp.overviewModalTaskRect.left).isEqualTo(184)
- }
-
- @Test
- fun overviewModalTaskRectTop() {
- assertThat(dp.overviewModalTaskRect.top).isEqualTo(239)
- }
-
- @Test
- fun overviewModalTaskRectRight() {
- assertThat(dp.overviewModalTaskRect.right).isEqualTo(1416)
- }
-
- @Test
- fun overviewModalTaskRectBottom() {
- assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(2118)
- }
-
- @Test
- fun getGridTaskRectLeft() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(866)
- }
-
- @Test
- fun getGridTaskRectTop() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(410)
- }
-
- @Test
- fun getGridTaskRectRight() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(1360)
- }
-
- @Test
- fun getGridTaskRectBottom() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(1164)
- }
-
- @Test
- fun overviewTaskScale() {
- assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.7874597f)
- }
-
- @Test
- fun overviewModalTaskScale() {
- assertThat(dp.overviewModalTaskScale).isEqualTo(1.1f)
- }
}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBar3ButtonTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBar3ButtonTest.kt
index 7e0c5f3..2bad6bb 100644
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBar3ButtonTest.kt
+++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBar3ButtonTest.kt
@@ -483,114 +483,4 @@
fun hotseatBarEndOffset() {
assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
}
-
- @Test
- fun overviewGridRectLeft() {
- assertThat(dp.overviewGridRect.left).isEqualTo(0)
- }
-
- @Test
- fun overviewGridRectTop() {
- assertThat(dp.overviewGridRect.top).isEqualTo(280)
- }
-
- @Test
- fun overviewGridRectRight() {
- assertThat(dp.overviewGridRect.right).isEqualTo(3120)
- }
-
- @Test
- fun overviewGridRectBottom() {
- assertThat(dp.overviewGridRect.bottom).isEqualTo(1130)
- }
-
- @Test
- fun taskDimensionX() {
- assertThat(dp.taskDimension.x).isEqualTo(3120)
- }
-
- @Test
- fun taskDimensionY() {
- assertThat(dp.taskDimension.y).isEqualTo(1440)
- }
-
- @Test
- fun overviewTaskRectLeft() {
- assertThat(dp.overviewTaskRect.left).isEqualTo(747)
- }
-
- @Test
- fun overviewTaskRectTop() {
- assertThat(dp.overviewTaskRect.top).isEqualTo(280)
- }
-
- @Test
- fun overviewTaskRectRight() {
- assertThat(dp.overviewTaskRect.right).isEqualTo(2372)
- }
-
- @Test
- fun overviewTaskRectBottom() {
- assertThat(dp.overviewTaskRect.bottom).isEqualTo(1030)
- }
-
- @Test
- fun overviewGridTaskDimensionX() {
- assertThat(dp.overviewGridTaskDimension.x).isEqualTo(631)
- }
-
- @Test
- fun overviewGridTaskDimensionY() {
- assertThat(dp.overviewGridTaskDimension.y).isEqualTo(291)
- }
-
- @Test
- fun overviewModalTaskRectLeft() {
- assertThat(dp.overviewModalTaskRect.left).isEqualTo(666)
- }
-
- @Test
- fun overviewModalTaskRectTop() {
- assertThat(dp.overviewModalTaskRect.top).isEqualTo(205)
- }
-
- @Test
- fun overviewModalTaskRectRight() {
- assertThat(dp.overviewModalTaskRect.right).isEqualTo(2454)
- }
-
- @Test
- fun overviewModalTaskRectBottom() {
- assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(1030)
- }
-
- @Test
- fun getGridTaskRectLeft() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(1741)
- }
-
- @Test
- fun getGridTaskRectTop() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(280)
- }
-
- @Test
- fun getGridTaskRectRight() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(2372)
- }
-
- @Test
- fun getGridTaskRectBottom() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(571)
- }
-
- @Test
- fun overviewTaskScale() {
- assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.5597015f)
- }
-
- @Test
- fun overviewModalTaskScale() {
- assertThat(dp.overviewModalTaskScale).isEqualTo(1.1f)
- }
}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBarTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBarTest.kt
index 9580458..6256a43 100644
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBarTest.kt
+++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBarTest.kt
@@ -483,114 +483,4 @@
fun hotseatBarEndOffset() {
assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
}
-
- @Test
- fun overviewGridRectLeft() {
- assertThat(dp.overviewGridRect.left).isEqualTo(0)
- }
-
- @Test
- fun overviewGridRectTop() {
- assertThat(dp.overviewGridRect.top).isEqualTo(280)
- }
-
- @Test
- fun overviewGridRectRight() {
- assertThat(dp.overviewGridRect.right).isEqualTo(3120)
- }
-
- @Test
- fun overviewGridRectBottom() {
- assertThat(dp.overviewGridRect.bottom).isEqualTo(1130)
- }
-
- @Test
- fun taskDimensionX() {
- assertThat(dp.taskDimension.x).isEqualTo(3120)
- }
-
- @Test
- fun taskDimensionY() {
- assertThat(dp.taskDimension.y).isEqualTo(1440)
- }
-
- @Test
- fun overviewTaskRectLeft() {
- assertThat(dp.overviewTaskRect.left).isEqualTo(747)
- }
-
- @Test
- fun overviewTaskRectTop() {
- assertThat(dp.overviewTaskRect.top).isEqualTo(280)
- }
-
- @Test
- fun overviewTaskRectRight() {
- assertThat(dp.overviewTaskRect.right).isEqualTo(2372)
- }
-
- @Test
- fun overviewTaskRectBottom() {
- assertThat(dp.overviewTaskRect.bottom).isEqualTo(1030)
- }
-
- @Test
- fun overviewGridTaskDimensionX() {
- assertThat(dp.overviewGridTaskDimension.x).isEqualTo(631)
- }
-
- @Test
- fun overviewGridTaskDimensionY() {
- assertThat(dp.overviewGridTaskDimension.y).isEqualTo(291)
- }
-
- @Test
- fun overviewModalTaskRectLeft() {
- assertThat(dp.overviewModalTaskRect.left).isEqualTo(666)
- }
-
- @Test
- fun overviewModalTaskRectTop() {
- assertThat(dp.overviewModalTaskRect.top).isEqualTo(205)
- }
-
- @Test
- fun overviewModalTaskRectRight() {
- assertThat(dp.overviewModalTaskRect.right).isEqualTo(2454)
- }
-
- @Test
- fun overviewModalTaskRectBottom() {
- assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(1030)
- }
-
- @Test
- fun getGridTaskRectLeft() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(1741)
- }
-
- @Test
- fun getGridTaskRectTop() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(280)
- }
-
- @Test
- fun getGridTaskRectRight() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(2372)
- }
-
- @Test
- fun getGridTaskRectBottom() {
- assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(571)
- }
-
- @Test
- fun overviewTaskScale() {
- assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.5597015f)
- }
-
- @Test
- fun overviewModalTaskScale() {
- assertThat(dp.overviewModalTaskScale).isEqualTo(1.1f)
- }
}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/OrientationTouchTransformerTest.java b/quickstep/tests/src/com/android/quickstep/OrientationTouchTransformerTest.java
index 1c15e1e..c822578 100644
--- a/quickstep/tests/src/com/android/quickstep/OrientationTouchTransformerTest.java
+++ b/quickstep/tests/src/com/android/quickstep/OrientationTouchTransformerTest.java
@@ -41,7 +41,7 @@
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
-import com.android.launcher3.ResourceUtils;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.RotationUtils;
import com.android.launcher3.util.WindowBounds;
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
index 81df3c0..4bd627a 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
@@ -212,6 +212,7 @@
@Test
@NavigationModeSwitch
@PortraitLandscape
+ @ScreenRecord // b/238461765
public void testSwitchToOverview() throws Exception {
assertNotNull("Workspace.switchToOverview() returned null",
mLauncher.goHome().switchToOverview());
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index e5b588c..3b71585 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -176,6 +176,10 @@
<!-- defaults to numColumns, if not specified -->
<attr name="hotseatColumnSpanTwoPanelPortrait" format="integer" />
+ <!-- Spacing to have at the end of the nav buttons in large screen 3 button nav,
+ defaults to @dimen/taskbar_button_margin_default -->
+ <attr name="inlineNavButtonsEndSpacing" format="reference" />
+
<attr name="dbFile" format="string" />
<attr name="defaultLayoutId" format="reference" />
<attr name="defaultSplitDisplayLayoutId" format="reference" />
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index dc80bc3..b19e739 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -363,6 +363,12 @@
<dimen name="taskbar_nav_buttons_size">0dp</dimen>
<dimen name="taskbar_contextual_button_margin">0dp</dimen>
<dimen name="taskbar_hotseat_nav_spacing">0dp</dimen>
+ <dimen name="taskbar_button_margin_default">0dp</dimen>
+ <dimen name="taskbar_button_space_inbetween">0dp</dimen>
+ <dimen name="taskbar_button_margin_5_5">0dp</dimen>
+ <dimen name="taskbar_button_margin_6_5">0dp</dimen>
+ <dimen name="taskbar_button_margin_4_5">0dp</dimen>
+ <dimen name="taskbar_button_margin_4_4">0dp</dimen>
<!-- Size of the maximum radius for the enforced rounded rectangles. -->
<dimen name="enforced_rounded_corner_max_radius">16dp</dimen>
@@ -383,9 +389,6 @@
<dimen name="overview_grid_side_margin">0dp</dimen>
<dimen name="overview_grid_row_spacing">0dp</dimen>
<dimen name="overview_page_spacing">0dp</dimen>
- <dimen name="overview_minimum_next_prev_size">0dp</dimen>
- <item name="overview_max_scale" format="float" type="dimen">0.0</item>
- <item name="overview_modal_max_scale" format="float" type="dimen">0.0</item>
<dimen name="split_placeholder_size">72dp</dimen>
<dimen name="split_placeholder_inset">16dp</dimen>
<dimen name="split_placeholder_icon_size">44dp</dimen>
diff --git a/res/xml/device_profiles.xml b/res/xml/device_profiles.xml
index 5ee291b..0238e7d 100644
--- a/res/xml/device_profiles.xml
+++ b/res/xml/device_profiles.xml
@@ -26,7 +26,7 @@
launcher:numHotseatIcons="3"
launcher:dbFile="launcher_3_by_3.db"
launcher:defaultLayoutId="@xml/default_workspace_3x3"
- launcher:deviceCategory="phone|multi_display" >
+ launcher:deviceCategory="phone" >
<display-option
launcher:name="Super Short Stubby"
@@ -58,6 +58,7 @@
launcher:numFolderColumns="4"
launcher:numHotseatIcons="4"
launcher:dbFile="launcher_4_by_4.db"
+ launcher:inlineNavButtonsEndSpacing="@dimen/taskbar_button_margin_4_4"
launcher:defaultLayoutId="@xml/default_workspace_4x4"
launcher:deviceCategory="phone|multi_display" >
@@ -121,6 +122,7 @@
launcher:numFolderColumns="4"
launcher:numHotseatIcons="5"
launcher:dbFile="launcher.db"
+ launcher:inlineNavButtonsEndSpacing="@dimen/taskbar_button_margin_5_5"
launcher:defaultLayoutId="@xml/default_workspace_5x5"
launcher:deviceCategory="phone|multi_display" >
@@ -167,6 +169,7 @@
launcher:hotseatColumnSpanLandscape="4"
launcher:numAllAppsColumns="6"
launcher:isScalable="true"
+ launcher:inlineNavButtonsEndSpacing="@dimen/taskbar_button_margin_6_5"
launcher:devicePaddingId="@xml/paddings_6x5"
launcher:dbFile="launcher_6_by_5.db"
launcher:defaultLayoutId="@xml/default_workspace_6x5"
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index d09642a..a19a8e8 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -20,7 +20,7 @@
import static com.android.launcher3.InvariantDeviceProfile.INDEX_LANDSCAPE;
import static com.android.launcher3.InvariantDeviceProfile.INDEX_TWO_PANEL_LANDSCAPE;
import static com.android.launcher3.InvariantDeviceProfile.INDEX_TWO_PANEL_PORTRAIT;
-import static com.android.launcher3.ResourceUtils.pxFromDp;
+import static com.android.launcher3.testing.shared.ResourceUtils.pxFromDp;
import static com.android.launcher3.Utilities.dpiFromPx;
import static com.android.launcher3.Utilities.pxFromSp;
import static com.android.launcher3.folder.ClippedFolderIconLayoutRule.ICON_OVERLAP_FACTOR;
@@ -34,7 +34,6 @@
import android.graphics.PointF;
import android.graphics.Rect;
import android.util.DisplayMetrics;
-import android.view.Gravity;
import android.view.Surface;
import com.android.launcher3.CellLayout.ContainerType;
@@ -42,7 +41,6 @@
import com.android.launcher3.icons.DotRenderer;
import com.android.launcher3.icons.GraphicsUtils;
import com.android.launcher3.icons.IconNormalizer;
-import com.android.launcher3.touch.PortraitPagedViewHandler;
import com.android.launcher3.uioverrides.ApiWrapper;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.DisplayController.Info;
@@ -204,12 +202,6 @@
public int overviewPageSpacing;
public int overviewRowSpacing;
public int overviewGridSideMargin;
- public final Rect overviewGridRect = new Rect();
- public final Rect overviewTaskRect = new Rect();
- public final float overviewTaskWorkspaceScale;
- public final Point overviewGridTaskDimension = new Point();
- public final Rect overviewModalTaskRect = new Rect();
- public final float overviewModalTaskScale;
// Widgets
public final PointF appWidgetScale = new PointF(1.0f, 1.0f);
@@ -236,9 +228,6 @@
public DotRenderer mDotRendererWorkSpace;
public DotRenderer mDotRendererAllApps;
- // Tasks
- public final PointF taskDimension = new PointF();
-
// Taskbar
public boolean isTaskbarPresent;
// Whether Taskbar will inset the bottom of apps by taskbarSize.
@@ -424,11 +413,13 @@
if (areNavButtonsInline) {
/*
* 3 nav buttons +
+ * Spacing between nav buttons +
* Little space at the end for contextual buttons +
* Little space between icons and nav buttons
*/
hotseatBarEndOffset = 3 * res.getDimensionPixelSize(R.dimen.taskbar_nav_buttons_size)
- + res.getDimensionPixelSize(R.dimen.taskbar_contextual_button_margin)
+ + 2 * res.getDimensionPixelSize(R.dimen.taskbar_button_space_inbetween)
+ + res.getDimensionPixelSize(inv.inlineNavButtonsEndSpacing)
+ res.getDimensionPixelSize(R.dimen.taskbar_hotseat_nav_spacing);
} else {
hotseatBarEndOffset = 0;
@@ -492,104 +483,6 @@
mDotRendererWorkSpace = new DotRenderer(iconSizePx, dotPath, DEFAULT_DOT_SIZE);
mDotRendererAllApps = iconSizePx == allAppsIconSizePx ? mDotRendererWorkSpace :
new DotRenderer(allAppsIconSizePx, dotPath, DEFAULT_DOT_SIZE);
-
- // Grid and Task size calculations
- calculateGridSize();
- getTaskDimension();
- calculateTaskSize(res);
- calculateGridTaskSize();
- calculateModalTaskSize(res);
- overviewModalTaskScale =
- Math.min(overviewModalTaskRect.height() / (float) overviewTaskRect.height(),
- overviewModalTaskRect.width() / (float) overviewTaskRect.width());
- overviewTaskWorkspaceScale = (float) overviewTaskRect.height() / getCellLayoutHeight();
- }
-
- private void calculateGridSize() {
- int topMargin = overviewTaskThumbnailTopMarginPx;
- int bottomMargin = getOverviewActionsClaimedSpace();
- int sideMargin = overviewGridSideMargin;
-
- overviewGridRect.set(0, 0, widthPx, heightPx);
- overviewGridRect.inset(Math.max(mInsets.left, sideMargin), mInsets.top + topMargin,
- Math.max(mInsets.right, sideMargin), Math.max(mInsets.bottom, bottomMargin));
- }
-
- private void calculateTaskSize(Resources res) {
- int overviewMinNextPrevSize =
- res.getDimensionPixelSize(R.dimen.overview_minimum_next_prev_size);
- float overviewMaxScale = res.getFloat(R.dimen.overview_max_scale);
- Rect containerRect = new Rect();
- if (isTablet) {
- containerRect.set(overviewGridRect);
- } else {
- int taskMargin = overviewTaskMarginPx;
- containerRect.set(0, 0, widthPx, heightPx);
- containerRect.inset(mInsets.left, mInsets.top, mInsets.right, mInsets.bottom);
- int minimumHorizontalPadding = overviewMinNextPrevSize + taskMargin;
- containerRect.inset(minimumHorizontalPadding, overviewTaskThumbnailTopMarginPx,
- minimumHorizontalPadding, getOverviewActionsClaimedSpace());
- }
- float scale = Math.min(
- containerRect.width() / taskDimension.x,
- containerRect.height() / taskDimension.y);
- scale = Math.min(scale, overviewMaxScale);
- int outWidth = Math.round(scale * taskDimension.x);
- int outHeight = Math.round(scale * taskDimension.y);
- Gravity.apply(Gravity.CENTER, outWidth, outHeight, containerRect, overviewTaskRect);
- }
-
- private void calculateGridTaskSize() {
- float rowHeight =
- (overviewTaskRect.height() + overviewTaskThumbnailTopMarginPx - overviewRowSpacing)
- / 2f;
-
- float scale = (rowHeight - overviewTaskThumbnailTopMarginPx) / taskDimension.y;
- overviewGridTaskDimension.set(
- Math.round(scale * taskDimension.x), Math.round(scale * taskDimension.y));
- }
-
- /**
- * Returns a Rect the size of a grid task with the correct positioning within the screen.
- *
- * @param isRecentsRtl is true when device is in LTR, false when in RTL, as grid tasks are only
- * supported on tablets, which use PortraitPagedViewHandler.
- */
- public Rect getOverviewGridTaskRect(boolean isRecentsRtl) {
- Rect outRect = new Rect();
- int gravity = Gravity.TOP;
- gravity |= isRecentsRtl ? Gravity.RIGHT : Gravity.LEFT;
- Gravity.apply(gravity, overviewGridTaskDimension.x, overviewGridTaskDimension.y,
- overviewTaskRect, outRect);
- return outRect;
- }
-
- private void calculateModalTaskSize(Resources res) {
- float overviewModalMaxScale = res.getFloat(R.dimen.overview_modal_max_scale);
- Rect potentialTaskRect = new Rect(0, 0, widthPx, heightPx);
- potentialTaskRect.inset(mInsets.left, mInsets.top, mInsets.right, mInsets.bottom);
- int minimumHorizontalPadding = Math.round(
- (availableWidthPx - overviewTaskRect.width() * overviewModalMaxScale) / 2);
- potentialTaskRect.inset(
- minimumHorizontalPadding,
- overviewTaskMarginPx,
- minimumHorizontalPadding,
- heightPx - overviewTaskRect.bottom - mInsets.bottom);
- float scale = Math.min(
- potentialTaskRect.width() / taskDimension.x,
- potentialTaskRect.height() / taskDimension.y);
- int outWidth = Math.round(scale * taskDimension.x);
- int outHeight = Math.round(scale * taskDimension.y);
- Gravity.apply(Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM, outWidth, outHeight,
- potentialTaskRect, overviewModalTaskRect);
- }
-
- private void getTaskDimension() {
- float taskHeight = heightPx;
- if (isTablet) {
- taskHeight -= taskbarSize;
- }
- taskDimension.set(widthPx, taskHeight);
}
/**
@@ -1354,8 +1247,7 @@
}
// LINT.IfChange
- /** Dumps various DeviceProfile variables to the specified writer. */
- public void dump(Context context, String prefix, PrintWriter writer) {
+ public void dump(String prefix, PrintWriter writer) {
writer.println(prefix + "DeviceProfile:");
writer.println(prefix + "\t1 dp = " + mMetrics.density + " px");
@@ -1401,12 +1293,9 @@
cellLayoutBorderSpacePx.x));
writer.println(prefix + pxToDpStr("cellLayoutBorderSpacePx Vertical",
cellLayoutBorderSpacePx.y));
- writer.println(
- prefix + pxToDpStr("cellLayoutPaddingPx.left", cellLayoutPaddingPx.left));
- writer.println(
- prefix + pxToDpStr("cellLayoutPaddingPx.top", cellLayoutPaddingPx.top));
- writer.println(
- prefix + pxToDpStr("cellLayoutPaddingPx.right", cellLayoutPaddingPx.right));
+ writer.println(prefix + pxToDpStr("cellLayoutPaddingPx.left", cellLayoutPaddingPx.left));
+ writer.println(prefix + pxToDpStr("cellLayoutPaddingPx.top", cellLayoutPaddingPx.top));
+ writer.println(prefix + pxToDpStr("cellLayoutPaddingPx.right", cellLayoutPaddingPx.right));
writer.println(
prefix + pxToDpStr("cellLayoutPaddingPx.bottom", cellLayoutPaddingPx.bottom));
@@ -1440,15 +1329,13 @@
writer.println(prefix + pxToDpStr("allAppsBorderSpacePxX", allAppsBorderSpacePx.x));
writer.println(prefix + pxToDpStr("allAppsBorderSpacePxY", allAppsBorderSpacePx.y));
writer.println(prefix + "\tnumShownAllAppsColumns: " + numShownAllAppsColumns);
- writer.println(
- prefix + pxToDpStr("allAppsLeftRightPadding", allAppsLeftRightPadding));
+ writer.println(prefix + pxToDpStr("allAppsLeftRightPadding", allAppsLeftRightPadding));
writer.println(prefix + pxToDpStr("allAppsLeftRightMargin", allAppsLeftRightMargin));
writer.println(prefix + pxToDpStr("hotseatBarSizePx", hotseatBarSizePx));
writer.println(prefix + "\tinv.hotseatColumnSpan: " + inv.hotseatColumnSpan[mTypeIndex]);
writer.println(prefix + pxToDpStr("hotseatCellHeightPx", hotseatCellHeightPx));
- writer.println(
- prefix + pxToDpStr("hotseatBarBottomSpacePx", hotseatBarBottomSpacePx));
+ writer.println(prefix + pxToDpStr("hotseatBarBottomSpacePx", hotseatBarBottomSpacePx));
writer.println(prefix + pxToDpStr("hotseatBarSidePaddingStartPx",
hotseatBarSidePaddingStartPx));
writer.println(prefix + pxToDpStr("hotseatBarSidePaddingEndPx",
@@ -1459,12 +1346,9 @@
writer.println(prefix + pxToDpStr("springLoadedHotseatBarTopMarginPx",
springLoadedHotseatBarTopMarginPx));
writer.println(prefix + pxToDpStr("mHotseatBarPadding.top", mHotseatBarPadding.top));
- writer.println(
- prefix + pxToDpStr("mHotseatBarPadding.bottom", mHotseatBarPadding.bottom));
- writer.println(
- prefix + pxToDpStr("mHotseatBarPadding.left", mHotseatBarPadding.left));
- writer.println(
- prefix + pxToDpStr("mHotseatBarPadding.right", mHotseatBarPadding.right));
+ writer.println(prefix + pxToDpStr("mHotseatBarPadding.bottom", mHotseatBarPadding.bottom));
+ writer.println(prefix + pxToDpStr("mHotseatBarPadding.left", mHotseatBarPadding.left));
+ writer.println(prefix + pxToDpStr("mHotseatBarPadding.right", mHotseatBarPadding.right));
writer.println(prefix + "\tnumShownHotseatIcons: " + numShownHotseatIcons);
writer.println(prefix + pxToDpStr("hotseatBorderSpace", hotseatBorderSpace));
writer.println(prefix + "\tisQsbInline: " + isQsbInline);
@@ -1479,14 +1363,12 @@
writer.println(prefix + pxToDpStr("workspacePadding.left", workspacePadding.left));
writer.println(prefix + pxToDpStr("workspacePadding.top", workspacePadding.top));
writer.println(prefix + pxToDpStr("workspacePadding.right", workspacePadding.right));
- writer.println(
- prefix + pxToDpStr("workspacePadding.bottom", workspacePadding.bottom));
+ writer.println(prefix + pxToDpStr("workspacePadding.bottom", workspacePadding.bottom));
writer.println(prefix + pxToDpStr("iconScale", iconScale));
writer.println(prefix + pxToDpStr("cellScaleToFit ", cellScaleToFit));
writer.println(prefix + pxToDpStr("extraSpace", extraSpace));
- writer.println(
- prefix + pxToDpStr("unscaled extraSpace", extraSpace / iconScale));
+ writer.println(prefix + pxToDpStr("unscaled extraSpace", extraSpace / iconScale));
if (inv.devicePaddings != null) {
int unscaledExtraSpace = (int) (extraSpace / iconScale);
@@ -1497,8 +1379,7 @@
writer.println(prefix + pxToDpStr("workspaceBottomPadding", workspaceBottomPadding));
writer.println(prefix + pxToDpStr("overviewTaskMarginPx", overviewTaskMarginPx));
- writer.println(
- prefix + pxToDpStr("overviewTaskMarginGridPx", overviewTaskMarginGridPx));
+ writer.println(prefix + pxToDpStr("overviewTaskMarginGridPx", overviewTaskMarginGridPx));
writer.println(prefix + pxToDpStr("overviewTaskIconSizePx", overviewTaskIconSizePx));
writer.println(prefix + pxToDpStr("overviewTaskIconDrawableSizePx",
overviewTaskIconDrawableSizePx));
@@ -1516,64 +1397,21 @@
writer.println(prefix + pxToDpStr("overviewRowSpacing", overviewRowSpacing));
writer.println(prefix + pxToDpStr("overviewGridSideMargin", overviewGridSideMargin));
- writer.println(
- prefix + pxToDpStr("dropTargetBarTopMarginPx", dropTargetBarTopMarginPx));
+ writer.println(prefix + pxToDpStr("dropTargetBarTopMarginPx", dropTargetBarTopMarginPx));
writer.println(prefix + pxToDpStr("dropTargetBarSizePx", dropTargetBarSizePx));
- writer.println(prefix
- + pxToDpStr("dropTargetBarBottomMarginPx", dropTargetBarBottomMarginPx));
+ writer.println(
+ prefix + pxToDpStr("dropTargetBarBottomMarginPx", dropTargetBarBottomMarginPx));
- writer.println(prefix
- + pxToDpStr("workspaceSpringLoadShrunkTop", mWorkspaceSpringLoadShrunkTop));
+ writer.println(
+ prefix + pxToDpStr("workspaceSpringLoadShrunkTop", mWorkspaceSpringLoadShrunkTop));
writer.println(prefix + pxToDpStr("workspaceSpringLoadShrunkBottom",
mWorkspaceSpringLoadShrunkBottom));
writer.println(prefix + pxToDpStr("workspaceSpringLoadedMinNextPageVisiblePx",
workspaceSpringLoadedMinNextPageVisiblePx));
- writer.println(prefix
- + pxToDpStr("getWorkspaceSpringLoadScale()", getWorkspaceSpringLoadScale()));
+ writer.println(
+ prefix + pxToDpStr("getWorkspaceSpringLoadScale()", getWorkspaceSpringLoadScale()));
writer.println(prefix + pxToDpStr("getCellLayoutHeight()", getCellLayoutHeight()));
writer.println(prefix + pxToDpStr("getCellLayoutWidth()", getCellLayoutWidth()));
-
- writer.println(prefix + pxToDpStr("overviewGridRect.left", overviewGridRect.left));
- writer.println(prefix + pxToDpStr("overviewGridRect.top", overviewGridRect.top));
- writer.println(prefix + pxToDpStr("overviewGridRect.right", overviewGridRect.right));
- writer.println(prefix
- + pxToDpStr("overviewGridRect.bottom", overviewGridRect.bottom));
- writer.println(prefix + pxToDpStr("taskDimension.x", taskDimension.x));
- writer.println(prefix + pxToDpStr("taskDimension.y", taskDimension.y));
- writer.println(prefix + pxToDpStr("overviewTaskRect.left", overviewTaskRect.left));
- writer.println(prefix + pxToDpStr("overviewTaskRect.top", overviewTaskRect.top));
- writer.println(prefix + pxToDpStr("overviewTaskRect.right", overviewTaskRect.right));
- writer.println(prefix
- + pxToDpStr("overviewTaskRect.bottom", overviewTaskRect.bottom));
- writer.println(prefix
- + pxToDpStr("overviewGridTaskDimension.x", overviewGridTaskDimension.x));
- writer.println(prefix
- + pxToDpStr("overviewGridTaskDimension.y", overviewGridTaskDimension.y));
- writer.println(prefix
- + pxToDpStr("overviewModalTaskRect.left", overviewModalTaskRect.left));
- writer.println(prefix
- + pxToDpStr("overviewModalTaskRect.top", overviewModalTaskRect.top));
- writer.println(prefix
- + pxToDpStr("overviewModalTaskRect.right", overviewModalTaskRect.right));
- writer.println(prefix
- + pxToDpStr("overviewModalTaskRect.bottom", overviewModalTaskRect.bottom));
- boolean isRecentsRtl =
- PortraitPagedViewHandler.PORTRAIT.getRecentsRtlSetting(context.getResources());
- writer.println(prefix
- + pxToDpStr("getOverviewGridTaskRect(" + isRecentsRtl + ").left",
- getOverviewGridTaskRect(isRecentsRtl).left));
- writer.println(prefix
- + pxToDpStr("getOverviewGridTaskRect(" + isRecentsRtl + ").top",
- getOverviewGridTaskRect(isRecentsRtl).top));
- writer.println(prefix
- + pxToDpStr("getOverviewGridTaskRect(" + isRecentsRtl + ").right",
- getOverviewGridTaskRect(isRecentsRtl).right));
- writer.println(prefix
- + pxToDpStr("getOverviewGridTaskRect(" + isRecentsRtl + ").bottom",
- getOverviewGridTaskRect(isRecentsRtl).bottom));
- writer.println(
- prefix + pxToDpStr("overviewTaskWorkspaceScale", overviewTaskWorkspaceScale));
- writer.println(prefix + pxToDpStr("overviewModalTaskScale", overviewModalTaskScale));
}
// LINT.ThenChange(
// packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfilePhoneTest.kt,
diff --git a/src/com/android/launcher3/DropTargetBar.java b/src/com/android/launcher3/DropTargetBar.java
index c1304d4..3eb2ee0 100644
--- a/src/com/android/launcher3/DropTargetBar.java
+++ b/src/com/android/launcher3/DropTargetBar.java
@@ -37,7 +37,7 @@
import com.android.launcher3.dragndrop.DragController;
import com.android.launcher3.dragndrop.DragController.DragListener;
import com.android.launcher3.dragndrop.DragOptions;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
/*
* The top bar containing various drop targets: Delete/App Info/Uninstall.
diff --git a/src/com/android/launcher3/FastScrollRecyclerView.java b/src/com/android/launcher3/FastScrollRecyclerView.java
index 94903f2..747b755 100644
--- a/src/com/android/launcher3/FastScrollRecyclerView.java
+++ b/src/com/android/launcher3/FastScrollRecyclerView.java
@@ -57,7 +57,9 @@
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
- bindFastScrollbar();
+ if (mScrollbar == null || !mScrollbar.hasRecyclerView()) {
+ bindFastScrollbar();
+ }
}
public void bindFastScrollbar() {
diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java
index 2085b84..9b01734 100644
--- a/src/com/android/launcher3/InvariantDeviceProfile.java
+++ b/src/com/android/launcher3/InvariantDeviceProfile.java
@@ -50,6 +50,7 @@
import com.android.launcher3.model.DeviceGridState;
import com.android.launcher3.provider.RestoreDbTask;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.DisplayController.Info;
import com.android.launcher3.util.IntArray;
@@ -127,6 +128,7 @@
public PointF[] borderSpaces;
public float folderBorderSpace;
public float[] hotseatBorderSpaces;
+ public int inlineNavButtonsEndSpacing;
public float[] horizontalMargin;
@@ -339,6 +341,8 @@
devicePaddingId = closestProfile.devicePaddingId;
this.deviceType = deviceType;
+ inlineNavButtonsEndSpacing = closestProfile.inlineNavButtonsEndSpacing;
+
mExtraAttrs = closestProfile.extraAttrs;
iconSize = displayOption.iconSizes;
@@ -735,6 +739,7 @@
private final int[] hotseatColumnSpan = new int[COUNT_SIZES];
+ private int inlineNavButtonsEndSpacing;
private final String dbFile;
private final int defaultLayoutId;
@@ -785,6 +790,9 @@
R.styleable.GridDisplayOption_hotseatColumnSpanTwoPanelPortrait,
numColumns);
+ inlineNavButtonsEndSpacing =
+ a.getResourceId(R.styleable.GridDisplayOption_inlineNavButtonsEndSpacing,
+ R.dimen.taskbar_button_margin_default);
numFolderRows = a.getInt(
R.styleable.GridDisplayOption_numFolderRows, numRows);
numFolderColumns = a.getInt(
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 528613c..9a9403c 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -60,7 +60,7 @@
import static com.android.launcher3.popup.SystemShortcut.WIDGETS;
import static com.android.launcher3.states.RotationHelper.REQUEST_LOCK;
import static com.android.launcher3.states.RotationHelper.REQUEST_NONE;
-import static com.android.launcher3.testing.TestProtocol.BAD_STATE;
+import static com.android.launcher3.testing.shared.TestProtocol.BAD_STATE;
import static com.android.launcher3.util.ItemInfoMatcher.forFolderMatch;
import android.animation.Animator;
@@ -177,7 +177,7 @@
import com.android.launcher3.statemanager.StatefulActivity;
import com.android.launcher3.states.RotationHelper;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.touch.AllAppsSwipeController;
import com.android.launcher3.touch.ItemClickHandler;
import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper;
@@ -3024,7 +3024,7 @@
mDragLayer.dump(prefix, writer);
mStateManager.dump(prefix, writer);
mPopupDataProvider.dump(prefix, writer);
- mDeviceProfile.dump(this, prefix, writer);
+ mDeviceProfile.dump(prefix, writer);
try {
FileLog.flushAll(writer);
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index de0d300..f790789 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -63,7 +63,7 @@
import com.android.launcher3.pm.PackageInstallInfo;
import com.android.launcher3.pm.UserCache;
import com.android.launcher3.shortcuts.ShortcutRequest;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.IntSet;
import com.android.launcher3.util.ItemInfoMatcher;
import com.android.launcher3.util.PackageUserKey;
diff --git a/src/com/android/launcher3/LauncherState.java b/src/com/android/launcher3/LauncherState.java
index ea6a919..4532ed4 100644
--- a/src/com/android/launcher3/LauncherState.java
+++ b/src/com/android/launcher3/LauncherState.java
@@ -19,16 +19,16 @@
import static com.android.launcher3.anim.Interpolators.DEACCEL_2;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_HOME;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_OVERVIEW;
-import static com.android.launcher3.testing.TestProtocol.ALL_APPS_STATE_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.BACKGROUND_APP_STATE_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.HINT_STATE_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.HINT_STATE_TWO_BUTTON_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.NORMAL_STATE_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.OVERVIEW_MODAL_TASK_STATE_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.OVERVIEW_SPLIT_SELECT_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.OVERVIEW_STATE_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.QUICK_SWITCH_STATE_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.SPRING_LOADED_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.ALL_APPS_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.BACKGROUND_APP_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.HINT_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.HINT_STATE_TWO_BUTTON_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.NORMAL_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.OVERVIEW_MODAL_TASK_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.OVERVIEW_SPLIT_SELECT_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.OVERVIEW_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.QUICK_SWITCH_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.SPRING_LOADED_STATE_ORDINAL;
import android.content.Context;
import android.graphics.Color;
@@ -38,7 +38,7 @@
import com.android.launcher3.statemanager.StateManager;
import com.android.launcher3.states.HintState;
import com.android.launcher3.states.SpringLoadedState;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.uioverrides.states.AllAppsState;
import com.android.launcher3.uioverrides.states.OverviewState;
@@ -208,14 +208,18 @@
return (getVisibleElements(launcher) & elements) == elements;
}
- /** Returns whether taskbar is stashed and thus should replace hotseat with a handle */
+ /**
+ * Returns whether taskbar is stashed and thus should either:
+ * 1) replace hotseat or taskbar icons with a handle in gesture navigation mode or
+ * 2) fade out the hotseat or taskbar icons in 3-button navigation mode.
+ */
public boolean isTaskbarStashed(Launcher launcher) {
return false;
}
/** Returns whether taskbar is aligned with the hotseat vs position inside apps */
public boolean isTaskbarAlignedWithHotseat(Launcher launcher) {
- return !isTaskbarStashed(launcher);
+ return true;
}
/**
diff --git a/src/com/android/launcher3/SessionCommitReceiver.java b/src/com/android/launcher3/SessionCommitReceiver.java
index b81637f..bcd4c3f 100644
--- a/src/com/android/launcher3/SessionCommitReceiver.java
+++ b/src/com/android/launcher3/SessionCommitReceiver.java
@@ -31,7 +31,7 @@
import com.android.launcher3.logging.FileLog;
import com.android.launcher3.model.ItemInstallQueue;
import com.android.launcher3.pm.InstallSessionHelper;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.Executors;
/**
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index e6dea8f..ffb72b3 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -30,7 +30,7 @@
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_HOME;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SWIPELEFT;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SWIPERIGHT;
-import static com.android.launcher3.testing.TestProtocol.BAD_STATE;
+import static com.android.launcher3.testing.shared.TestProtocol.BAD_STATE;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
index a86faab..bdab03f 100644
--- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java
+++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
@@ -232,6 +232,7 @@
// Reset pull back progress and alpha after switching states.
ALL_APPS_PULL_BACK_TRANSLATION.set(this, 0f);
ALL_APPS_PULL_BACK_ALPHA.set(this, 1f);
+ mLauncher.getAppsView().getSearchUiManager().getEditText().hideKeyboard();
});
}
@@ -239,7 +240,6 @@
if (Float.compare(mProgress, targetProgress) == 0) {
setAlphas(toState, config, builder);
// Fail fast
- onProgressAnimationEnd();
return;
}
diff --git a/src/com/android/launcher3/compat/AccessibilityManagerCompat.java b/src/com/android/launcher3/compat/AccessibilityManagerCompat.java
index dd58123..770e931 100644
--- a/src/com/android/launcher3/compat/AccessibilityManagerCompat.java
+++ b/src/com/android/launcher3/compat/AccessibilityManagerCompat.java
@@ -27,7 +27,7 @@
import androidx.annotation.Nullable;
import com.android.launcher3.Utilities;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
public class AccessibilityManagerCompat {
diff --git a/src/com/android/launcher3/dragndrop/DragController.java b/src/com/android/launcher3/dragndrop/DragController.java
index 35cdfef..8616f35 100644
--- a/src/com/android/launcher3/dragndrop/DragController.java
+++ b/src/com/android/launcher3/dragndrop/DragController.java
@@ -34,7 +34,7 @@
import com.android.launcher3.logging.InstanceId;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.TouchController;
import com.android.launcher3.views.ActivityContext;
diff --git a/src/com/android/launcher3/dragndrop/LauncherDragController.java b/src/com/android/launcher3/dragndrop/LauncherDragController.java
index dcbfa50..75f4ad6 100644
--- a/src/com/android/launcher3/dragndrop/LauncherDragController.java
+++ b/src/com/android/launcher3/dragndrop/LauncherDragController.java
@@ -37,7 +37,7 @@
import com.android.launcher3.R;
import com.android.launcher3.accessibility.DragViewStateAnnouncer;
import com.android.launcher3.model.data.ItemInfo;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
/**
* Drag controller for Launcher activity
diff --git a/src/com/android/launcher3/graphics/SysUiScrim.java b/src/com/android/launcher3/graphics/SysUiScrim.java
index f0766c5..185b8d3 100644
--- a/src/com/android/launcher3/graphics/SysUiScrim.java
+++ b/src/com/android/launcher3/graphics/SysUiScrim.java
@@ -43,7 +43,7 @@
import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.R;
-import com.android.launcher3.ResourceUtils;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.Utilities;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.util.DynamicResource;
diff --git a/src/com/android/launcher3/model/AddWorkspaceItemsTask.java b/src/com/android/launcher3/model/AddWorkspaceItemsTask.java
index 31ef2e5..4c0f1ae 100644
--- a/src/com/android/launcher3/model/AddWorkspaceItemsTask.java
+++ b/src/com/android/launcher3/model/AddWorkspaceItemsTask.java
@@ -36,7 +36,7 @@
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.pm.InstallSessionHelper;
import com.android.launcher3.pm.PackageInstallInfo;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.PackageManagerHelper;
diff --git a/src/com/android/launcher3/model/BaseLoaderResults.java b/src/com/android/launcher3/model/BaseLoaderResults.java
index b50ab58..8c6428b 100644
--- a/src/com/android/launcher3/model/BaseLoaderResults.java
+++ b/src/com/android/launcher3/model/BaseLoaderResults.java
@@ -33,7 +33,7 @@
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.LauncherAppWidgetInfo;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.IntSet;
import com.android.launcher3.util.LooperExecutor;
diff --git a/src/com/android/launcher3/model/ItemInstallQueue.java b/src/com/android/launcher3/model/ItemInstallQueue.java
index 5a220f7..229bb2d 100644
--- a/src/com/android/launcher3/model/ItemInstallQueue.java
+++ b/src/com/android/launcher3/model/ItemInstallQueue.java
@@ -49,7 +49,7 @@
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.shortcuts.ShortcutKey;
import com.android.launcher3.shortcuts.ShortcutRequest;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.MainThreadInitializedObject;
import com.android.launcher3.util.PersistedItemArray;
import com.android.launcher3.util.Preconditions;
diff --git a/src/com/android/launcher3/model/LoaderCursor.java b/src/com/android/launcher3/model/LoaderCursor.java
index ae5b66a..87e8ebf 100644
--- a/src/com/android/launcher3/model/LoaderCursor.java
+++ b/src/com/android/launcher3/model/LoaderCursor.java
@@ -291,12 +291,16 @@
// from the db
if (TextUtils.isEmpty(info.title)) {
- info.title = getTitle();
- }
+ if (loadIcon) {
+ info.title = getTitle();
- // fall back to the class name of the activity
- if (info.title == null) {
- info.title = componentName.getClassName();
+ // fall back to the class name of the activity
+ if (info.title == null) {
+ info.title = componentName.getClassName();
+ }
+ } else {
+ info.title = "";
+ }
}
info.contentDescription = mPM.getUserBadgedLabel(info.title, info.user);
diff --git a/src/com/android/launcher3/model/ModelUtils.java b/src/com/android/launcher3/model/ModelUtils.java
index 422af43..1ced0b1 100644
--- a/src/com/android/launcher3/model/ModelUtils.java
+++ b/src/com/android/launcher3/model/ModelUtils.java
@@ -29,7 +29,7 @@
import com.android.launcher3.icons.LauncherIcons;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.IntSet;
diff --git a/src/com/android/launcher3/pm/InstallSessionHelper.java b/src/com/android/launcher3/pm/InstallSessionHelper.java
index 618f926..9da6670 100644
--- a/src/com/android/launcher3/pm/InstallSessionHelper.java
+++ b/src/com/android/launcher3/pm/InstallSessionHelper.java
@@ -39,7 +39,7 @@
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.logging.FileLog;
import com.android.launcher3.model.ItemInstallQueue;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.IntSet;
import com.android.launcher3.util.MainThreadInitializedObject;
diff --git a/src/com/android/launcher3/pm/InstallSessionTracker.java b/src/com/android/launcher3/pm/InstallSessionTracker.java
index 75cf7a8..b16aaa2 100644
--- a/src/com/android/launcher3/pm/InstallSessionTracker.java
+++ b/src/com/android/launcher3/pm/InstallSessionTracker.java
@@ -30,7 +30,7 @@
import androidx.annotation.WorkerThread;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.PackageUserKey;
import java.lang.ref.WeakReference;
diff --git a/src/com/android/launcher3/testing/TestInformationHandler.java b/src/com/android/launcher3/testing/TestInformationHandler.java
index 0334b96..d3c9bc9 100644
--- a/src/com/android/launcher3/testing/TestInformationHandler.java
+++ b/src/com/android/launcher3/testing/TestInformationHandler.java
@@ -41,6 +41,9 @@
import com.android.launcher3.R;
import com.android.launcher3.Workspace;
import com.android.launcher3.dragndrop.DragLayer;
+import com.android.launcher3.testing.shared.HotseatCellCenterRequest;
+import com.android.launcher3.testing.shared.TestProtocol;
+import com.android.launcher3.testing.shared.WorkspaceCellCenterRequest;
import com.android.launcher3.util.ResourceBasedOverride;
import com.android.launcher3.widget.picker.WidgetsFullSheet;
diff --git a/src/com/android/launcher3/testing/TestLogging.java b/src/com/android/launcher3/testing/TestLogging.java
index 103b565..c151606 100644
--- a/src/com/android/launcher3/testing/TestLogging.java
+++ b/src/com/android/launcher3/testing/TestLogging.java
@@ -22,6 +22,7 @@
import android.view.MotionEvent;
import com.android.launcher3.Utilities;
+import com.android.launcher3.testing.shared.TestProtocol;
import java.util.function.BiConsumer;
diff --git a/src/com/android/launcher3/testing/HotseatCellCenterRequest.java b/src/com/android/launcher3/testing/shared/HotseatCellCenterRequest.java
similarity index 98%
rename from src/com/android/launcher3/testing/HotseatCellCenterRequest.java
rename to src/com/android/launcher3/testing/shared/HotseatCellCenterRequest.java
index cbb847e..7eb035a 100644
--- a/src/com/android/launcher3/testing/HotseatCellCenterRequest.java
+++ b/src/com/android/launcher3/testing/shared/HotseatCellCenterRequest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher3.testing;
+package com.android.launcher3.testing.shared;
import android.os.Parcel;
import android.os.Parcelable;
diff --git a/src/com/android/launcher3/ResourceUtils.java b/src/com/android/launcher3/testing/shared/ResourceUtils.java
similarity index 98%
rename from src/com/android/launcher3/ResourceUtils.java
rename to src/com/android/launcher3/testing/shared/ResourceUtils.java
index f709aca..af462cc 100644
--- a/src/com/android/launcher3/ResourceUtils.java
+++ b/src/com/android/launcher3/testing/shared/ResourceUtils.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher3;
+package com.android.launcher3.testing.shared;
import android.content.res.Resources;
import android.util.DisplayMetrics;
diff --git a/src/com/android/launcher3/testing/TestInformationRequest.java b/src/com/android/launcher3/testing/shared/TestInformationRequest.java
similarity index 94%
rename from src/com/android/launcher3/testing/TestInformationRequest.java
rename to src/com/android/launcher3/testing/shared/TestInformationRequest.java
index 272ae56..38282032 100644
--- a/src/com/android/launcher3/testing/TestInformationRequest.java
+++ b/src/com/android/launcher3/testing/shared/TestInformationRequest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher3.testing;
+package com.android.launcher3.testing.shared;
import android.os.Parcelable;
diff --git a/src/com/android/launcher3/testing/TestProtocol.java b/src/com/android/launcher3/testing/shared/TestProtocol.java
similarity index 99%
rename from src/com/android/launcher3/testing/TestProtocol.java
rename to src/com/android/launcher3/testing/shared/TestProtocol.java
index 9bc9067..d872476 100644
--- a/src/com/android/launcher3/testing/TestProtocol.java
+++ b/src/com/android/launcher3/testing/shared/TestProtocol.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher3.testing;
+package com.android.launcher3.testing.shared;
/**
* Protocol for custom accessibility events for communication with UI Automation tests.
diff --git a/src/com/android/launcher3/testing/WorkspaceCellCenterRequest.java b/src/com/android/launcher3/testing/shared/WorkspaceCellCenterRequest.java
similarity index 98%
rename from src/com/android/launcher3/testing/WorkspaceCellCenterRequest.java
rename to src/com/android/launcher3/testing/shared/WorkspaceCellCenterRequest.java
index 71ab09f..80dbef8 100644
--- a/src/com/android/launcher3/testing/WorkspaceCellCenterRequest.java
+++ b/src/com/android/launcher3/testing/shared/WorkspaceCellCenterRequest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.launcher3.testing;
+package com.android.launcher3.testing.shared;
import android.os.Parcel;
import android.os.Parcelable;
diff --git a/src/com/android/launcher3/touch/ItemClickHandler.java b/src/com/android/launcher3/touch/ItemClickHandler.java
index e95a787..5fa30bc 100644
--- a/src/com/android/launcher3/touch/ItemClickHandler.java
+++ b/src/com/android/launcher3/touch/ItemClickHandler.java
@@ -61,7 +61,7 @@
import com.android.launcher3.pm.InstallSessionHelper;
import com.android.launcher3.shortcuts.ShortcutKey;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.ItemInfoMatcher;
import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.views.FloatingIconView;
diff --git a/src/com/android/launcher3/touch/ItemLongClickListener.java b/src/com/android/launcher3/touch/ItemLongClickListener.java
index 53cd416..73f994f 100644
--- a/src/com/android/launcher3/touch/ItemLongClickListener.java
+++ b/src/com/android/launcher3/touch/ItemLongClickListener.java
@@ -36,7 +36,7 @@
import com.android.launcher3.logging.StatsLogManager.StatsLogger;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.views.BubbleTextHolder;
import com.android.launcher3.widget.LauncherAppWidgetHostView;
diff --git a/src/com/android/launcher3/touch/WorkspaceTouchListener.java b/src/com/android/launcher3/touch/WorkspaceTouchListener.java
index 17bbdf1..6cb021b 100644
--- a/src/com/android/launcher3/touch/WorkspaceTouchListener.java
+++ b/src/com/android/launcher3/touch/WorkspaceTouchListener.java
@@ -43,7 +43,7 @@
import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.logger.LauncherAtom;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
/**
* Helper class to handle touch on empty space in workspace and show options popup on long press
diff --git a/src/com/android/launcher3/util/DisplayController.java b/src/com/android/launcher3/util/DisplayController.java
index 15fe1d9..30e7469 100644
--- a/src/com/android/launcher3/util/DisplayController.java
+++ b/src/com/android/launcher3/util/DisplayController.java
@@ -19,7 +19,7 @@
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
-import static com.android.launcher3.ResourceUtils.INVALID_RESOURCE_HANDLE;
+import static com.android.launcher3.testing.shared.ResourceUtils.INVALID_RESOURCE_HANDLE;
import static com.android.launcher3.Utilities.dpiFromPx;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NAVIGATION_MODE_2_BUTTON;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NAVIGATION_MODE_3_BUTTON;
@@ -46,7 +46,7 @@
import androidx.annotation.AnyThread;
import androidx.annotation.UiThread;
-import com.android.launcher3.ResourceUtils;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.Utilities;
import com.android.launcher3.logging.StatsLogManager.LauncherEvent;
import com.android.launcher3.util.window.CachedDisplayInfo;
diff --git a/src/com/android/launcher3/util/MultiValueAlpha.java b/src/com/android/launcher3/util/MultiValueAlpha.java
index 11cd07c..4b46a0a 100644
--- a/src/com/android/launcher3/util/MultiValueAlpha.java
+++ b/src/com/android/launcher3/util/MultiValueAlpha.java
@@ -23,6 +23,7 @@
import com.android.launcher3.anim.AlphaUpdateListener;
+import java.io.PrintWriter;
import java.util.Arrays;
import java.util.function.Consumer;
@@ -78,6 +79,29 @@
mUpdateVisibility = updateVisibility;
}
+ /**
+ * Dumps the alpha channel values to the given PrintWriter
+ *
+ * @param prefix String to be used before every line
+ * @param pw PrintWriter where the logs should be dumped
+ * @param label String used to help identify this object
+ * @param alphaIndexLabels Strings that represent each alpha channel, these should be entered
+ * in the order of the indexes they represent, starting from 0.
+ */
+ public void dump(String prefix, PrintWriter pw, String label, String... alphaIndexLabels) {
+ pw.println(prefix + label);
+
+ String innerPrefix = prefix + '\t';
+ for (int i = 0; i < alphaIndexLabels.length; i++) {
+ if (i >= mMyProperties.length) {
+ pw.println(innerPrefix + alphaIndexLabels[i] + " given for alpha index " + i
+ + " however there are only " + mMyProperties.length + " alpha channels.");
+ continue;
+ }
+ pw.println(innerPrefix + alphaIndexLabels[i] + "=" + getProperty(i).getValue());
+ }
+ }
+
public class AlphaProperty {
private final int mMyMask;
diff --git a/src/com/android/launcher3/util/window/WindowManagerProxy.java b/src/com/android/launcher3/util/window/WindowManagerProxy.java
index d5a065a..582ff8d 100644
--- a/src/com/android/launcher3/util/window/WindowManagerProxy.java
+++ b/src/com/android/launcher3/util/window/WindowManagerProxy.java
@@ -17,13 +17,13 @@
import static android.view.Display.DEFAULT_DISPLAY;
-import static com.android.launcher3.ResourceUtils.INVALID_RESOURCE_HANDLE;
-import static com.android.launcher3.ResourceUtils.NAVBAR_HEIGHT;
-import static com.android.launcher3.ResourceUtils.NAVBAR_HEIGHT_LANDSCAPE;
-import static com.android.launcher3.ResourceUtils.NAVBAR_LANDSCAPE_LEFT_RIGHT_SIZE;
-import static com.android.launcher3.ResourceUtils.STATUS_BAR_HEIGHT;
-import static com.android.launcher3.ResourceUtils.STATUS_BAR_HEIGHT_LANDSCAPE;
-import static com.android.launcher3.ResourceUtils.STATUS_BAR_HEIGHT_PORTRAIT;
+import static com.android.launcher3.testing.shared.ResourceUtils.INVALID_RESOURCE_HANDLE;
+import static com.android.launcher3.testing.shared.ResourceUtils.NAVBAR_HEIGHT;
+import static com.android.launcher3.testing.shared.ResourceUtils.NAVBAR_HEIGHT_LANDSCAPE;
+import static com.android.launcher3.testing.shared.ResourceUtils.NAVBAR_LANDSCAPE_LEFT_RIGHT_SIZE;
+import static com.android.launcher3.testing.shared.ResourceUtils.STATUS_BAR_HEIGHT;
+import static com.android.launcher3.testing.shared.ResourceUtils.STATUS_BAR_HEIGHT_LANDSCAPE;
+import static com.android.launcher3.testing.shared.ResourceUtils.STATUS_BAR_HEIGHT_PORTRAIT;
import static com.android.launcher3.Utilities.dpiFromPx;
import static com.android.launcher3.util.MainThreadInitializedObject.forOverride;
import static com.android.launcher3.util.RotationUtils.deltaRotation;
@@ -48,7 +48,7 @@
import android.view.WindowMetrics;
import com.android.launcher3.R;
-import com.android.launcher3.ResourceUtils;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.Utilities;
import com.android.launcher3.util.MainThreadInitializedObject;
import com.android.launcher3.util.ResourceBasedOverride;
diff --git a/src/com/android/launcher3/views/OptionsPopupView.java b/src/com/android/launcher3/views/OptionsPopupView.java
index 2a9a8a5..d301925 100644
--- a/src/com/android/launcher3/views/OptionsPopupView.java
+++ b/src/com/android/launcher3/views/OptionsPopupView.java
@@ -50,7 +50,7 @@
import com.android.launcher3.popup.ArrowPopup;
import com.android.launcher3.shortcuts.DeepShortcutView;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.widget.picker.WidgetsFullSheet;
import java.util.ArrayList;
diff --git a/src/com/android/launcher3/views/RecyclerViewFastScroller.java b/src/com/android/launcher3/views/RecyclerViewFastScroller.java
index 11ca130..6e6512d 100644
--- a/src/com/android/launcher3/views/RecyclerViewFastScroller.java
+++ b/src/com/android/launcher3/views/RecyclerViewFastScroller.java
@@ -174,6 +174,11 @@
ta.recycle();
}
+ /** @return whether there is a RecyclerView bound to this scroller. */
+ public boolean hasRecyclerView() {
+ return mRv != null;
+ }
+
public void setRecyclerView(FastScrollRecyclerView rv, TextView popupView) {
if (mRv != null && mOnScrollListener != null) {
mRv.removeOnScrollListener(mOnScrollListener);
diff --git a/src/com/android/launcher3/widget/BaseWidgetSheet.java b/src/com/android/launcher3/widget/BaseWidgetSheet.java
index 8962c4f..5cffd48 100644
--- a/src/com/android/launcher3/widget/BaseWidgetSheet.java
+++ b/src/com/android/launcher3/widget/BaseWidgetSheet.java
@@ -42,7 +42,7 @@
import com.android.launcher3.dragndrop.DragOptions;
import com.android.launcher3.popup.PopupDataProvider;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.touch.ItemLongClickListener;
import com.android.launcher3.util.SystemUiController;
import com.android.launcher3.util.Themes;
diff --git a/src/com/android/launcher3/widget/LauncherAppWidgetHost.java b/src/com/android/launcher3/widget/LauncherAppWidgetHost.java
index 98a960c..5ce8fcf 100644
--- a/src/com/android/launcher3/widget/LauncherAppWidgetHost.java
+++ b/src/com/android/launcher3/widget/LauncherAppWidgetHost.java
@@ -42,7 +42,7 @@
import com.android.launcher3.model.WidgetsModel;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.testing.TestLogging;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.widget.custom.CustomWidgetManager;
import java.util.ArrayList;
diff --git a/src/com/android/launcher3/widget/PendingItemDragHelper.java b/src/com/android/launcher3/widget/PendingItemDragHelper.java
index 46c0b99..c8d528b 100644
--- a/src/com/android/launcher3/widget/PendingItemDragHelper.java
+++ b/src/com/android/launcher3/widget/PendingItemDragHelper.java
@@ -42,7 +42,7 @@
import com.android.launcher3.icons.FastBitmapDrawable;
import com.android.launcher3.icons.LauncherIcons;
import com.android.launcher3.icons.RoundDrawableWrapper;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.widget.dragndrop.AppWidgetHostViewDragListener;
import com.android.launcher3.widget.util.WidgetSizes;
diff --git a/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java b/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java
index 88d9723..0d9198f 100644
--- a/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java
+++ b/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java
@@ -19,7 +19,7 @@
import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_Y;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_WIDGETSTRAY_SEARCHED;
-import static com.android.launcher3.testing.TestProtocol.NORMAL_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.NORMAL_STATE_ORDINAL;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
diff --git a/src_ui_overrides/com/android/launcher3/uioverrides/ApiWrapper.java b/src_ui_overrides/com/android/launcher3/uioverrides/ApiWrapper.java
index 6715749..c8b5e2f 100644
--- a/src_ui_overrides/com/android/launcher3/uioverrides/ApiWrapper.java
+++ b/src_ui_overrides/com/android/launcher3/uioverrides/ApiWrapper.java
@@ -17,7 +17,6 @@
package com.android.launcher3.uioverrides;
import android.app.Person;
-import android.content.Context;
import android.content.pm.ShortcutInfo;
import com.android.launcher3.Utilities;
@@ -29,11 +28,4 @@
public static Person[] getPersons(ShortcutInfo si) {
return Utilities.EMPTY_PERSON_ARRAY;
}
-
- /**
- * Returns the minimum space that should be left empty at the end of hotseat
- */
- public static int getHotseatEndOffset(Context context) {
- return 0;
- }
}
diff --git a/tests/src/com/android/launcher3/DeviceProfileBaseTest.kt b/tests/src/com/android/launcher3/DeviceProfileBaseTest.kt
index ba813c0..7465db5 100644
--- a/tests/src/com/android/launcher3/DeviceProfileBaseTest.kt
+++ b/tests/src/com/android/launcher3/DeviceProfileBaseTest.kt
@@ -37,7 +37,6 @@
protected var transposeLayoutWithOrientation: Boolean = false
protected var useTwoPanels: Boolean = false
protected var isGestureMode: Boolean = true
- protected var isRecentsRtl: Boolean = true
@Before
fun setUp() {
@@ -136,6 +135,7 @@
hotseatBorderSpaces = FloatArray(4) { 16f }
hotseatColumnSpan = IntArray(4) { 4 }
hotseatBarBottomSpace = FloatArray(4) { 48f }
+ inlineNavButtonsEndSpacing = R.dimen.taskbar_button_margin_4_4
hotseatQsbSpace = FloatArray(4) { 36f }
iconSize = FloatArray(4) { 56f }
allAppsIconSize = FloatArray(4) { 56f }
@@ -164,7 +164,7 @@
fun dump(dp: DeviceProfile): StringWriter {
val stringWriter = StringWriter()
val printWriter = PrintWriter(stringWriter)
- dp.dump(context, "", printWriter)
+ dp.dump("", printWriter)
printWriter.flush()
return stringWriter
}
diff --git a/tests/src/com/android/launcher3/deviceemulator/models/DeviceEmulationData.java b/tests/src/com/android/launcher3/deviceemulator/models/DeviceEmulationData.java
index 8d275cc..55b7bf1 100644
--- a/tests/src/com/android/launcher3/deviceemulator/models/DeviceEmulationData.java
+++ b/tests/src/com/android/launcher3/deviceemulator/models/DeviceEmulationData.java
@@ -17,10 +17,10 @@
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
-import static com.android.launcher3.ResourceUtils.NAVBAR_HEIGHT;
-import static com.android.launcher3.ResourceUtils.NAVBAR_HEIGHT_LANDSCAPE;
-import static com.android.launcher3.ResourceUtils.NAVBAR_LANDSCAPE_LEFT_RIGHT_SIZE;
-import static com.android.launcher3.ResourceUtils.getDimenByName;
+import static com.android.launcher3.testing.shared.ResourceUtils.NAVBAR_HEIGHT;
+import static com.android.launcher3.testing.shared.ResourceUtils.NAVBAR_HEIGHT_LANDSCAPE;
+import static com.android.launcher3.testing.shared.ResourceUtils.NAVBAR_LANDSCAPE_LEFT_RIGHT_SIZE;
+import static com.android.launcher3.testing.shared.ResourceUtils.getDimenByName;
import android.content.Context;
import android.content.res.Resources;
diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
index 1f6e1ec..304153f 100644
--- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
+++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
@@ -61,7 +61,7 @@
import com.android.launcher3.tapl.LauncherInstrumentation.ContainerType;
import com.android.launcher3.tapl.TestHelpers;
import com.android.launcher3.testcomponent.TestCommandReceiver;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.util.LooperExecutor;
import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.util.Wait;
diff --git a/tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java b/tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java
index 8f2d528..266f0ae 100644
--- a/tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java
+++ b/tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java
@@ -4,7 +4,6 @@
import android.view.Surface;
import com.android.launcher3.tapl.TestHelpers;
-import com.android.launcher3.testing.TestProtocol;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
diff --git a/tests/tapl/com/android/launcher3/tapl/AllApps.java b/tests/tapl/com/android/launcher3/tapl/AllApps.java
index bfb115d..4791846 100644
--- a/tests/tapl/com/android/launcher3/tapl/AllApps.java
+++ b/tests/tapl/com/android/launcher3/tapl/AllApps.java
@@ -29,7 +29,7 @@
import androidx.test.uiautomator.StaleObjectException;
import androidx.test.uiautomator.UiObject2;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import java.util.stream.Collectors;
diff --git a/tests/tapl/com/android/launcher3/tapl/AppIcon.java b/tests/tapl/com/android/launcher3/tapl/AppIcon.java
index e28f0af..d221259 100644
--- a/tests/tapl/com/android/launcher3/tapl/AppIcon.java
+++ b/tests/tapl/com/android/launcher3/tapl/AppIcon.java
@@ -22,7 +22,7 @@
import androidx.test.uiautomator.BySelector;
import androidx.test.uiautomator.UiObject2;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import java.util.regex.Pattern;
diff --git a/tests/tapl/com/android/launcher3/tapl/AppIconMenuItem.java b/tests/tapl/com/android/launcher3/tapl/AppIconMenuItem.java
index 5cf5aba..284168b 100644
--- a/tests/tapl/com/android/launcher3/tapl/AppIconMenuItem.java
+++ b/tests/tapl/com/android/launcher3/tapl/AppIconMenuItem.java
@@ -18,7 +18,7 @@
import androidx.test.uiautomator.UiObject2;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
/**
* Menu item in an app icon menu.
diff --git a/tests/tapl/com/android/launcher3/tapl/Background.java b/tests/tapl/com/android/launcher3/tapl/Background.java
index 589e13c..eb8d055 100644
--- a/tests/tapl/com/android/launcher3/tapl/Background.java
+++ b/tests/tapl/com/android/launcher3/tapl/Background.java
@@ -19,7 +19,7 @@
import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED;
import static com.android.launcher3.tapl.OverviewTask.TASK_START_EVENT;
-import static com.android.launcher3.testing.TestProtocol.OVERVIEW_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.OVERVIEW_STATE_ORDINAL;
import android.graphics.Point;
import android.os.SystemClock;
@@ -28,7 +28,7 @@
import androidx.annotation.NonNull;
import androidx.test.uiautomator.UiObject2;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import java.util.List;
import java.util.regex.Pattern;
diff --git a/tests/tapl/com/android/launcher3/tapl/FolderIcon.java b/tests/tapl/com/android/launcher3/tapl/FolderIcon.java
index 9b4717f..0c453bd 100644
--- a/tests/tapl/com/android/launcher3/tapl/FolderIcon.java
+++ b/tests/tapl/com/android/launcher3/tapl/FolderIcon.java
@@ -21,7 +21,7 @@
import androidx.annotation.NonNull;
import androidx.test.uiautomator.UiObject2;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
/**
* Folder Icon, an app folder in workspace.
diff --git a/tests/tapl/com/android/launcher3/tapl/Launchable.java b/tests/tapl/com/android/launcher3/tapl/Launchable.java
index 33fea2d..3dcb437 100644
--- a/tests/tapl/com/android/launcher3/tapl/Launchable.java
+++ b/tests/tapl/com/android/launcher3/tapl/Launchable.java
@@ -16,7 +16,7 @@
package com.android.launcher3.tapl;
-import static com.android.launcher3.testing.TestProtocol.SPRING_LOADED_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.SPRING_LOADED_STATE_ORDINAL;
import android.graphics.Point;
import android.view.MotionEvent;
@@ -26,7 +26,7 @@
import androidx.test.uiautomator.UiObject2;
import androidx.test.uiautomator.Until;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
/**
* Ancestor for AppIcon and AppMenuItem.
diff --git a/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java b/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java
index 046d36b..04167839 100644
--- a/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java
+++ b/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java
@@ -16,9 +16,9 @@
package com.android.launcher3.tapl;
-import static com.android.launcher3.testing.TestProtocol.REQUEST_DISABLE_MANUAL_TASKBAR_STASHING;
-import static com.android.launcher3.testing.TestProtocol.REQUEST_ENABLE_MANUAL_TASKBAR_STASHING;
-import static com.android.launcher3.testing.TestProtocol.REQUEST_STASHED_TASKBAR_HEIGHT;
+import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_DISABLE_MANUAL_TASKBAR_STASHING;
+import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_ENABLE_MANUAL_TASKBAR_STASHING;
+import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_STASHED_TASKBAR_HEIGHT;
import android.graphics.Point;
import android.graphics.Rect;
@@ -27,7 +27,7 @@
import androidx.test.uiautomator.By;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
/**
* Background state operations specific to when an app has been launched.
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index 5f92097..caaeef8 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -23,7 +23,7 @@
import static com.android.launcher3.tapl.Folder.FOLDER_CONTENT_RES_ID;
import static com.android.launcher3.tapl.TestHelpers.getOverviewPackageName;
-import static com.android.launcher3.testing.TestProtocol.NORMAL_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.NORMAL_STATE_ORDINAL;
import android.app.ActivityManager;
import android.app.Instrumentation;
@@ -65,9 +65,9 @@
import androidx.test.uiautomator.UiObject2;
import androidx.test.uiautomator.Until;
-import com.android.launcher3.ResourceUtils;
-import com.android.launcher3.testing.TestInformationRequest;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.ResourceUtils;
+import com.android.launcher3.testing.shared.TestInformationRequest;
+import com.android.launcher3.testing.shared.TestProtocol;
import com.android.systemui.shared.system.ContextUtils;
import com.android.systemui.shared.system.QuickStepContract;
diff --git a/tests/tapl/com/android/launcher3/tapl/LogEventChecker.java b/tests/tapl/com/android/launcher3/tapl/LogEventChecker.java
index 710e3cd..672c6e0 100644
--- a/tests/tapl/com/android/launcher3/tapl/LogEventChecker.java
+++ b/tests/tapl/com/android/launcher3/tapl/LogEventChecker.java
@@ -15,13 +15,13 @@
*/
package com.android.launcher3.tapl;
-import static com.android.launcher3.testing.TestProtocol.SEQUENCE_MAIN;
-import static com.android.launcher3.testing.TestProtocol.SEQUENCE_PILFER;
-import static com.android.launcher3.testing.TestProtocol.SEQUENCE_TIS;
+import static com.android.launcher3.testing.shared.TestProtocol.SEQUENCE_MAIN;
+import static com.android.launcher3.testing.shared.TestProtocol.SEQUENCE_PILFER;
+import static com.android.launcher3.testing.shared.TestProtocol.SEQUENCE_TIS;
import android.os.SystemClock;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import java.util.ArrayList;
import java.util.HashMap;
diff --git a/tests/tapl/com/android/launcher3/tapl/OverviewActions.java b/tests/tapl/com/android/launcher3/tapl/OverviewActions.java
index 5710713..386deac 100644
--- a/tests/tapl/com/android/launcher3/tapl/OverviewActions.java
+++ b/tests/tapl/com/android/launcher3/tapl/OverviewActions.java
@@ -19,7 +19,7 @@
import androidx.annotation.NonNull;
import androidx.test.uiautomator.UiObject2;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
/**
* View containing overview actions
diff --git a/tests/tapl/com/android/launcher3/tapl/OverviewTask.java b/tests/tapl/com/android/launcher3/tapl/OverviewTask.java
index ac7424e..72a39df 100644
--- a/tests/tapl/com/android/launcher3/tapl/OverviewTask.java
+++ b/tests/tapl/com/android/launcher3/tapl/OverviewTask.java
@@ -24,7 +24,7 @@
import androidx.test.uiautomator.BySelector;
import androidx.test.uiautomator.UiObject2;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import java.util.List;
import java.util.regex.Pattern;
diff --git a/tests/tapl/com/android/launcher3/tapl/Taskbar.java b/tests/tapl/com/android/launcher3/tapl/Taskbar.java
index b5a08c3..5d9be36 100644
--- a/tests/tapl/com/android/launcher3/tapl/Taskbar.java
+++ b/tests/tapl/com/android/launcher3/tapl/Taskbar.java
@@ -15,8 +15,8 @@
*/
package com.android.launcher3.tapl;
-import static com.android.launcher3.testing.TestProtocol.REQUEST_DISABLE_MANUAL_TASKBAR_STASHING;
-import static com.android.launcher3.testing.TestProtocol.REQUEST_ENABLE_MANUAL_TASKBAR_STASHING;
+import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_DISABLE_MANUAL_TASKBAR_STASHING;
+import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_ENABLE_MANUAL_TASKBAR_STASHING;
import android.graphics.Point;
import android.os.SystemClock;
diff --git a/tests/tapl/com/android/launcher3/tapl/TaskbarAppIconMenuItem.java b/tests/tapl/com/android/launcher3/tapl/TaskbarAppIconMenuItem.java
index 69a8a08..424c58e 100644
--- a/tests/tapl/com/android/launcher3/tapl/TaskbarAppIconMenuItem.java
+++ b/tests/tapl/com/android/launcher3/tapl/TaskbarAppIconMenuItem.java
@@ -17,7 +17,7 @@
import androidx.test.uiautomator.UiObject2;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import java.util.regex.Pattern;
diff --git a/tests/tapl/com/android/launcher3/tapl/Widget.java b/tests/tapl/com/android/launcher3/tapl/Widget.java
index e1a09af..29eb46c 100644
--- a/tests/tapl/com/android/launcher3/tapl/Widget.java
+++ b/tests/tapl/com/android/launcher3/tapl/Widget.java
@@ -23,7 +23,7 @@
import androidx.test.uiautomator.UiObject2;
import androidx.test.uiautomator.Until;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import java.util.regex.Pattern;
diff --git a/tests/tapl/com/android/launcher3/tapl/Widgets.java b/tests/tapl/com/android/launcher3/tapl/Widgets.java
index 7fd68c0..96e2e3f 100644
--- a/tests/tapl/com/android/launcher3/tapl/Widgets.java
+++ b/tests/tapl/com/android/launcher3/tapl/Widgets.java
@@ -27,7 +27,7 @@
import androidx.test.uiautomator.UiObject2;
import androidx.test.uiautomator.Until;
-import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.testing.shared.TestProtocol;
import java.util.Collection;
diff --git a/tests/tapl/com/android/launcher3/tapl/Workspace.java b/tests/tapl/com/android/launcher3/tapl/Workspace.java
index 6044b06..efbdb23 100644
--- a/tests/tapl/com/android/launcher3/tapl/Workspace.java
+++ b/tests/tapl/com/android/launcher3/tapl/Workspace.java
@@ -18,8 +18,8 @@
import static android.view.accessibility.AccessibilityEvent.TYPE_VIEW_SCROLLED;
-import static com.android.launcher3.testing.TestProtocol.ALL_APPS_STATE_ORDINAL;
-import static com.android.launcher3.testing.TestProtocol.NORMAL_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.ALL_APPS_STATE_ORDINAL;
+import static com.android.launcher3.testing.shared.TestProtocol.NORMAL_STATE_ORDINAL;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertTrue;
@@ -39,9 +39,9 @@
import androidx.test.uiautomator.UiObject2;
import androidx.test.uiautomator.Until;
-import com.android.launcher3.testing.HotseatCellCenterRequest;
-import com.android.launcher3.testing.TestProtocol;
-import com.android.launcher3.testing.WorkspaceCellCenterRequest;
+import com.android.launcher3.testing.shared.HotseatCellCenterRequest;
+import com.android.launcher3.testing.shared.TestProtocol;
+import com.android.launcher3.testing.shared.WorkspaceCellCenterRequest;
import java.util.List;
import java.util.Map;