Merge "Add logging to help debug additional app infos being updated by CacheDataUpdatedTask" into tm-qpr-dev
diff --git a/quickstep/res/values-sw600dp/dimens.xml b/quickstep/res/values-sw600dp/dimens.xml
index 7494683..cfbbf8d 100644
--- a/quickstep/res/values-sw600dp/dimens.xml
+++ b/quickstep/res/values-sw600dp/dimens.xml
@@ -14,16 +14,23 @@
* limitations under the License.
*/
-->
+<!-- Applies to small tablet screens -->
<resources>
<dimen name="navigation_key_padding">25dp</dimen>
- <!-- Task View -->
+ <!-- Overview Task Views -->
+ <!-- A touch target for icons, sometimes slightly larger than the icons themselves -->
<dimen name="task_thumbnail_icon_size">48dp</dimen>
+ <!-- The icon size for the focused task, placed in center of touch target -->
<dimen name="task_thumbnail_icon_drawable_size">44dp</dimen>
+ <!-- The space under the focused task icon -->
<dimen name="overview_task_margin">12dp</dimen>
+ <!-- The icon size of all non-focused task icons, placed in center of touch target -->
<dimen name="task_thumbnail_icon_drawable_size_grid">44dp</dimen>
- <dimen name="overview_task_margin_grid">12dp</dimen>
+ <!-- The space between grid rows (when there's 2 rows of thumbnails) -->
<dimen name="overview_grid_row_spacing">28dp</dimen>
+ <!-- The horizontal space between tasks -->
<dimen name="overview_page_spacing">36dp</dimen>
+ <!-- The space to the left and to the right of the "Clear all" button -->
<dimen name="overview_grid_side_margin">64dp</dimen>
</resources>
diff --git a/quickstep/res/values-sw720dp/dimens.xml b/quickstep/res/values-sw720dp/dimens.xml
index ceaa8f8..284ce11 100644
--- a/quickstep/res/values-sw720dp/dimens.xml
+++ b/quickstep/res/values-sw720dp/dimens.xml
@@ -14,14 +14,23 @@
* limitations under the License.
*/
-->
+<!-- Applies to large tablet screens -->
<resources>
- <!-- Task View -->
+ <!-- Overview Task Views -->
+ <!-- The primary task thumbnail uses up to this much of the total screen height/width -->
+ <item name="overview_max_scale" format="float" type="dimen">0.7</item>
+ <!-- A touch target for icons, sometimes slightly larger than the icons themselves -->
<dimen name="task_thumbnail_icon_size">48dp</dimen>
+ <!-- The icon size for the focused task, placed in center of touch target -->
<dimen name="task_thumbnail_icon_drawable_size">44dp</dimen>
+ <!-- The space under the focused task icon -->
<dimen name="overview_task_margin">16dp</dimen>
+ <!-- The icon size of all non-focused task icons, placed in center of touch target -->
<dimen name="task_thumbnail_icon_drawable_size_grid">44dp</dimen>
- <dimen name="overview_task_margin_grid">16dp</dimen>
+ <!-- The space between grid rows (when there's 2 rows of thumbnails) -->
<dimen name="overview_grid_row_spacing">36dp</dimen>
+ <!-- The horizontal space between tasks -->
<dimen name="overview_page_spacing">44dp</dimen>
+ <!-- The space to the left and to the right of the "Clear all" button -->
<dimen name="overview_grid_side_margin">64dp</dimen>
</resources>
diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml
index 0232f86..35215e1 100644
--- a/quickstep/res/values/dimens.xml
+++ b/quickstep/res/values/dimens.xml
@@ -31,14 +31,19 @@
<dimen name="overview_minimum_next_prev_size">50dp</dimen>
- <!-- Task View -->
- <dimen name="task_thumbnail_icon_size">48dp</dimen>
- <dimen name="task_thumbnail_icon_drawable_size">44dp</dimen>
- <dimen name="overview_task_margin">16dp</dimen>
- <dimen name="overview_page_spacing">16dp</dimen>
- <dimen name="task_icon_cache_default_icon_size">72dp</dimen>
-
+ <!-- Overview Task Views -->
+ <!-- The primary task thumbnail uses up to this much of the total screen height/width -->
<item name="overview_max_scale" format="float" type="dimen">0.7</item>
+ <!-- A touch target for icons, sometimes slightly larger than the icons themselves -->
+ <dimen name="task_thumbnail_icon_size">48dp</dimen>
+ <!-- The icon size for the focused task, placed in center of touch target -->
+ <dimen name="task_thumbnail_icon_drawable_size">44dp</dimen>
+ <!-- The space under the focused task icon -->
+ <dimen name="overview_task_margin">16dp</dimen>
+ <!-- The horizontal space between tasks -->
+ <dimen name="overview_page_spacing">16dp</dimen>
+
+ <dimen name="task_icon_cache_default_icon_size">72dp</dimen>
<item name="overview_modal_max_scale" format="float" type="dimen">1.1</item>
<!-- Overrideable in overlay that provides the Overview Actions. -->
diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
index 3e13a44..5eb0e39 100644
--- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
+++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
@@ -43,7 +43,6 @@
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.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;
@@ -77,7 +76,6 @@
import android.os.SystemProperties;
import android.os.UserHandle;
import android.provider.Settings;
-import android.util.Log;
import android.util.Pair;
import android.util.Size;
import android.view.SurfaceControl;
@@ -137,7 +135,6 @@
import com.android.wm.shell.startingsurface.IStartingWindowListener;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
@@ -623,28 +620,9 @@
RecentsView overview = mLauncher.getOverviewPanel();
ObjectAnimator alpha = ObjectAnimator.ofFloat(overview,
RecentsView.CONTENT_ALPHA, alphas);
- Log.d(BAD_STATE, "QTM composeViewContentAnimator alphas=" + Arrays.toString(alphas));
- alpha.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationStart(Animator animation) {
- Log.d(BAD_STATE, "QTM composeViewContentAnimator onStart");
- }
-
- @Override
- public void onAnimationCancel(Animator animation) {
- float alpha = overview == null ? -1 : RecentsView.CONTENT_ALPHA.get(overview);
- Log.d(BAD_STATE, "QTM composeViewContentAnimator onCancel, alpha=" + alpha);
- }
-
- @Override
- public void onAnimationEnd(Animator animation) {
- Log.d(BAD_STATE, "QTM composeViewContentAnimator onEnd");
- }
- });
alpha.setDuration(CONTENT_ALPHA_DURATION);
alpha.setInterpolator(LINEAR);
anim.play(alpha);
- Log.d(BAD_STATE, "QTM composeViewContentAnimator setFreezeVisibility=true");
overview.setFreezeViewVisibility(true);
ObjectAnimator scaleAnim = ObjectAnimator.ofFloat(overview, SCALE_PROPERTY, scales);
@@ -653,7 +631,6 @@
anim.play(scaleAnim);
return () -> {
- Log.d(BAD_STATE, "QTM composeViewContentAnimator onEnd setFreezeVisibility=false");
overview.setFreezeViewVisibility(false);
SCALE_PROPERTY.set(overview, 1f);
mLauncher.getStateManager().reapplyState();
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/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
index 36806bc..2280b95 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
@@ -23,8 +23,8 @@
import static com.android.launcher3.AbstractFloatingView.TYPE_ALL;
import static com.android.launcher3.AbstractFloatingView.TYPE_REBIND_SAFE;
-import static com.android.launcher3.testing.shared.ResourceUtils.getBoolByName;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_OPEN;
+import static com.android.launcher3.testing.shared.ResourceUtils.getBoolByName;
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;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_VOICE_INTERACTION_WINDOW_SHOWING;
@@ -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(prefix, pw);
+ mDeviceProfile.dump(this, prefix, pw);
}
}
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/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/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/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
index 6d45fd2..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() {
@@ -389,6 +390,16 @@
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/uioverrides/BaseRecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java
index dc1046b..ea0972f 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java
@@ -23,26 +23,33 @@
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_FADE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_MODAL;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SCALE;
+import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SPLIT_SELECT_FLOATING_TASK_TRANSLATE_OFFSCREEN;
+import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SPLIT_SELECT_INSTRUCTIONS_FADE;
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.shared.TestProtocol.BAD_STATE;
import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_HORIZONTAL_OFFSET;
+import static com.android.quickstep.views.RecentsView.FIRST_FLOATING_TASK_TRANSLATE_OFFSCREEN;
import static com.android.quickstep.views.RecentsView.OVERVIEW_PROGRESS;
import static com.android.quickstep.views.RecentsView.RECENTS_GRID_PROGRESS;
import static com.android.quickstep.views.RecentsView.RECENTS_SCALE_PROPERTY;
+import static com.android.quickstep.views.RecentsView.SPLIT_INSTRUCTIONS_FADE;
import static com.android.quickstep.views.RecentsView.TASK_SECONDARY_TRANSLATION;
+import android.graphics.Rect;
+import android.graphics.RectF;
import android.util.FloatProperty;
-import android.util.Log;
import androidx.annotation.NonNull;
import com.android.launcher3.BaseQuickstepLauncher;
import com.android.launcher3.LauncherState;
+import com.android.launcher3.Utilities;
import com.android.launcher3.anim.PendingAnimation;
+import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.statemanager.StateManager.StateHandler;
import com.android.launcher3.states.StateAnimationConfig;
+import com.android.quickstep.views.FloatingTaskView;
import com.android.quickstep.views.RecentsView;
/**
@@ -68,10 +75,7 @@
ADJACENT_PAGE_HORIZONTAL_OFFSET.set(mRecentsView, scaleAndOffset[1]);
TASK_SECONDARY_TRANSLATION.set(mRecentsView, 0f);
- float recentsAlpha = state.overviewUi ? 1f : 0;
- Log.d(BAD_STATE, "BaseRecentsViewStateController setState state=" + state
- + ", alpha=" + recentsAlpha);
- getContentAlphaProperty().set(mRecentsView, recentsAlpha);
+ getContentAlphaProperty().set(mRecentsView, state.overviewUi ? 1f : 0);
getTaskModalnessProperty().set(mRecentsView, state.getOverviewModalness());
RECENTS_GRID_PROGRESS.set(mRecentsView,
state.displayOverviewTasksAsGrid(mLauncher.getDeviceProfile()) ? 1f : 0f);
@@ -81,8 +85,6 @@
@Override
public void setStateWithAnimation(LauncherState toState, StateAnimationConfig config,
PendingAnimation builder) {
- Log.d(BAD_STATE, "BaseRecentsViewStateController setStateWithAnimation state=" + toState
- + ", config.skipOverview=" + config.hasAnimationFlag(SKIP_OVERVIEW));
if (config.hasAnimationFlag(SKIP_OVERVIEW)) {
return;
}
@@ -106,10 +108,50 @@
setter.setFloat(mRecentsView, TASK_SECONDARY_TRANSLATION, 0f,
config.getInterpolator(ANIM_OVERVIEW_TRANSLATE_Y, LINEAR));
- float recentsAlpha = toState.overviewUi ? 1 : 0;
- Log.d(BAD_STATE, "BaseRecentsViewStateController setStateWithAnimationInternal toState="
- + toState + ", alpha=" + recentsAlpha);
- setter.setFloat(mRecentsView, getContentAlphaProperty(), recentsAlpha,
+ if (mRecentsView.isSplitSelectionActive()) {
+ // TODO (b/238651489): Refactor state management to avoid need for double check
+ FloatingTaskView floatingTask = mRecentsView.getFirstFloatingTaskView();
+ if (floatingTask != null) {
+ DragLayer dragLayer = mLauncher.getDragLayer();
+ RectF onScreenRectF = new RectF();
+ Utilities.getBoundsForViewInDragLayer(mLauncher.getDragLayer(), floatingTask,
+ new Rect(0, 0, floatingTask.getWidth(), floatingTask.getHeight()),
+ false, null, onScreenRectF);
+ // Get the part of the floatingTask that intersects with the DragLayer (i.e. the
+ // on-screen portion)
+ onScreenRectF.intersect(
+ dragLayer.getLeft(),
+ dragLayer.getTop(),
+ dragLayer.getRight(),
+ dragLayer.getBottom()
+ );
+
+ setter.setFloat(
+ mRecentsView,
+ FIRST_FLOATING_TASK_TRANSLATE_OFFSCREEN,
+ mRecentsView.getPagedOrientationHandler()
+ .getFloatingTaskOffscreenTranslationTarget(
+ floatingTask,
+ onScreenRectF,
+ floatingTask.getStagePosition(),
+ mLauncher.getDeviceProfile()
+ ),
+ config.getInterpolator(
+ ANIM_OVERVIEW_SPLIT_SELECT_FLOATING_TASK_TRANSLATE_OFFSCREEN,
+ LINEAR
+ ));
+ setter.setFloat(
+ mRecentsView,
+ SPLIT_INSTRUCTIONS_FADE,
+ 1,
+ config.getInterpolator(
+ ANIM_OVERVIEW_SPLIT_SELECT_INSTRUCTIONS_FADE,
+ LINEAR
+ ));
+ }
+ }
+
+ setter.setFloat(mRecentsView, getContentAlphaProperty(), toState.overviewUi ? 1 : 0,
config.getInterpolator(ANIM_OVERVIEW_FADE, AGGRESSIVE_EASE_IN_OUT));
setter.setFloat(
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
index c4c9038..6f07568 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
@@ -37,6 +37,10 @@
*/
public class OverviewState extends LauncherState {
+ private static final int OVERVIEW_SLIDE_IN_DURATION = 380;
+ private static final int OVERVIEW_POP_IN_DURATION = 250;
+ private static final int OVERVIEW_EXIT_DURATION = 250;
+
protected static final Rect sTempRect = new Rect();
private static final int STATE_FLAGS = FLAG_WORKSPACE_ICONS_CAN_BE_DRAGGED
@@ -57,8 +61,15 @@
@Override
public int getTransitionDuration(Context context, boolean isToState) {
- // In gesture modes, overview comes in all the way from the side, so give it more time.
- return DisplayController.getNavigationMode(context).hasGestures ? 380 : 250;
+ if (isToState) {
+ // In gesture modes, overview comes in all the way from the side, so give it more time.
+ return DisplayController.getNavigationMode(context).hasGestures
+ ? OVERVIEW_SLIDE_IN_DURATION
+ : OVERVIEW_POP_IN_DURATION;
+ } else {
+ // When exiting Overview, exit quickly.
+ return OVERVIEW_EXIT_DURATION;
+ }
}
@Override
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java
index 4d2f965..872e64a 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java
@@ -22,13 +22,15 @@
import static com.android.launcher3.LauncherState.HINT_STATE_TWO_BUTTON;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.OVERVIEW;
+import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT;
import static com.android.launcher3.WorkspaceStateTransitionAnimation.getWorkspaceSpringScaleAnimator;
import static com.android.launcher3.anim.Interpolators.ACCEL;
import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL;
import static com.android.launcher3.anim.Interpolators.DEACCEL;
import static com.android.launcher3.anim.Interpolators.DEACCEL_1_7;
import static com.android.launcher3.anim.Interpolators.DEACCEL_3;
-import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN;
+import static com.android.launcher3.anim.Interpolators.EMPHASIZED_ACCELERATE;
+import static com.android.launcher3.anim.Interpolators.EMPHASIZED_DECELERATE;
import static com.android.launcher3.anim.Interpolators.FINAL_FRAME;
import static com.android.launcher3.anim.Interpolators.INSTANT;
import static com.android.launcher3.anim.Interpolators.LINEAR;
@@ -39,6 +41,8 @@
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_ACTIONS_FADE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_FADE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SCALE;
+import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SPLIT_SELECT_FLOATING_TASK_TRANSLATE_OFFSCREEN;
+import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SPLIT_SELECT_INSTRUCTIONS_FADE;
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.ANIM_SCRIM_FADE;
@@ -87,9 +91,16 @@
public void prepareForAtomicAnimation(LauncherState fromState, LauncherState toState,
StateAnimationConfig config) {
RecentsView overview = mActivity.getOverviewPanel();
- if (toState == NORMAL && fromState == OVERVIEW) {
+ if ((fromState == OVERVIEW || fromState == OVERVIEW_SPLIT_SELECT) && toState == NORMAL) {
+ if (fromState == OVERVIEW_SPLIT_SELECT) {
+ config.setInterpolator(ANIM_OVERVIEW_SPLIT_SELECT_FLOATING_TASK_TRANSLATE_OFFSCREEN,
+ clampToProgress(EMPHASIZED_ACCELERATE, 0, 0.4f));
+ config.setInterpolator(ANIM_OVERVIEW_SPLIT_SELECT_INSTRUCTIONS_FADE,
+ clampToProgress(LINEAR, 0, 0.33f));
+ }
+
config.setInterpolator(ANIM_OVERVIEW_ACTIONS_FADE, clampToProgress(LINEAR, 0, 0.25f));
- config.setInterpolator(ANIM_SCRIM_FADE, LINEAR);
+ config.setInterpolator(ANIM_SCRIM_FADE, clampToProgress(LINEAR, 0.33f, 1));
config.setInterpolator(ANIM_WORKSPACE_SCALE, DEACCEL);
config.setInterpolator(ANIM_WORKSPACE_FADE, ACCEL);
@@ -98,8 +109,7 @@
// Overview is going offscreen, so keep it at its current scale and opacity.
config.setInterpolator(ANIM_OVERVIEW_SCALE, FINAL_FRAME);
config.setInterpolator(ANIM_OVERVIEW_FADE, FINAL_FRAME);
- config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X,
- clampToProgress(FAST_OUT_SLOW_IN, 0, 0.75f));
+ config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X, EMPHASIZED_DECELERATE);
config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_Y, FINAL_FRAME);
} else {
config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X, ACCEL_DEACCEL);
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java
index 4092a73..bc76487 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java
@@ -39,7 +39,6 @@
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.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;
@@ -56,7 +55,6 @@
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.graphics.PointF;
-import android.util.Log;
import android.view.MotionEvent;
import android.view.animation.Interpolator;
@@ -227,7 +225,6 @@
// Set RecentView's initial properties.
RECENTS_SCALE_PROPERTY.set(mRecentsView, fromState.getOverviewScaleAndOffset(mLauncher)[0]);
ADJACENT_PAGE_HORIZONTAL_OFFSET.set(mRecentsView, 1f);
- Log.d(BAD_STATE, "NBQSTC setupOverviewAnimators setContentAlpha=1");
mRecentsView.setContentAlpha(1);
mRecentsView.setFullscreenProgress(fromState.getOverviewFullscreenProgress());
mLauncher.getActionsView().getVisibilityAlpha().setValue(
@@ -247,24 +244,6 @@
QUICK_SWITCH.getWorkspaceScrimColor(mLauncher), LINEAR);
if (mRecentsView.getTaskViewCount() == 0) {
xAnim.addFloat(mRecentsView, CONTENT_ALPHA, 0f, 1f, LINEAR);
- Log.d(BAD_STATE, "NBQSTC setupOverviewAnimators from: 0 to: 1");
- xAnim.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationStart(Animator animation) {
- Log.d(BAD_STATE, "NBQSTC setupOverviewAnimators onStart");
- }
-
- @Override
- public void onAnimationCancel(Animator animation) {
- float alpha = mRecentsView == null ? -1 : CONTENT_ALPHA.get(mRecentsView);
- Log.d(BAD_STATE, "NBQSTC setupOverviewAnimators onCancel, alpha=" + alpha);
- }
-
- @Override
- public void onAnimationEnd(Animator animation) {
- Log.d(BAD_STATE, "NBQSTC setupOverviewAnimators onEnd");
- }
- });
}
mXOverviewAnim = xAnim.createPlaybackController();
mXOverviewAnim.dispatchOnStart();
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java
index f607aa3..e5cd53a 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java
@@ -29,7 +29,6 @@
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.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;
@@ -37,7 +36,6 @@
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED;
-import android.util.Log;
import android.view.MotionEvent;
import com.android.launcher3.Launcher;
@@ -114,7 +112,6 @@
RECENTS_SCALE_PROPERTY.set(mOverviewPanel,
QUICK_SWITCH.getOverviewScaleAndOffset(mLauncher)[0] * 0.85f);
ADJACENT_PAGE_HORIZONTAL_OFFSET.set(mOverviewPanel, 1f);
- Log.d(BAD_STATE, "QuickSwitchTouchController initCurrentAnimation setContentAlpha=1");
mOverviewPanel.setContentAlpha(1);
mCurrentAnimation = mLauncher.getStateManager()
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 98824eb..4435eda 100644
--- a/quickstep/src/com/android/quickstep/RecentsActivity.java
+++ b/quickstep/src/com/android/quickstep/RecentsActivity.java
@@ -23,7 +23,6 @@
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.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;
@@ -39,7 +38,6 @@
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
-import android.util.Log;
import android.view.Display;
import android.view.SurfaceControl.Transaction;
import android.view.View;
@@ -314,7 +312,6 @@
protected void onStart() {
// Set the alpha to 1 before calling super, as it may get set back to 0 due to
// onActivityStart callback.
- Log.d(BAD_STATE, "RecentsActivity onStart mFallbackRecentsView.setContentAlpha(1)");
mFallbackRecentsView.setContentAlpha(1);
super.onStart();
mFallbackRecentsView.updateLocusId();
diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java
index 4fb7e6b..48f0557 100644
--- a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java
+++ b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java
@@ -61,6 +61,7 @@
import android.view.MotionEvent;
import androidx.annotation.BinderThread;
+import androidx.annotation.NonNull;
import com.android.launcher3.Utilities;
import com.android.launcher3.util.DisplayController;
@@ -124,7 +125,7 @@
};
private int mGestureBlockingTaskId = -1;
- private Region mExclusionRegion;
+ private @NonNull Region mExclusionRegion = new Region();
private SystemGestureExclusionListenerCompat mExclusionListener;
public RecentsAnimationDeviceState(Context context) {
@@ -162,6 +163,10 @@
@Override
@BinderThread
public void onExclusionChanged(Region region) {
+ if (region == null) {
+ // Don't think this is possible but just in case, don't let it be null.
+ region = new Region();
+ }
// Assignments are atomic, it should be safe on binder thread
mExclusionRegion = region;
}
@@ -498,7 +503,7 @@
public boolean isInExclusionRegion(MotionEvent event) {
// mExclusionRegion can change on binder thread, use a local instance here.
Region exclusionRegion = mExclusionRegion;
- return mMode == NO_BUTTON && exclusionRegion != null
+ return mMode == NO_BUTTON
&& exclusionRegion.contains((int) event.getX(), (int) event.getY());
}
@@ -587,7 +592,8 @@
pw.println(" isUserUnlocked=" + mIsUserUnlocked);
pw.println(" isOneHandedModeEnabled=" + mIsOneHandedModeEnabled);
pw.println(" isSwipeToNotificationEnabled=" + mIsSwipeToNotificationEnabled);
- pw.println(" deferredGestureRegion=" + mDeferredGestureRegion);
+ pw.println(" deferredGestureRegion=" + mDeferredGestureRegion.getBounds());
+ pw.println(" exclusionRegion=" + mExclusionRegion.getBounds());
pw.println(" pipIsActive=" + mPipIsActive);
mRotationTouchHelper.dump(pw);
}
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/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java
index cb80b4d..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;
@@ -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
@@ -868,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/TaskViewUtils.java b/quickstep/src/com/android/quickstep/TaskViewUtils.java
index c28fc9d..fa30b8f 100644
--- a/quickstep/src/com/android/quickstep/TaskViewUtils.java
+++ b/quickstep/src/com/android/quickstep/TaskViewUtils.java
@@ -37,7 +37,6 @@
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.shared.TestProtocol.BAD_STATE;
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING;
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_OPENING;
@@ -55,7 +54,6 @@
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.Build;
-import android.util.Log;
import android.view.SurfaceControl;
import android.view.View;
import android.window.TransitionInfo;
@@ -571,29 +569,6 @@
launcherAnim = dp.isTablet
? ObjectAnimator.ofFloat(recentsView, RecentsView.CONTENT_ALPHA, 0)
: recentsView.createAdjacentPageAnimForTaskLaunch(taskView);
- if (dp.isTablet) {
- Log.d(BAD_STATE, "TVU composeRecentsLaunchAnimator alpha=" + 0);
- launcherAnim.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationStart(Animator animation) {
- Log.d(BAD_STATE, "TVU composeRecentsLaunchAnimator onStart");
- }
-
- @Override
- public void onAnimationCancel(Animator animation) {
- float alpha = recentsView == null
- ? -1
- : RecentsView.CONTENT_ALPHA.get(recentsView);
- Log.d(BAD_STATE, "TVU composeRecentsLaunchAnimator onCancel, alpha="
- + alpha);
- }
-
- @Override
- public void onAnimationEnd(Animator animation) {
- Log.d(BAD_STATE, "TVU composeRecentsLaunchAnimator onEnd");
- }
- });
- }
launcherAnim.setInterpolator(Interpolators.TOUCH_RESPONSE_INTERPOLATOR);
launcherAnim.setDuration(RECENTS_LAUNCH_DURATION);
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 2df9b9c..52a37c5 100644
--- a/quickstep/src/com/android/quickstep/TouchInteractionService.java
+++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java
@@ -65,7 +65,6 @@
import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.R;
-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,6 +72,7 @@
import com.android.launcher3.taskbar.TaskbarActivityContext;
import com.android.launcher3.taskbar.TaskbarManager;
import com.android.launcher3.testing.TestLogging;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.tracing.LauncherTraceProto;
import com.android.launcher3.tracing.TouchInteractionServiceProto;
@@ -1015,7 +1015,7 @@
pw.println("ProtoTrace:");
pw.println(" file=" + ProtoTracer.INSTANCE.get(this).getTraceFile());
if (createdOverviewActivity != null) {
- createdOverviewActivity.getDeviceProfile().dump("", pw);
+ createdOverviewActivity.getDeviceProfile().dump(this, "", 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 3734f11..eb739a6 100644
--- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java
+++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java
@@ -15,7 +15,6 @@
*/
package com.android.quickstep.fallback;
-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;
@@ -27,7 +26,6 @@
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
-import android.util.Log;
import android.view.MotionEvent;
import androidx.annotation.Nullable;
@@ -225,7 +223,6 @@
if (toState == MODAL_TASK) {
setOverviewSelectEnabled(true);
}
- Log.d(BAD_STATE, "FRV onStateTransitionStart setFreezeVisibility=true, toState=" + toState);
setFreezeViewVisibility(true);
}
@@ -237,8 +234,6 @@
}
boolean isOverlayEnabled = finalState == DEFAULT || finalState == MODAL_TASK;
setOverlayEnabled(isOverlayEnabled);
- Log.d(BAD_STATE, "FRV onStateTransitionComplete setFreezeVisibility=false, finalState="
- + finalState);
setFreezeViewVisibility(false);
if (finalState != MODAL_TASK) {
setOverviewSelectEnabled(false);
diff --git a/quickstep/src/com/android/quickstep/util/RecentsAtomicAnimationFactory.java b/quickstep/src/com/android/quickstep/util/RecentsAtomicAnimationFactory.java
index ac77c67..1d008da 100644
--- a/quickstep/src/com/android/quickstep/util/RecentsAtomicAnimationFactory.java
+++ b/quickstep/src/com/android/quickstep/util/RecentsAtomicAnimationFactory.java
@@ -15,13 +15,10 @@
*/
package com.android.quickstep.util;
-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;
-import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
-import android.util.Log;
import androidx.dynamicanimation.animation.DynamicAnimation;
@@ -30,8 +27,6 @@
import com.android.launcher3.statemanager.StatefulActivity;
import com.android.quickstep.views.RecentsView;
-import java.util.Arrays;
-
public class RecentsAtomicAnimationFactory<ACTIVITY_TYPE extends StatefulActivity, STATE_TYPE>
extends AtomicAnimationFactory<STATE_TYPE> {
@@ -53,27 +48,6 @@
case INDEX_RECENTS_FADE_ANIM:
ObjectAnimator alpha = ObjectAnimator.ofFloat(mActivity.getOverviewPanel(),
RecentsView.CONTENT_ALPHA, values);
- Log.d(BAD_STATE, "RAAF createStateElementAnimation alpha="
- + Arrays.toString(values));
- alpha.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationStart(Animator animation) {
- Log.d(BAD_STATE, "RAAF createStateElementAnimation onStart");
- }
-
- @Override
- public void onAnimationCancel(Animator animation) {
- RecentsView recent = mActivity.getOverviewPanel();
- float alpha = recent == null ? -1 : RecentsView.CONTENT_ALPHA.get(recent);
- Log.d(BAD_STATE, "RAAF createStateElementAnimation onCancel, alpha="
- + alpha);
- }
-
- @Override
- public void onAnimationEnd(Animator animation) {
- Log.d(BAD_STATE, "RAAF createStateElementAnimation onEnd");
- }
- });
return alpha;
case INDEX_RECENTS_TRANSLATE_X_ANIM: {
RecentsView rv = mActivity.getOverviewPanel();
diff --git a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
index 835c9f7..7a66ea0 100644
--- a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
+++ b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
@@ -260,6 +260,10 @@
mActivity.getDeviceProfile(), mStagePosition);
}
+ public int getStagePosition() {
+ return mStagePosition;
+ }
+
private static class SplitOverlayProperties {
private final float finalTaskViewScaleX;
diff --git a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
index 8b8558a..3c5a626 100644
--- a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
@@ -21,13 +21,11 @@
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.shared.TestProtocol.BAD_STATE;
import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
-import android.util.Log;
import android.view.MotionEvent;
import android.view.Surface;
@@ -68,7 +66,6 @@
public void init(OverviewActionsView actionsView,
SplitSelectStateController splitPlaceholderView) {
super.init(actionsView, splitPlaceholderView);
- Log.d(BAD_STATE, "LauncherRecentsView init setContentAlpha=0");
setContentAlpha(0);
}
@@ -119,7 +116,6 @@
if (toState == OVERVIEW_MODAL_TASK) {
setOverviewSelectEnabled(true);
}
- Log.d(BAD_STATE, "LRV onStateTransitionStart setFreezeVisibility=true, toState=" + toState);
setFreezeViewVisibility(true);
}
@@ -131,8 +127,6 @@
}
boolean isOverlayEnabled = finalState == OVERVIEW || finalState == OVERVIEW_MODAL_TASK;
setOverlayEnabled(isOverlayEnabled);
- Log.d(BAD_STATE, "LRV onStateTransitionComplete setFreezeVisibility=false, finalState="
- + finalState);
setFreezeViewVisibility(false);
if (finalState != OVERVIEW_MODAL_TASK) {
setOverviewSelectEnabled(false);
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 3aa24ac..64068ad 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -397,6 +397,39 @@
}
};
+ public static final FloatProperty<RecentsView> FIRST_FLOATING_TASK_TRANSLATE_OFFSCREEN =
+ new FloatProperty<RecentsView>("firstFloatingTaskTranslateOffscreen") {
+ @Override
+ public void setValue(RecentsView view, float translation) {
+ view.getPagedOrientationHandler().setFloatingTaskPrimaryTranslation(
+ view.mFirstFloatingTaskView,
+ translation,
+ view.mActivity.getDeviceProfile()
+ );
+ }
+
+ @Override
+ public Float get(RecentsView view) {
+ return view.getPagedOrientationHandler().getFloatingTaskPrimaryTranslation(
+ view.mFirstFloatingTaskView,
+ view.mActivity.getDeviceProfile()
+ );
+ }
+ };
+
+ public static final FloatProperty<RecentsView> SPLIT_INSTRUCTIONS_FADE =
+ new FloatProperty<RecentsView>("splitInstructionsFade") {
+ @Override
+ public void setValue(RecentsView view, float fade) {
+ view.mSplitInstructionsView.setAlpha(1 - fade);
+ }
+
+ @Override
+ public Float get(RecentsView view) {
+ return 1 - view.mSplitInstructionsView.getAlpha();
+ }
+ };
+
// OverScroll constants
private static final int OVERSCROLL_PAGE_SNAP_ANIMATION_DURATION = 270;
@@ -2205,7 +2238,8 @@
@Nullable AnimatorSet animatorSet, GestureState.GestureEndTarget endTarget,
TaskViewSimulator[] taskViewSimulators) {
mCurrentGestureEndTarget = endTarget;
- if (endTarget == GestureState.GestureEndTarget.RECENTS) {
+ boolean isOverviewEndTarget = endTarget == GestureState.GestureEndTarget.RECENTS;
+ if (isOverviewEndTarget) {
updateGridProperties();
}
@@ -2234,10 +2268,11 @@
}
}
}
+ int overviewProgress = isOverviewEndTarget ? 1 : 0;
if (animatorSet == null) {
- setOverviewProgress(1);
+ setOverviewProgress(overviewProgress);
} else {
- animatorSet.play(ObjectAnimator.ofFloat(this, OVERVIEW_PROGRESS, 1));
+ animatorSet.play(ObjectAnimator.ofFloat(this, OVERVIEW_PROGRESS, overviewProgress));
}
}
@@ -5291,6 +5326,11 @@
return mRecentsAnimationController;
}
+ @Nullable
+ public FloatingTaskView getFirstFloatingTaskView() {
+ return mFirstFloatingTaskView;
+ }
+
/** Update the current activity locus id to show the enabled state of Overview */
public void updateLocusId() {
String locusId = "Overview";
diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java
index 2ccd703..b089155 100644
--- a/quickstep/src/com/android/quickstep/views/TaskView.java
+++ b/quickstep/src/com/android/quickstep/views/TaskView.java
@@ -866,10 +866,9 @@
int thumbnailTopMargin = deviceProfile.overviewTaskThumbnailTopMarginPx;
int taskIconHeight = deviceProfile.overviewTaskIconSizePx;
- int taskMargin = isGridTask ? deviceProfile.overviewTaskMarginGridPx
- : deviceProfile.overviewTaskMarginPx;
- int taskIconMargin = thumbnailTopMargin - taskIconHeight - taskMargin;
- orientationHandler.setTaskIconParams(iconParams, taskIconMargin, taskIconHeight,
+ int taskMargin = deviceProfile.overviewTaskMarginPx;
+
+ orientationHandler.setTaskIconParams(iconParams, taskMargin, taskIconHeight,
thumbnailTopMargin, isRtl);
iconParams.width = iconParams.height = taskIconHeight;
mIconView.setLayoutParams(iconParams);
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfilePhone3ButtonTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfilePhone3ButtonTest.kt
deleted file mode 100644
index 3daf81d..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfilePhone3ButtonTest.kt
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * 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.quickstep
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.launcher3.DeviceProfile
-import com.android.launcher3.DeviceProfileBaseTest
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Tests for DeviceProfile for phone with 3-Button navigation.
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class DeviceProfilePhone3ButtonTest : DeviceProfileBaseTest() {
-
- lateinit var dp: DeviceProfile
-
- @Before
- fun before() {
- initializeVarsForPhone(isGestureMode = false)
- dp = newDP()
- }
-
- @Test
- fun isScalableGrid() {
- assertThat(dp.isScalableGrid).isTrue()
- }
-
- @Test
- fun cellWidthPx() {
- assertThat(dp.cellWidthPx).isEqualTo(265)
- }
-
- @Test
- fun cellHeightPx() {
- assertThat(dp.cellHeightPx).isEqualTo(343)
- }
-
- @Test
- fun getCellSizeX() {
- assertThat(dp.getCellSize().x).isEqualTo(265)
- }
-
- @Test
- fun getCellSizeY() {
- assertThat(dp.getCellSize().y).isEqualTo(552)
- }
-
- @Test
- fun cellLayoutBorderSpacePxX() {
- assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(66)
- }
-
- @Test
- fun cellLayoutBorderSpacePxY() {
- assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(66)
- }
-
- @Test
- fun cellLayoutPaddingPxLeft() {
- assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(38)
- }
-
- @Test
- fun cellLayoutPaddingPxTop() {
- assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxRight() {
- assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(38)
- }
-
- @Test
- fun cellLayoutPaddingPxBottom() {
- assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(38)
- }
-
- @Test
- fun iconSizePx() {
- assertThat(dp.iconSizePx).isEqualTo(196)
- }
-
- @Test
- fun iconTextSizePx() {
- assertThat(dp.iconTextSizePx).isEqualTo(49)
- }
-
- @Test
- fun iconDrawablePaddingPx() {
- assertThat(dp.iconDrawablePaddingPx).isEqualTo(25)
- }
-
- @Test
- fun folderCellWidthPx() {
- assertThat(dp.folderCellWidthPx).isEqualTo(265)
- }
-
- @Test
- fun folderCellHeightPx() {
- assertThat(dp.folderCellHeightPx).isEqualTo(343)
- }
-
- @Test
- fun folderChildIconSizePx() {
- assertThat(dp.folderChildIconSizePx).isEqualTo(196)
- }
-
- @Test
- fun folderChildTextSizePx() {
- assertThat(dp.folderChildTextSizePx).isEqualTo(49)
- }
-
- @Test
- fun folderChildDrawablePaddingPx() {
- assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(27)
- }
-
- @Test
- fun folderCellLayoutBorderSpaceOriginalPx() {
- assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxX() {
- assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxY() {
- assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun bottomSheetTopPadding() {
- assertThat(dp.bottomSheetTopPadding).isEqualTo(38)
- }
-
- @Test
- fun allAppsShiftRange() {
- assertThat(dp.allAppsShiftRange).isEqualTo(1050)
- }
-
- @Test
- fun allAppsTopPadding() {
- assertThat(dp.allAppsTopPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsIconSizePx() {
- assertThat(dp.allAppsIconSizePx).isEqualTo(232)
- }
-
- @Test
- fun allAppsIconTextSizePx() {
- assertThat(dp.allAppsIconTextSizePx).isEqualTo(58)
- }
-
- @Test
- fun allAppsIconDrawablePaddingPx() {
- assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(25)
- }
-
- @Test
- fun allAppsCellHeightPx() {
- assertThat(dp.allAppsCellHeightPx).isEqualTo(409)
- }
-
- @Test
- fun allAppsCellWidthPx() {
- assertThat(dp.allAppsCellWidthPx).isEqualTo(265)
- }
-
- @Test
- fun allAppsBorderSpacePxX() {
- assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(66)
- }
-
- @Test
- fun allAppsBorderSpacePxY() {
- assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(66)
- }
-
- @Test
- fun numShownAllAppsColumns() {
- assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightPadding() {
- assertThat(dp.allAppsLeftRightPadding).isEqualTo(91)
- }
-
- @Test
- fun allAppsLeftRightMargin() {
- assertThat(dp.allAppsLeftRightMargin).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSizePx() {
- assertThat(dp.hotseatBarSizePx).isEqualTo(669)
- }
-
- @Test
- fun hotseatCellHeightPx() {
- assertThat(dp.hotseatCellHeightPx).isEqualTo(221)
- }
-
- @Test
- fun hotseatBarBottomPaddingPx() {
- assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(168)
- }
-
- @Test
- fun hotseatBarSidePaddingStartPx() {
- assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSidePaddingEndPx() {
- assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatQsbSpace() {
- assertThat(dp.hotseatQsbSpace).isEqualTo(126)
- }
-
- @Test
- fun hotseatQsbHeight() {
- assertThat(dp.hotseatQsbHeight).isEqualTo(221)
- }
-
- @Test
- fun springLoadedHotseatBarTopMarginPx() {
- assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(266)
- }
-
- @Test
- fun numShownHotseatIcons() {
- assertThat(dp.numShownHotseatIcons).isEqualTo(4)
- }
-
- @Test
- fun hotseatBorderSpace() {
- assertThat(dp.hotseatBorderSpace).isEqualTo(135)
- }
-
- @Test
- fun isQsbInline() {
- assertThat(dp.isQsbInline).isEqualTo(false)
- }
-
- @Test
- fun qsbWidth() {
- assertThat(dp.qsbWidth).isEqualTo(1189)
- }
-
- @Test
- fun isTaskbarPresent() {
- assertThat(dp.isTaskbarPresent).isEqualTo(false)
- }
-
- @Test
- fun isTaskbarPresentInApps() {
- assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
- }
-
- @Test
- fun taskbarSize() {
- assertThat(dp.taskbarSize).isEqualTo(0)
- }
-
- @Test
- fun desiredWorkspaceHorizontalMarginPx() {
- assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(91)
- }
-
- @Test
- fun workspacePaddingLeft() {
- assertThat(dp.workspacePadding.left).isEqualTo(53)
- }
-
- @Test
- fun workspacePaddingTop() {
- assertThat(dp.workspacePadding.top).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingRight() {
- assertThat(dp.workspacePadding.right).isEqualTo(53)
- }
-
- @Test
- fun workspacePaddingBottom() {
- assertThat(dp.workspacePadding.bottom).isEqualTo(573)
- }
-
- @Test
- fun iconScale() {
- assertThat(dp.iconScale).isEqualTo(1)
- }
-
- @Test
- fun cellScaleToFit() {
- assertThat(dp.cellScaleToFit).isEqualTo(1.182266f)
- }
-
- @Test
- fun workspaceTopPadding() {
- assertThat(dp.workspaceTopPadding).isEqualTo(0)
- }
-
- @Test
- fun workspaceBottomPadding() {
- assertThat(dp.workspaceBottomPadding).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskMarginPx() {
- assertThat(dp.overviewTaskMarginPx).isEqualTo(56)
- }
-
- @Test
- fun overviewTaskMarginGridPx() {
- assertThat(dp.overviewTaskMarginGridPx).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskIconSizePx() {
- assertThat(dp.overviewTaskIconSizePx).isEqualTo(168)
- }
-
- @Test
- fun overviewTaskIconDrawableSizePx() {
- assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(154)
- }
-
- @Test
- fun overviewTaskIconDrawableSizeGridPx() {
- assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskThumbnailTopMarginPx() {
- assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(280)
- }
-
- @Test
- fun overviewActionsTopMarginPx() {
- assertThat(dp.overviewActionsTopMarginPx).isEqualTo(84)
- }
-
- @Test
- fun overviewActionsHeight() {
- assertThat(dp.overviewActionsHeight).isEqualTo(168)
- }
-
- @Test
- fun overviewActionsButtonSpacing() {
- assertThat(dp.overviewActionsButtonSpacing).isEqualTo(126)
- }
-
- @Test
- fun overviewPageSpacing() {
- assertThat(dp.overviewPageSpacing).isEqualTo(56)
- }
-
- @Test
- fun overviewRowSpacing() {
- assertThat(dp.overviewRowSpacing).isEqualTo(-112)
- }
-
- @Test
- fun overviewGridSideMargin() {
- assertThat(dp.overviewGridSideMargin).isEqualTo(0)
- }
-
- @Test
- fun dropTargetBarTopMarginPx() {
- assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(112)
- }
-
- @Test
- fun dropTargetBarSizePx() {
- assertThat(dp.dropTargetBarSizePx).isEqualTo(196)
- }
-
- @Test
- fun dropTargetBarBottomMarginPx() {
- assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(56)
- }
-
- @Test
- fun workspaceSpringLoadedMinNextPageVisiblePx() {
- assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(84)
- }
-
- @Test
- fun getWorkspaceSpringLoadScale() {
- assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.74417657f)
- }
-
- @Test
- fun getCellLayoutHeight() {
- assertThat(dp.cellLayoutHeight).isEqualTo(2447)
- }
-
- @Test
- fun getCellLayoutWidth() {
- assertThat(dp.cellLayoutWidth).isEqualTo(1334)
- }
-
- @Test
- fun getPanelCount() {
- assertThat(dp.panelCount).isEqualTo(1)
- }
-
- @Test
- fun isVerticalBarLayout() {
- assertThat(dp.isVerticalBarLayout).isEqualTo(false)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkTop() {
- assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(364)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkBottom() {
- assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(2185)
- }
-
- @Test
- fun getQsbOffsetY() {
- assertThat(dp.qsbOffsetY).isEqualTo(147)
- }
-
- @Test
- fun getTaskbarOffsetY() {
- assertThat(dp.taskbarOffsetY).isEqualTo(558)
- }
-
- @Test
- fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(125)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(0)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(125)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(448)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
- }
-}
\ 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
deleted file mode 100644
index e588c71..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfilePhoneTest.kt
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * 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.quickstep
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.launcher3.DeviceProfile
-import com.android.launcher3.DeviceProfileBaseTest
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Tests for DeviceProfile for phone.
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class DeviceProfilePhoneTest : DeviceProfileBaseTest() {
-
- lateinit var dp: DeviceProfile
-
- @Before
- fun before() {
- initializeVarsForPhone()
- dp = newDP()
- }
-
- @Test
- fun isScalableGrid() {
- assertThat(dp.isScalableGrid).isTrue()
- }
-
- @Test
- fun cellWidthPx() {
- assertThat(dp.cellWidthPx).isEqualTo(265)
- }
-
- @Test
- fun cellHeightPx() {
- assertThat(dp.cellHeightPx).isEqualTo(343)
- }
-
- @Test
- fun getCellSizeX() {
- assertThat(dp.getCellSize().x).isEqualTo(265)
- }
-
- @Test
- fun getCellSizeY() {
- assertThat(dp.getCellSize().y).isEqualTo(552)
- }
-
- @Test
- fun cellLayoutBorderSpacePxX() {
- assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(66)
- }
-
- @Test
- fun cellLayoutBorderSpacePxY() {
- assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(66)
- }
-
- @Test
- fun cellLayoutPaddingPxLeft() {
- assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(38)
- }
-
- @Test
- fun cellLayoutPaddingPxTop() {
- assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxRight() {
- assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(38)
- }
-
- @Test
- fun cellLayoutPaddingPxBottom() {
- assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(38)
- }
-
- @Test
- fun iconSizePx() {
- assertThat(dp.iconSizePx).isEqualTo(196)
- }
-
- @Test
- fun iconTextSizePx() {
- assertThat(dp.iconTextSizePx).isEqualTo(49)
- }
-
- @Test
- fun iconDrawablePaddingPx() {
- assertThat(dp.iconDrawablePaddingPx).isEqualTo(25)
- }
-
- @Test
- fun folderCellWidthPx() {
- assertThat(dp.folderCellWidthPx).isEqualTo(265)
- }
-
- @Test
- fun folderCellHeightPx() {
- assertThat(dp.folderCellHeightPx).isEqualTo(343)
- }
-
- @Test
- fun folderChildIconSizePx() {
- assertThat(dp.folderChildIconSizePx).isEqualTo(196)
- }
-
- @Test
- fun folderChildTextSizePx() {
- assertThat(dp.folderChildTextSizePx).isEqualTo(49)
- }
-
- @Test
- fun folderChildDrawablePaddingPx() {
- assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(27)
- }
-
- @Test
- fun folderCellLayoutBorderSpaceOriginalPx() {
- assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxX() {
- assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxY() {
- assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun bottomSheetTopPadding() {
- assertThat(dp.bottomSheetTopPadding).isEqualTo(38)
- }
-
- @Test
- fun allAppsShiftRange() {
- assertThat(dp.allAppsShiftRange).isEqualTo(1050)
- }
-
- @Test
- fun allAppsTopPadding() {
- assertThat(dp.allAppsTopPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsIconSizePx() {
- assertThat(dp.allAppsIconSizePx).isEqualTo(232)
- }
-
- @Test
- fun allAppsIconTextSizePx() {
- assertThat(dp.allAppsIconTextSizePx).isEqualTo(58)
- }
-
- @Test
- fun allAppsIconDrawablePaddingPx() {
- assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(25)
- }
-
- @Test
- fun allAppsCellHeightPx() {
- assertThat(dp.allAppsCellHeightPx).isEqualTo(409)
- }
-
- @Test
- fun allAppsCellWidthPx() {
- assertThat(dp.allAppsCellWidthPx).isEqualTo(265)
- }
-
- @Test
- fun allAppsBorderSpacePxX() {
- assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(66)
- }
-
- @Test
- fun allAppsBorderSpacePxY() {
- assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(66)
- }
-
- @Test
- fun numShownAllAppsColumns() {
- assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightPadding() {
- assertThat(dp.allAppsLeftRightPadding).isEqualTo(91)
- }
-
- @Test
- fun allAppsLeftRightMargin() {
- assertThat(dp.allAppsLeftRightMargin).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSizePx() {
- assertThat(dp.hotseatBarSizePx).isEqualTo(669)
- }
-
- @Test
- fun hotseatCellHeightPx() {
- assertThat(dp.hotseatCellHeightPx).isEqualTo(221)
- }
-
- @Test
- fun hotseatBarBottomPaddingPx() {
- assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(168)
- }
-
- @Test
- fun hotseatBarSidePaddingStartPx() {
- assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSidePaddingEndPx() {
- assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatQsbSpace() {
- assertThat(dp.hotseatQsbSpace).isEqualTo(126)
- }
-
- @Test
- fun hotseatQsbHeight() {
- assertThat(dp.hotseatQsbHeight).isEqualTo(221)
- }
-
- @Test
- fun springLoadedHotseatBarTopMarginPx() {
- assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(266)
- }
-
- @Test
- fun numShownHotseatIcons() {
- assertThat(dp.numShownHotseatIcons).isEqualTo(4)
- }
-
- @Test
- fun hotseatBorderSpace() {
- assertThat(dp.hotseatBorderSpace).isEqualTo(135)
- }
-
- @Test
- fun isQsbInline() {
- assertThat(dp.isQsbInline).isEqualTo(false)
- }
-
- @Test
- fun qsbWidth() {
- assertThat(dp.qsbWidth).isEqualTo(1189)
- }
-
- @Test
- fun isTaskbarPresent() {
- assertThat(dp.isTaskbarPresent).isEqualTo(false)
- }
-
- @Test
- fun isTaskbarPresentInApps() {
- assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
- }
-
- @Test
- fun taskbarSize() {
- assertThat(dp.taskbarSize).isEqualTo(0)
- }
-
- @Test
- fun desiredWorkspaceHorizontalMarginPx() {
- assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(91)
- }
-
- @Test
- fun workspacePaddingLeft() {
- assertThat(dp.workspacePadding.left).isEqualTo(53)
- }
-
- @Test
- fun workspacePaddingTop() {
- assertThat(dp.workspacePadding.top).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingRight() {
- assertThat(dp.workspacePadding.right).isEqualTo(53)
- }
-
- @Test
- fun workspacePaddingBottom() {
- assertThat(dp.workspacePadding.bottom).isEqualTo(573)
- }
-
- @Test
- fun iconScale() {
- assertThat(dp.iconScale).isEqualTo(1)
- }
-
- @Test
- fun cellScaleToFit() {
- assertThat(dp.cellScaleToFit).isEqualTo(1.182266f)
- }
-
- @Test
- fun workspaceTopPadding() {
- assertThat(dp.workspaceTopPadding).isEqualTo(0)
- }
-
- @Test
- fun workspaceBottomPadding() {
- assertThat(dp.workspaceBottomPadding).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskMarginPx() {
- assertThat(dp.overviewTaskMarginPx).isEqualTo(56)
- }
-
- @Test
- fun overviewTaskMarginGridPx() {
- assertThat(dp.overviewTaskMarginGridPx).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskIconSizePx() {
- assertThat(dp.overviewTaskIconSizePx).isEqualTo(168)
- }
-
- @Test
- fun overviewTaskIconDrawableSizePx() {
- assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(154)
- }
-
- @Test
- fun overviewTaskIconDrawableSizeGridPx() {
- assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskThumbnailTopMarginPx() {
- assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(280)
- }
-
- @Test
- fun overviewActionsTopMarginPx() {
- assertThat(dp.overviewActionsTopMarginPx).isEqualTo(84)
- }
-
- @Test
- fun overviewActionsHeight() {
- assertThat(dp.overviewActionsHeight).isEqualTo(168)
- }
-
- @Test
- fun overviewActionsButtonSpacing() {
- assertThat(dp.overviewActionsButtonSpacing).isEqualTo(126)
- }
-
- @Test
- fun overviewPageSpacing() {
- assertThat(dp.overviewPageSpacing).isEqualTo(56)
- }
-
- @Test
- fun overviewRowSpacing() {
- assertThat(dp.overviewRowSpacing).isEqualTo(-112)
- }
-
- @Test
- fun overviewGridSideMargin() {
- assertThat(dp.overviewGridSideMargin).isEqualTo(0)
- }
-
- @Test
- fun dropTargetBarTopMarginPx() {
- assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(112)
- }
-
- @Test
- fun dropTargetBarSizePx() {
- assertThat(dp.dropTargetBarSizePx).isEqualTo(196)
- }
-
- @Test
- fun dropTargetBarBottomMarginPx() {
- assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(56)
- }
-
- @Test
- fun workspaceSpringLoadedMinNextPageVisiblePx() {
- assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(84)
- }
-
- @Test
- fun getWorkspaceSpringLoadScale() {
- assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.74417657f)
- }
-
- @Test
- fun getCellLayoutHeight() {
- assertThat(dp.cellLayoutHeight).isEqualTo(2447)
- }
-
- @Test
- fun getCellLayoutWidth() {
- assertThat(dp.cellLayoutWidth).isEqualTo(1334)
- }
-
- @Test
- fun getPanelCount() {
- assertThat(dp.panelCount).isEqualTo(1)
- }
-
- @Test
- fun isVerticalBarLayout() {
- assertThat(dp.isVerticalBarLayout).isEqualTo(false)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkTop() {
- assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(364)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkBottom() {
- assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(2185)
- }
-
- @Test
- fun getQsbOffsetY() {
- assertThat(dp.qsbOffsetY).isEqualTo(147)
- }
-
- @Test
- fun getTaskbarOffsetY() {
- assertThat(dp.taskbarOffsetY).isEqualTo(558)
- }
-
- @Test
- fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(125)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(0)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(125)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(448)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
- }
-}
\ 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
deleted file mode 100644
index d0c9346..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscape3ButtonTest.kt
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * 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.quickstep
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.launcher3.DeviceProfile
-import com.android.launcher3.DeviceProfileBaseTest
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Tests for DeviceProfile for tablet in landscape with 3-Button navigation.
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class DeviceProfileTabletLandscape3ButtonTest : DeviceProfileBaseTest() {
-
- lateinit var dp: DeviceProfile
-
- @Before
- fun before() {
- initializeVarsForTablet(isLandscape = true, isGestureMode = false)
- dp = newDP()
- }
-
- @Test
- fun isScalableGrid() {
- assertThat(dp.isScalableGrid).isTrue()
- }
-
- @Test
- fun cellWidthPx() {
- assertThat(dp.cellWidthPx).isEqualTo(227)
- }
-
- @Test
- fun cellHeightPx() {
- assertThat(dp.cellHeightPx).isEqualTo(294)
- }
-
- @Test
- fun getCellSizeX() {
- assertThat(dp.cellSize.x).isEqualTo(558)
- }
-
- @Test
- fun getCellSizeY() {
- assertThat(dp.cellSize.y).isEqualTo(294)
- }
-
- @Test
- fun cellLayoutBorderSpacePxX() {
- assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(57)
- }
-
- @Test
- fun cellLayoutBorderSpacePxY() {
- assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(57)
- }
-
- @Test
- fun cellLayoutPaddingPxLeft() {
- assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(59)
- }
-
- @Test
- fun cellLayoutPaddingPxTop() {
- assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxRight() {
- assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(59)
- }
-
- @Test
- fun cellLayoutPaddingPxBottom() {
- assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(59)
- }
-
- @Test
- fun iconSizePx() {
- assertThat(dp.iconSizePx).isEqualTo(112)
- }
-
- @Test
- fun iconTextSizePx() {
- assertThat(dp.iconTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun iconDrawablePaddingPx() {
- assertThat(dp.iconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun folderCellWidthPx() {
- assertThat(dp.folderCellWidthPx).isEqualTo(227)
- }
-
- @Test
- fun folderCellHeightPx() {
- assertThat(dp.folderCellHeightPx).isEqualTo(294)
- }
-
- @Test
- fun folderChildIconSizePx() {
- assertThat(dp.folderChildIconSizePx).isEqualTo(112)
- }
-
- @Test
- fun folderChildTextSizePx() {
- assertThat(dp.folderChildTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun folderChildDrawablePaddingPx() {
- assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(48)
- }
-
- @Test
- fun folderCellLayoutBorderSpaceOriginalPx() {
- assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxX() {
- assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxY() {
- assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun bottomSheetTopPadding() {
- assertThat(dp.bottomSheetTopPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsShiftRange() {
- assertThat(dp.allAppsShiftRange).isEqualTo(1600)
- }
-
- @Test
- fun allAppsTopPadding() {
- assertThat(dp.allAppsTopPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsIconSizePx() {
- assertThat(dp.allAppsIconSizePx).isEqualTo(199)
- }
-
- @Test
- fun allAppsIconTextSizePx() {
- assertThat(dp.allAppsIconTextSizePx).isEqualTo(50)
- }
-
- @Test
- fun allAppsIconDrawablePaddingPx() {
- assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun allAppsCellHeightPx() {
- assertThat(dp.allAppsCellHeightPx).isEqualTo(351)
- }
-
- @Test
- fun allAppsCellWidthPx() {
- assertThat(dp.allAppsCellWidthPx).isEqualTo(227)
- }
-
- @Test
- fun allAppsBorderSpacePxX() {
- assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(57)
- }
-
- @Test
- fun allAppsBorderSpacePxY() {
- assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(57)
- }
-
- @Test
- fun numShownAllAppsColumns() {
- assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightPadding() {
- assertThat(dp.allAppsLeftRightPadding).isEqualTo(64)
- }
-
- @Test
- fun allAppsLeftRightMargin() {
- assertThat(dp.allAppsLeftRightMargin).isEqualTo(1244)
- }
-
- @Test
- fun hotseatBarSizePx() {
- assertThat(dp.hotseatBarSizePx).isEqualTo(228)
- }
-
- @Test
- fun hotseatCellHeightPx() {
- assertThat(dp.hotseatCellHeightPx).isEqualTo(126)
- }
-
- @Test
- fun hotseatBarBottomSpacePx() {
- assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(116)
- }
-
- @Test
- fun hotseatBarSidePaddingStartPx() {
- assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSidePaddingEndPx() {
- assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatQsbSpace() {
- assertThat(dp.hotseatQsbSpace).isEqualTo(56)
- }
-
- @Test
- fun hotseatQsbHeight() {
- assertThat(dp.hotseatQsbHeight).isEqualTo(126)
- }
-
- @Test
- fun springLoadedHotseatBarTopMarginPx() {
- assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(128)
- }
-
- @Test
- fun numShownHotseatIcons() {
- assertThat(dp.numShownHotseatIcons).isEqualTo(5)
- }
-
- @Test
- fun hotseatBorderSpace() {
- assertThat(dp.hotseatBorderSpace).isEqualTo(32)
- }
-
- @Test
- fun isQsbInline() {
- assertThat(dp.isQsbInline).isEqualTo(true)
- }
-
- @Test
- fun qsbWidth() {
- assertThat(dp.qsbWidth).isEqualTo(1237)
- }
-
- @Test
- fun isTaskbarPresent() {
- assertThat(dp.isTaskbarPresent).isEqualTo(true)
- }
-
- @Test
- fun isTaskbarPresentInApps() {
- assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
- }
-
- @Test
- fun taskbarSize() {
- assertThat(dp.taskbarSize).isEqualTo(120)
- }
-
- @Test
- fun desiredWorkspaceHorizontalMarginPx() {
- assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(78)
- }
-
- @Test
- fun workspacePaddingLeft() {
- assertThat(dp.workspacePadding.left).isEqualTo(19)
- }
-
- @Test
- fun workspacePaddingTop() {
- assertThat(dp.workspacePadding.top).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingRight() {
- assertThat(dp.workspacePadding.right).isEqualTo(19)
- }
-
- @Test
- fun workspacePaddingBottom() {
- assertThat(dp.workspacePadding.bottom).isEqualTo(93)
- }
-
- @Test
- fun iconScale() {
- assertThat(dp.iconScale).isEqualTo(1)
- }
-
- @Test
- fun cellScaleToFit() {
- assertThat(dp.cellScaleToFit).isEqualTo(1.7736843f)
- }
-
- @Test
- fun workspaceTopPadding() {
- assertThat(dp.workspaceTopPadding).isEqualTo(0)
- }
-
- @Test
- fun workspaceBottomPadding() {
- assertThat(dp.workspaceBottomPadding).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskMarginPx() {
- assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskMarginGridPx() {
- assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskIconSizePx() {
- assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
- }
-
- @Test
- fun overviewTaskIconDrawableSizePx() {
- assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskIconDrawableSizeGridPx() {
- assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskThumbnailTopMarginPx() {
- assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
- }
-
- @Test
- fun overviewActionsTopMarginPx() {
- assertThat(dp.overviewActionsTopMarginPx).isEqualTo(40)
- }
-
- @Test
- fun overviewActionsHeight() {
- assertThat(dp.overviewActionsHeight).isEqualTo(96)
- }
-
- @Test
- fun overviewActionsButtonSpacing() {
- assertThat(dp.overviewActionsButtonSpacing).isEqualTo(72)
- }
-
- @Test
- fun overviewPageSpacing() {
- assertThat(dp.overviewPageSpacing).isEqualTo(88)
- }
-
- @Test
- fun overviewRowSpacing() {
- assertThat(dp.overviewRowSpacing).isEqualTo(40)
- }
-
- @Test
- fun overviewGridSideMargin() {
- assertThat(dp.overviewGridSideMargin).isEqualTo(128)
- }
-
- @Test
- fun dropTargetBarTopMarginPx() {
- assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(0)
- }
-
- @Test
- fun dropTargetBarSizePx() {
- assertThat(dp.dropTargetBarSizePx).isEqualTo(144)
- }
-
- @Test
- fun dropTargetBarBottomMarginPx() {
- assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(64)
- }
-
- @Test
- fun workspaceSpringLoadedMinNextPageVisiblePx() {
- assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(48)
- }
-
- @Test
- fun getWorkspaceSpringLoadScale() {
- assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.7363184f)
- }
-
- @Test
- fun getCellLayoutHeight() {
- assertThat(dp.cellLayoutHeight).isEqualTo(1407)
- }
-
- @Test
- fun getCellLayoutWidth() {
- assertThat(dp.cellLayoutWidth).isEqualTo(2522)
- }
-
- @Test
- fun getPanelCount() {
- assertThat(dp.panelCount).isEqualTo(1)
- }
-
- @Test
- fun isVerticalBarLayout() {
- assertThat(dp.isVerticalBarLayout).isEqualTo(false)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkTop() {
- assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(208)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkBottom() {
- assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1244)
- }
-
- @Test
- fun getQsbOffsetY() {
- assertThat(dp.qsbOffsetY).isEqualTo(109)
- }
-
- @Test
- fun getTaskbarOffsetY() {
- assertThat(dp.taskbarOffsetY).isEqualTo(112)
- }
-
- @Test
- fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(1305)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(-7)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(566)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- 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
deleted file mode 100644
index 456ed2c..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscapeTest.kt
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * 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.quickstep
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.launcher3.DeviceProfile
-import com.android.launcher3.DeviceProfileBaseTest
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Tests for DeviceProfile for tablet in landscape.
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class DeviceProfileTabletLandscapeTest : DeviceProfileBaseTest() {
-
- lateinit var dp: DeviceProfile
-
- @Before
- fun before() {
- initializeVarsForTablet(isLandscape = true)
- dp = newDP()
- }
-
- @Test
- fun isScalableGrid() {
- assertThat(dp.isScalableGrid).isTrue()
- }
-
- @Test
- fun cellWidthPx() {
- assertThat(dp.cellWidthPx).isEqualTo(227)
- }
-
- @Test
- fun cellHeightPx() {
- assertThat(dp.cellHeightPx).isEqualTo(294)
- }
-
- @Test
- fun getCellSizeX() {
- assertThat(dp.cellSize.x).isEqualTo(558)
- }
-
- @Test
- fun getCellSizeY() {
- assertThat(dp.cellSize.y).isEqualTo(294)
- }
-
- @Test
- fun cellLayoutBorderSpacePxX() {
- assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(57)
- }
-
- @Test
- fun cellLayoutBorderSpacePxY() {
- assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(57)
- }
-
- @Test
- fun cellLayoutPaddingPxLeft() {
- assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(59)
- }
-
- @Test
- fun cellLayoutPaddingPxTop() {
- assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxRight() {
- assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(59)
- }
-
- @Test
- fun cellLayoutPaddingPxBottom() {
- assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(59)
- }
-
- @Test
- fun iconSizePx() {
- assertThat(dp.iconSizePx).isEqualTo(112)
- }
-
- @Test
- fun iconTextSizePx() {
- assertThat(dp.iconTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun iconDrawablePaddingPx() {
- assertThat(dp.iconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun folderCellWidthPx() {
- assertThat(dp.folderCellWidthPx).isEqualTo(227)
- }
-
- @Test
- fun folderCellHeightPx() {
- assertThat(dp.folderCellHeightPx).isEqualTo(294)
- }
-
- @Test
- fun folderChildIconSizePx() {
- assertThat(dp.folderChildIconSizePx).isEqualTo(112)
- }
-
- @Test
- fun folderChildTextSizePx() {
- assertThat(dp.folderChildTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun folderChildDrawablePaddingPx() {
- assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(48)
- }
-
- @Test
- fun folderCellLayoutBorderSpaceOriginalPx() {
- assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxX() {
- assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxY() {
- assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun bottomSheetTopPadding() {
- assertThat(dp.bottomSheetTopPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsShiftRange() {
- assertThat(dp.allAppsShiftRange).isEqualTo(1600)
- }
-
- @Test
- fun allAppsTopPadding() {
- assertThat(dp.allAppsTopPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsIconSizePx() {
- assertThat(dp.allAppsIconSizePx).isEqualTo(199)
- }
-
- @Test
- fun allAppsIconTextSizePx() {
- assertThat(dp.allAppsIconTextSizePx).isEqualTo(50)
- }
-
- @Test
- fun allAppsIconDrawablePaddingPx() {
- assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun allAppsCellHeightPx() {
- assertThat(dp.allAppsCellHeightPx).isEqualTo(351)
- }
-
- @Test
- fun allAppsCellWidthPx() {
- assertThat(dp.allAppsCellWidthPx).isEqualTo(227)
- }
-
- @Test
- fun allAppsBorderSpacePxX() {
- assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(57)
- }
-
- @Test
- fun allAppsBorderSpacePxY() {
- assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(57)
- }
-
- @Test
- fun numShownAllAppsColumns() {
- assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightPadding() {
- assertThat(dp.allAppsLeftRightPadding).isEqualTo(64)
- }
-
- @Test
- fun allAppsLeftRightMargin() {
- assertThat(dp.allAppsLeftRightMargin).isEqualTo(1244)
- }
-
- @Test
- fun hotseatBarSizePx() {
- assertThat(dp.hotseatBarSizePx).isEqualTo(228)
- }
-
- @Test
- fun hotseatCellHeightPx() {
- assertThat(dp.hotseatCellHeightPx).isEqualTo(126)
- }
-
- @Test
- fun hotseatBarBottomSpacePx() {
- assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(116)
- }
-
- @Test
- fun hotseatBarSidePaddingStartPx() {
- assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSidePaddingEndPx() {
- assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatQsbSpace() {
- assertThat(dp.hotseatQsbSpace).isEqualTo(56)
- }
-
- @Test
- fun hotseatQsbHeight() {
- assertThat(dp.hotseatQsbHeight).isEqualTo(126)
- }
-
- @Test
- fun springLoadedHotseatBarTopMarginPx() {
- assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(128)
- }
-
- @Test
- fun numShownHotseatIcons() {
- assertThat(dp.numShownHotseatIcons).isEqualTo(4)
- }
-
- @Test
- fun hotseatBorderSpace() {
- assertThat(dp.hotseatBorderSpace).isEqualTo(503)
- }
-
- @Test
- fun isQsbInline() {
- assertThat(dp.isQsbInline).isEqualTo(true)
- }
-
- @Test
- fun qsbWidth() {
- assertThat(dp.qsbWidth).isEqualTo(-503)
- }
-
- @Test
- fun isTaskbarPresent() {
- assertThat(dp.isTaskbarPresent).isEqualTo(true)
- }
-
- @Test
- fun isTaskbarPresentInApps() {
- assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
- }
-
- @Test
- fun taskbarSize() {
- assertThat(dp.taskbarSize).isEqualTo(120)
- }
-
- @Test
- fun desiredWorkspaceHorizontalMarginPx() {
- assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(78)
- }
-
- @Test
- fun workspacePaddingLeft() {
- assertThat(dp.workspacePadding.left).isEqualTo(19)
- }
-
- @Test
- fun workspacePaddingTop() {
- assertThat(dp.workspacePadding.top).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingRight() {
- assertThat(dp.workspacePadding.right).isEqualTo(19)
- }
-
- @Test
- fun workspacePaddingBottom() {
- assertThat(dp.workspacePadding.bottom).isEqualTo(93)
- }
-
- @Test
- fun iconScale() {
- assertThat(dp.iconScale).isEqualTo(1)
- }
-
- @Test
- fun cellScaleToFit() {
- assertThat(dp.cellScaleToFit).isEqualTo(1.7736843f)
- }
-
- @Test
- fun workspaceTopPadding() {
- assertThat(dp.workspaceTopPadding).isEqualTo(0)
- }
-
- @Test
- fun workspaceBottomPadding() {
- assertThat(dp.workspaceBottomPadding).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskMarginPx() {
- assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskMarginGridPx() {
- assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskIconSizePx() {
- assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
- }
-
- @Test
- fun overviewTaskIconDrawableSizePx() {
- assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskIconDrawableSizeGridPx() {
- assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskThumbnailTopMarginPx() {
- assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
- }
-
- @Test
- fun overviewActionsTopMarginPx() {
- assertThat(dp.overviewActionsTopMarginPx).isEqualTo(40)
- }
-
- @Test
- fun overviewActionsHeight() {
- assertThat(dp.overviewActionsHeight).isEqualTo(96)
- }
-
- @Test
- fun overviewActionsButtonSpacing() {
- assertThat(dp.overviewActionsButtonSpacing).isEqualTo(72)
- }
-
- @Test
- fun overviewPageSpacing() {
- assertThat(dp.overviewPageSpacing).isEqualTo(88)
- }
-
- @Test
- fun overviewRowSpacing() {
- assertThat(dp.overviewRowSpacing).isEqualTo(40)
- }
-
- @Test
- fun overviewGridSideMargin() {
- assertThat(dp.overviewGridSideMargin).isEqualTo(128)
- }
-
- @Test
- fun dropTargetBarTopMarginPx() {
- assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(0)
- }
-
- @Test
- fun dropTargetBarSizePx() {
- assertThat(dp.dropTargetBarSizePx).isEqualTo(144)
- }
-
- @Test
- fun dropTargetBarBottomMarginPx() {
- assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(64)
- }
-
- @Test
- fun workspaceSpringLoadedMinNextPageVisiblePx() {
- assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(48)
- }
-
- @Test
- fun getWorkspaceSpringLoadScale() {
- assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.7363184f)
- }
-
- @Test
- fun getCellLayoutHeight() {
- assertThat(dp.cellLayoutHeight).isEqualTo(1407)
- }
-
- @Test
- fun getCellLayoutWidth() {
- assertThat(dp.cellLayoutWidth).isEqualTo(2522)
- }
-
- @Test
- fun getPanelCount() {
- assertThat(dp.panelCount).isEqualTo(1)
- }
-
- @Test
- fun isVerticalBarLayout() {
- assertThat(dp.isVerticalBarLayout).isEqualTo(false)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkTop() {
- assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(208)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkBottom() {
- assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1244)
- }
-
- @Test
- fun getQsbOffsetY() {
- assertThat(dp.qsbOffsetY).isEqualTo(109)
- }
-
- @Test
- fun getTaskbarOffsetY() {
- assertThat(dp.taskbarOffsetY).isEqualTo(112)
- }
-
- @Test
- fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(301)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(-7)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(301)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
- }
-}
\ 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
deleted file mode 100644
index eed3598..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortrait3ButtonTest.kt
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * 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.quickstep
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.launcher3.DeviceProfile
-import com.android.launcher3.DeviceProfileBaseTest
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Tests for DeviceProfile for tablet in portrait with 3-Button navigation.
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class DeviceProfileTabletPortrait3ButtonTest : DeviceProfileBaseTest() {
-
- lateinit var dp: DeviceProfile
-
- @Before
- fun before() {
- initializeVarsForTablet(isGestureMode = false)
- dp = newDP()
- }
-
- @Test
- fun isScalableGrid() {
- assertThat(dp.isScalableGrid).isTrue()
- }
-
- @Test
- fun cellWidthPx() {
- assertThat(dp.cellWidthPx).isEqualTo(294)
- }
-
- @Test
- fun cellHeightPx() {
- assertThat(dp.cellHeightPx).isEqualTo(382)
- }
-
- @Test
- fun getCellSizeX() {
- assertThat(dp.cellSize.x).isEqualTo(294)
- }
-
- @Test
- fun getCellSizeY() {
- assertThat(dp.cellSize.y).isEqualTo(482)
- }
-
- @Test
- fun cellLayoutBorderSpacePxX() {
- assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(74)
- }
-
- @Test
- fun cellLayoutBorderSpacePxY() {
- assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(74)
- }
-
- @Test
- fun cellLayoutPaddingPxLeft() {
- assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(72)
- }
-
- @Test
- fun cellLayoutPaddingPxTop() {
- assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxRight() {
- assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(72)
- }
-
- @Test
- fun cellLayoutPaddingPxBottom() {
- assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(72)
- }
-
- @Test
- fun iconSizePx() {
- assertThat(dp.iconSizePx).isEqualTo(112)
- }
-
- @Test
- fun iconTextSizePx() {
- assertThat(dp.iconTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun iconDrawablePaddingPx() {
- assertThat(dp.iconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun folderCellWidthPx() {
- assertThat(dp.folderCellWidthPx).isEqualTo(294)
- }
-
- @Test
- fun folderCellHeightPx() {
- assertThat(dp.folderCellHeightPx).isEqualTo(382)
- }
-
- @Test
- fun folderChildIconSizePx() {
- assertThat(dp.folderChildIconSizePx).isEqualTo(112)
- }
-
- @Test
- fun folderChildTextSizePx() {
- assertThat(dp.folderChildTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun folderChildDrawablePaddingPx() {
- assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(77)
- }
-
- @Test
- fun folderCellLayoutBorderSpaceOriginalPx() {
- assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxX() {
- assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxY() {
- assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun bottomSheetTopPadding() {
- assertThat(dp.bottomSheetTopPadding).isEqualTo(600)
- }
-
- @Test
- fun allAppsShiftRange() {
- assertThat(dp.allAppsShiftRange).isEqualTo(1960)
- }
-
- @Test
- fun allAppsTopPadding() {
- assertThat(dp.allAppsTopPadding).isEqualTo(600)
- }
-
- @Test
- fun allAppsIconSizePx() {
- assertThat(dp.allAppsIconSizePx).isEqualTo(257)
- }
-
- @Test
- fun allAppsIconTextSizePx() {
- assertThat(dp.allAppsIconTextSizePx).isEqualTo(64)
- }
-
- @Test
- fun allAppsIconDrawablePaddingPx() {
- assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun allAppsCellHeightPx() {
- assertThat(dp.allAppsCellHeightPx).isEqualTo(456)
- }
-
- @Test
- fun allAppsCellWidthPx() {
- assertThat(dp.allAppsCellWidthPx).isEqualTo(294)
- }
-
- @Test
- fun allAppsBorderSpacePxX() {
- assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(74)
- }
-
- @Test
- fun allAppsBorderSpacePxY() {
- assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(74)
- }
-
- @Test
- fun numShownAllAppsColumns() {
- assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightPadding() {
- assertThat(dp.allAppsLeftRightPadding).isEqualTo(56)
- }
-
- @Test
- fun allAppsLeftRightMargin() {
- assertThat(dp.allAppsLeftRightMargin).isEqualTo(781)
- }
-
- @Test
- fun hotseatBarSizePx() {
- assertThat(dp.hotseatBarSizePx).isEqualTo(386)
- }
-
- @Test
- fun hotseatCellHeightPx() {
- assertThat(dp.hotseatCellHeightPx).isEqualTo(126)
- }
-
- @Test
- fun hotseatBarBottomSpacePx() {
- assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(116)
- }
-
- @Test
- fun hotseatBarSidePaddingStartPx() {
- assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSidePaddingEndPx() {
- assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatQsbSpace() {
- assertThat(dp.hotseatQsbSpace).isEqualTo(56)
- }
-
- @Test
- fun hotseatQsbHeight() {
- assertThat(dp.hotseatQsbHeight).isEqualTo(126)
- }
-
- @Test
- fun springLoadedHotseatBarTopMarginPx() {
- assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(216)
- }
-
- @Test
- fun numShownHotseatIcons() {
- assertThat(dp.numShownHotseatIcons).isEqualTo(4)
- }
-
- @Test
- fun hotseatBorderSpace() {
- assertThat(dp.hotseatBorderSpace).isEqualTo(32)
- }
-
- @Test
- fun isQsbInline() {
- assertThat(dp.isQsbInline).isEqualTo(false)
- }
-
- @Test
- fun qsbWidth() {
- assertThat(dp.qsbWidth).isEqualTo(1216)
- }
-
- @Test
- fun isTaskbarPresent() {
- assertThat(dp.isTaskbarPresent).isEqualTo(true)
- }
-
- @Test
- fun isTaskbarPresentInApps() {
- assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
- }
-
- @Test
- fun taskbarSize() {
- assertThat(dp.taskbarSize).isEqualTo(120)
- }
-
- @Test
- fun desiredWorkspaceHorizontalMarginPx() {
- assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(101)
- }
-
- @Test
- fun workspacePaddingLeft() {
- assertThat(dp.workspacePadding.left).isEqualTo(29)
- }
-
- @Test
- fun workspacePaddingTop() {
- assertThat(dp.workspacePadding.top).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingRight() {
- assertThat(dp.workspacePadding.right).isEqualTo(29)
- }
-
- @Test
- fun workspacePaddingBottom() {
- assertThat(dp.workspacePadding.bottom).isEqualTo(238)
- }
-
- @Test
- fun iconScale() {
- assertThat(dp.iconScale).isEqualTo(1)
- }
-
- @Test
- fun cellScaleToFit() {
- assertThat(dp.cellScaleToFit).isEqualTo(2.2988505f)
- }
-
- @Test
- fun workspaceTopPadding() {
- assertThat(dp.workspaceTopPadding).isEqualTo(0)
- }
-
- @Test
- fun workspaceBottomPadding() {
- assertThat(dp.workspaceBottomPadding).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskMarginPx() {
- assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskMarginGridPx() {
- assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskIconSizePx() {
- assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
- }
-
- @Test
- fun overviewTaskIconDrawableSizePx() {
- assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskIconDrawableSizeGridPx() {
- assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskThumbnailTopMarginPx() {
- assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
- }
-
- @Test
- fun overviewActionsTopMarginPx() {
- assertThat(dp.overviewActionsTopMarginPx).isEqualTo(48)
- }
-
- @Test
- fun overviewActionsHeight() {
- assertThat(dp.overviewActionsHeight).isEqualTo(96)
- }
-
- @Test
- fun overviewActionsButtonSpacing() {
- assertThat(dp.overviewActionsButtonSpacing).isEqualTo(72)
- }
-
- @Test
- fun overviewPageSpacing() {
- assertThat(dp.overviewPageSpacing).isEqualTo(88)
- }
-
- @Test
- fun overviewRowSpacing() {
- assertThat(dp.overviewRowSpacing).isEqualTo(40)
- }
-
- @Test
- fun overviewGridSideMargin() {
- assertThat(dp.overviewGridSideMargin).isEqualTo(128)
- }
-
- @Test
- fun dropTargetBarTopMarginPx() {
- assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(220)
- }
-
- @Test
- fun dropTargetBarSizePx() {
- assertThat(dp.dropTargetBarSizePx).isEqualTo(144)
- }
-
- @Test
- fun dropTargetBarBottomMarginPx() {
- assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(96)
- }
-
- @Test
- fun workspaceSpringLoadedMinNextPageVisiblePx() {
- assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(48)
- }
-
- @Test
- fun getWorkspaceSpringLoadScale() {
- assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.6741674f)
- }
-
- @Test
- fun getCellLayoutHeight() {
- assertThat(dp.cellLayoutHeight).isEqualTo(2222)
- }
-
- @Test
- fun getCellLayoutWidth() {
- assertThat(dp.cellLayoutWidth).isEqualTo(1542)
- }
-
- @Test
- fun getPanelCount() {
- assertThat(dp.panelCount).isEqualTo(1)
- }
-
- @Test
- fun isVerticalBarLayout() {
- assertThat(dp.isVerticalBarLayout).isEqualTo(false)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkTop() {
- assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(460)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkBottom() {
- assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1958)
- }
-
- @Test
- fun getQsbOffsetY() {
- assertThat(dp.qsbOffsetY).isEqualTo(272)
- }
-
- @Test
- fun getTaskbarOffsetY() {
- assertThat(dp.taskbarOffsetY).isEqualTo(112)
- }
-
- @Test
- fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(528)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(151)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(528)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- 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
deleted file mode 100644
index 4be3e45..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortraitTest.kt
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * 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.quickstep
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.launcher3.DeviceProfile
-import com.android.launcher3.DeviceProfileBaseTest
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Tests for DeviceProfile for tablet in portrait.
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class DeviceProfileTabletPortraitTest : DeviceProfileBaseTest() {
-
- lateinit var dp: DeviceProfile
-
- @Before
- fun before() {
- initializeVarsForTablet()
- dp = newDP()
- }
-
- @Test
- fun isScalableGrid() {
- assertThat(dp.isScalableGrid).isTrue()
- }
-
- @Test
- fun cellWidthPx() {
- assertThat(dp.cellWidthPx).isEqualTo(294)
- }
-
- @Test
- fun cellHeightPx() {
- assertThat(dp.cellHeightPx).isEqualTo(382)
- }
-
- @Test
- fun getCellSizeX() {
- assertThat(dp.cellSize.x).isEqualTo(294)
- }
-
- @Test
- fun getCellSizeY() {
- assertThat(dp.cellSize.y).isEqualTo(482)
- }
-
- @Test
- fun cellLayoutBorderSpacePxX() {
- assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(74)
- }
-
- @Test
- fun cellLayoutBorderSpacePxY() {
- assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(74)
- }
-
- @Test
- fun cellLayoutPaddingPxLeft() {
- assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(72)
- }
-
- @Test
- fun cellLayoutPaddingPxTop() {
- assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxRight() {
- assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(72)
- }
-
- @Test
- fun cellLayoutPaddingPxBottom() {
- assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(72)
- }
-
- @Test
- fun iconSizePx() {
- assertThat(dp.iconSizePx).isEqualTo(112)
- }
-
- @Test
- fun iconTextSizePx() {
- assertThat(dp.iconTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun iconDrawablePaddingPx() {
- assertThat(dp.iconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun folderCellWidthPx() {
- assertThat(dp.folderCellWidthPx).isEqualTo(294)
- }
-
- @Test
- fun folderCellHeightPx() {
- assertThat(dp.folderCellHeightPx).isEqualTo(382)
- }
-
- @Test
- fun folderChildIconSizePx() {
- assertThat(dp.folderChildIconSizePx).isEqualTo(112)
- }
-
- @Test
- fun folderChildTextSizePx() {
- assertThat(dp.folderChildTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun folderChildDrawablePaddingPx() {
- assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(77)
- }
-
- @Test
- fun folderCellLayoutBorderSpaceOriginalPx() {
- assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxX() {
- assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxY() {
- assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun bottomSheetTopPadding() {
- assertThat(dp.bottomSheetTopPadding).isEqualTo(600)
- }
-
- @Test
- fun allAppsShiftRange() {
- assertThat(dp.allAppsShiftRange).isEqualTo(1960)
- }
-
- @Test
- fun allAppsTopPadding() {
- assertThat(dp.allAppsTopPadding).isEqualTo(600)
- }
-
- @Test
- fun allAppsIconSizePx() {
- assertThat(dp.allAppsIconSizePx).isEqualTo(257)
- }
-
- @Test
- fun allAppsIconTextSizePx() {
- assertThat(dp.allAppsIconTextSizePx).isEqualTo(64)
- }
-
- @Test
- fun allAppsIconDrawablePaddingPx() {
- assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun allAppsCellHeightPx() {
- assertThat(dp.allAppsCellHeightPx).isEqualTo(456)
- }
-
- @Test
- fun allAppsCellWidthPx() {
- assertThat(dp.allAppsCellWidthPx).isEqualTo(294)
- }
-
- @Test
- fun allAppsBorderSpacePxX() {
- assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(74)
- }
-
- @Test
- fun allAppsBorderSpacePxY() {
- assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(74)
- }
-
- @Test
- fun numShownAllAppsColumns() {
- assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightPadding() {
- assertThat(dp.allAppsLeftRightPadding).isEqualTo(56)
- }
-
- @Test
- fun allAppsLeftRightMargin() {
- assertThat(dp.allAppsLeftRightMargin).isEqualTo(781)
- }
-
- @Test
- fun hotseatBarSizePx() {
- assertThat(dp.hotseatBarSizePx).isEqualTo(386)
- }
-
- @Test
- fun hotseatCellHeightPx() {
- assertThat(dp.hotseatCellHeightPx).isEqualTo(126)
- }
-
- @Test
- fun hotseatBarBottomSpacePx() {
- assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(116)
- }
-
- @Test
- fun hotseatBarSidePaddingStartPx() {
- assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSidePaddingEndPx() {
- assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatQsbSpace() {
- assertThat(dp.hotseatQsbSpace).isEqualTo(56)
- }
-
- @Test
- fun hotseatQsbHeight() {
- assertThat(dp.hotseatQsbHeight).isEqualTo(126)
- }
-
- @Test
- fun springLoadedHotseatBarTopMarginPx() {
- assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(216)
- }
-
- @Test
- fun numShownHotseatIcons() {
- assertThat(dp.numShownHotseatIcons).isEqualTo(4)
- }
-
- @Test
- fun hotseatBorderSpace() {
- assertThat(dp.hotseatBorderSpace).isEqualTo(256)
- }
-
- @Test
- fun isQsbInline() {
- assertThat(dp.isQsbInline).isEqualTo(false)
- }
-
- @Test
- fun qsbWidth() {
- assertThat(dp.qsbWidth).isEqualTo(1216)
- }
-
- @Test
- fun isTaskbarPresent() {
- assertThat(dp.isTaskbarPresent).isEqualTo(true)
- }
-
- @Test
- fun isTaskbarPresentInApps() {
- assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
- }
-
- @Test
- fun taskbarSize() {
- assertThat(dp.taskbarSize).isEqualTo(120)
- }
-
- @Test
- fun desiredWorkspaceHorizontalMarginPx() {
- assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(101)
- }
-
- @Test
- fun workspacePaddingLeft() {
- assertThat(dp.workspacePadding.left).isEqualTo(29)
- }
-
- @Test
- fun workspacePaddingTop() {
- assertThat(dp.workspacePadding.top).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingRight() {
- assertThat(dp.workspacePadding.right).isEqualTo(29)
- }
-
- @Test
- fun workspacePaddingBottom() {
- assertThat(dp.workspacePadding.bottom).isEqualTo(238)
- }
-
- @Test
- fun iconScale() {
- assertThat(dp.iconScale).isEqualTo(1)
- }
-
- @Test
- fun cellScaleToFit() {
- assertThat(dp.cellScaleToFit).isEqualTo(2.2988505f)
- }
-
- @Test
- fun workspaceTopPadding() {
- assertThat(dp.workspaceTopPadding).isEqualTo(0)
- }
-
- @Test
- fun workspaceBottomPadding() {
- assertThat(dp.workspaceBottomPadding).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskMarginPx() {
- assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskMarginGridPx() {
- assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskIconSizePx() {
- assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
- }
-
- @Test
- fun overviewTaskIconDrawableSizePx() {
- assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskIconDrawableSizeGridPx() {
- assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskThumbnailTopMarginPx() {
- assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
- }
-
- @Test
- fun overviewActionsTopMarginPx() {
- assertThat(dp.overviewActionsTopMarginPx).isEqualTo(48)
- }
-
- @Test
- fun overviewActionsHeight() {
- assertThat(dp.overviewActionsHeight).isEqualTo(96)
- }
-
- @Test
- fun overviewActionsButtonSpacing() {
- assertThat(dp.overviewActionsButtonSpacing).isEqualTo(72)
- }
-
- @Test
- fun overviewPageSpacing() {
- assertThat(dp.overviewPageSpacing).isEqualTo(88)
- }
-
- @Test
- fun overviewRowSpacing() {
- assertThat(dp.overviewRowSpacing).isEqualTo(40)
- }
-
- @Test
- fun overviewGridSideMargin() {
- assertThat(dp.overviewGridSideMargin).isEqualTo(128)
- }
-
- @Test
- fun dropTargetBarTopMarginPx() {
- assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(220)
- }
-
- @Test
- fun dropTargetBarSizePx() {
- assertThat(dp.dropTargetBarSizePx).isEqualTo(144)
- }
-
- @Test
- fun dropTargetBarBottomMarginPx() {
- assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(96)
- }
-
- @Test
- fun workspaceSpringLoadedMinNextPageVisiblePx() {
- assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(48)
- }
-
- @Test
- fun getWorkspaceSpringLoadScale() {
- assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.6741674f)
- }
-
- @Test
- fun getCellLayoutHeight() {
- assertThat(dp.cellLayoutHeight).isEqualTo(2222)
- }
-
- @Test
- fun getCellLayoutWidth() {
- assertThat(dp.cellLayoutWidth).isEqualTo(1542)
- }
-
- @Test
- fun getPanelCount() {
- assertThat(dp.panelCount).isEqualTo(1)
- }
-
- @Test
- fun isVerticalBarLayout() {
- assertThat(dp.isVerticalBarLayout).isEqualTo(false)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkTop() {
- assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(460)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkBottom() {
- assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1958)
- }
-
- @Test
- fun getQsbOffsetY() {
- assertThat(dp.qsbOffsetY).isEqualTo(272)
- }
-
- @Test
- fun getTaskbarOffsetY() {
- assertThat(dp.taskbarOffsetY).isEqualTo(112)
- }
-
- @Test
- fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(192)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(151)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(192)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
- }
-}
\ No newline at end of file
diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTest.kt
new file mode 100644
index 0000000..1208a2a
--- /dev/null
+++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTest.kt
@@ -0,0 +1,1467 @@
+/*
+ * 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.quickstep
+
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.launcher3.DeviceProfileBaseTest
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.junit.runner.RunWith
+
+/**
+ * Tests for DeviceProfile.
+ */
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class DeviceProfileTest : DeviceProfileBaseTest() {
+
+ @Test
+ fun phonePortrait3Button() {
+ initializeVarsForPhone(isGestureMode = false)
+ val dp = newDP()
+
+ assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" +
+ "\t1 dp = 2.625 px\n" +
+ "\tisTablet:false\n" +
+ "\tisPhone:true\n" +
+ "\ttransposeLayoutWithOrientation:true\n" +
+ "\tisGestureMode:false\n" +
+ "\tisLandscape:false\n" +
+ "\tisMultiWindowMode:false\n" +
+ "\tisTwoPanels:false\n" +
+ "\twindowX: 0.0px (0.0dp)\n" +
+ "\twindowY: 0.0px (0.0dp)\n" +
+ "\twidthPx: 1080.0px (411.42856dp)\n" +
+ "\theightPx: 2400.0px (914.2857dp)\n" +
+ "\tavailableWidthPx: 1080.0px (411.42856dp)\n" +
+ "\tavailableHeightPx: 2156.0px (821.3333dp)\n" +
+ "\tmInsets.left: 0.0px (0.0dp)\n" +
+ "\tmInsets.top: 118.0px (44.95238dp)\n" +
+ "\tmInsets.right: 0.0px (0.0dp)\n" +
+ "\tmInsets.bottom: 126.0px (48.0dp)\n" +
+ "\taspectRatio:2.2222223\n" +
+ "\tisScalableGrid:true\n" +
+ "\tinv.numRows: 5\n" +
+ "\tinv.numColumns: 4\n" +
+ "\tinv.numSearchContainerColumns: 4\n" +
+ "\tminCellSize: PointF(80.0, 104.0)dp\n" +
+ "\tcellWidthPx: 210.0px (80.0dp)\n" +
+ "\tcellHeightPx: 272.0px (103.61905dp)\n" +
+ "\tgetCellSize().x: 210.0px (80.0dp)\n" +
+ "\tgetCellSize().y: 272.0px (103.61905dp)\n" +
+ "\tcellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
+ "\tcellLayoutPaddingPx.left: 28.0px (10.666667dp)\n" +
+ "\tcellLayoutPaddingPx.top: 28.0px (10.666667dp)\n" +
+ "\tcellLayoutPaddingPx.right: 28.0px (10.666667dp)\n" +
+ "\tcellLayoutPaddingPx.bottom: 28.0px (10.666667dp)\n" +
+ "\ticonSizePx: 157.0px (59.809525dp)\n" +
+ "\ticonTextSizePx: 36.0px (13.714286dp)\n" +
+ "\ticonDrawablePaddingPx: 17.0px (6.4761906dp)\n" +
+ "\tfolderCellWidthPx: 210.0px (80.0dp)\n" +
+ "\tfolderCellHeightPx: 272.0px (103.61905dp)\n" +
+ "\tfolderChildIconSizePx: 158.0px (60.190475dp)\n" +
+ "\tfolderChildTextSizePx: 37.0px (14.095238dp)\n" +
+ "\tfolderChildDrawablePaddingPx: 21.0px (8.0dp)\n" +
+ "\tfolderCellLayoutBorderSpaceOriginalPx: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
+ "\tbottomSheetTopPadding: 146.0px (55.61905dp)\n" +
+ "\tallAppsShiftRange: 788.0px (300.1905dp)\n" +
+ "\tallAppsTopPadding: 0.0px (0.0dp)\n" +
+ "\tallAppsIconSizePx: 157.0px (59.809525dp)\n" +
+ "\tallAppsIconTextSizePx: 37.0px (14.095238dp)\n" +
+ "\tallAppsIconDrawablePaddingPx: 18.0px (6.857143dp)\n" +
+ "\tallAppsCellHeightPx: 314.0px (119.61905dp)\n" +
+ "\tallAppsCellWidthPx: 210.0px (80.0dp)\n" +
+ "\tallAppsBorderSpacePxX: 42.0px (16.0dp)\n" +
+ "\tallAppsBorderSpacePxY: 42.0px (16.0dp)\n" +
+ "\tnumShownAllAppsColumns: 4\n" +
+ "\tallAppsLeftRightPadding: 57.0px (21.714285dp)\n" +
+ "\tallAppsLeftRightMargin: 0.0px (0.0dp)\n" +
+ "\thotseatBarSizePx: 511.0px (194.66667dp)\n" +
+ "\tinv.hotseatColumnSpan: 4\n" +
+ "\thotseatCellHeightPx: 177.0px (67.42857dp)\n" +
+ "\thotseatBarBottomSpacePx: 147.0px (56.0dp)\n" +
+ "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarEndOffset: 0.0px (0.0dp)\n" +
+ "\thotseatQsbSpace: 74.0px (28.190475dp)\n" +
+ "\thotseatQsbHeight: 165.0px (62.857143dp)\n" +
+ "\tspringLoadedHotseatBarTopMarginPx: 200.0px (76.190475dp)\n" +
+ "\tgetHotseatLayoutPadding(context).top: 0.0px (0.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).bottom: 334.0px (127.2381dp)\n" +
+ "\tgetHotseatLayoutPadding(context).left: 83.0px (31.619047dp)\n" +
+ "\tgetHotseatLayoutPadding(context).right: 83.0px (31.619047dp)\n" +
+ "\tnumShownHotseatIcons: 4\n" +
+ "\thotseatBorderSpace: 95.0px (36.190475dp)\n" +
+ "\tisQsbInline: false\n" +
+ "\tqsbWidth: 913.0px (347.8095dp)\n" +
+ "\tisTaskbarPresent:false\n" +
+ "\tisTaskbarPresentInApps:false\n" +
+ "\ttaskbarSize: 0.0px (0.0dp)\n" +
+ "\tdesiredWorkspaceHorizontalMarginPx: 57.0px (21.714285dp)\n" +
+ "\tworkspacePadding.left: 29.0px (11.047619dp)\n" +
+ "\tworkspacePadding.top: 67.0px (25.52381dp)\n" +
+ "\tworkspacePadding.right: 29.0px (11.047619dp)\n" +
+ "\tworkspacePadding.bottom: 504.0px (192.0dp)\n" +
+ "\ticonScale: 0.9981516px (0.38024822dp)\n" +
+ "\tcellScaleToFit : 0.9981516px (0.38024822dp)\n" +
+ "\textraSpace: 211.0px (80.38095dp)\n" +
+ "\tunscaled extraSpace: 211.39073px (80.5298dp)\n" +
+ "\tmaxEmptySpace: 315.0px (120.0dp)\n" +
+ "\tworkspaceTopPadding: 95.0px (36.190475dp)\n" +
+ "\tworkspaceBottomPadding: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskMarginPx: 42.0px (16.0dp)\n" +
+ "\toverviewTaskIconSizePx: 126.0px (48.0dp)\n" +
+ "\toverviewTaskIconDrawableSizePx: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskIconDrawableSizeGridPx: 0.0px (0.0dp)\n" +
+ "\toverviewTaskThumbnailTopMarginPx: 168.0px (64.0dp)\n" +
+ "\toverviewActionsTopMarginPx: 63.0px (24.0dp)\n" +
+ "\toverviewActionsHeight: 126.0px (48.0dp)\n" +
+ "\toverviewActionsButtonSpacing: 95.0px (36.190475dp)\n" +
+ "\toverviewPageSpacing: 42.0px (16.0dp)\n" +
+ "\toverviewRowSpacing: 0.0px (0.0dp)\n" +
+ "\toverviewGridSideMargin: 0.0px (0.0dp)\n" +
+ "\tdropTargetBarTopMarginPx: 84.0px (32.0dp)\n" +
+ "\tdropTargetBarSizePx: 147.0px (56.0dp)\n" +
+ "\tdropTargetBarBottomMarginPx: 42.0px (16.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkTop(): 391.0px (148.95238dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkBottom(): 1689.0px (643.4286dp)\n" +
+ "\tworkspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp)\n" +
+ "\tgetWorkspaceSpringLoadScale(): 0.81892747px (0.31197238dp)\n" +
+ "\tgetCellLayoutHeight(): 1585.0px (603.8095dp)\n" +
+ "\tgetCellLayoutWidth(): 1022.0px (389.33334dp)\n")
+ }
+
+ @Test
+ fun phonePortrait() {
+ initializeVarsForPhone()
+ val dp = newDP()
+
+ assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" +
+ "\t1 dp = 2.625 px\n" +
+ "\tisTablet:false\n" +
+ "\tisPhone:true\n" +
+ "\ttransposeLayoutWithOrientation:true\n" +
+ "\tisGestureMode:true\n" +
+ "\tisLandscape:false\n" +
+ "\tisMultiWindowMode:false\n" +
+ "\tisTwoPanels:false\n" +
+ "\twindowX: 0.0px (0.0dp)\n" +
+ "\twindowY: 0.0px (0.0dp)\n" +
+ "\twidthPx: 1080.0px (411.42856dp)\n" +
+ "\theightPx: 2400.0px (914.2857dp)\n" +
+ "\tavailableWidthPx: 1080.0px (411.42856dp)\n" +
+ "\tavailableHeightPx: 2219.0px (845.3333dp)\n" +
+ "\tmInsets.left: 0.0px (0.0dp)\n" +
+ "\tmInsets.top: 118.0px (44.95238dp)\n" +
+ "\tmInsets.right: 0.0px (0.0dp)\n" +
+ "\tmInsets.bottom: 63.0px (24.0dp)\n" +
+ "\taspectRatio:2.2222223\n" +
+ "\tisScalableGrid:true\n" +
+ "\tinv.numRows: 5\n" +
+ "\tinv.numColumns: 4\n" +
+ "\tinv.numSearchContainerColumns: 4\n" +
+ "\tminCellSize: PointF(80.0, 104.0)dp\n" +
+ "\tcellWidthPx: 210.0px (80.0dp)\n" +
+ "\tcellHeightPx: 272.0px (103.61905dp)\n" +
+ "\tgetCellSize().x: 210.0px (80.0dp)\n" +
+ "\tgetCellSize().y: 272.0px (103.61905dp)\n" +
+ "\tcellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
+ "\tcellLayoutPaddingPx.left: 28.0px (10.666667dp)\n" +
+ "\tcellLayoutPaddingPx.top: 28.0px (10.666667dp)\n" +
+ "\tcellLayoutPaddingPx.right: 28.0px (10.666667dp)\n" +
+ "\tcellLayoutPaddingPx.bottom: 28.0px (10.666667dp)\n" +
+ "\ticonSizePx: 157.0px (59.809525dp)\n" +
+ "\ticonTextSizePx: 36.0px (13.714286dp)\n" +
+ "\ticonDrawablePaddingPx: 17.0px (6.4761906dp)\n" +
+ "\tfolderCellWidthPx: 210.0px (80.0dp)\n" +
+ "\tfolderCellHeightPx: 272.0px (103.61905dp)\n" +
+ "\tfolderChildIconSizePx: 158.0px (60.190475dp)\n" +
+ "\tfolderChildTextSizePx: 37.0px (14.095238dp)\n" +
+ "\tfolderChildDrawablePaddingPx: 21.0px (8.0dp)\n" +
+ "\tfolderCellLayoutBorderSpaceOriginalPx: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
+ "\tbottomSheetTopPadding: 146.0px (55.61905dp)\n" +
+ "\tallAppsShiftRange: 788.0px (300.1905dp)\n" +
+ "\tallAppsTopPadding: 0.0px (0.0dp)\n" +
+ "\tallAppsIconSizePx: 157.0px (59.809525dp)\n" +
+ "\tallAppsIconTextSizePx: 37.0px (14.095238dp)\n" +
+ "\tallAppsIconDrawablePaddingPx: 18.0px (6.857143dp)\n" +
+ "\tallAppsCellHeightPx: 314.0px (119.61905dp)\n" +
+ "\tallAppsCellWidthPx: 210.0px (80.0dp)\n" +
+ "\tallAppsBorderSpacePxX: 42.0px (16.0dp)\n" +
+ "\tallAppsBorderSpacePxY: 42.0px (16.0dp)\n" +
+ "\tnumShownAllAppsColumns: 4\n" +
+ "\tallAppsLeftRightPadding: 57.0px (21.714285dp)\n" +
+ "\tallAppsLeftRightMargin: 0.0px (0.0dp)\n" +
+ "\thotseatBarSizePx: 511.0px (194.66667dp)\n" +
+ "\tinv.hotseatColumnSpan: 4\n" +
+ "\thotseatCellHeightPx: 177.0px (67.42857dp)\n" +
+ "\thotseatBarBottomSpacePx: 126.0px (48.0dp)\n" +
+ "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarEndOffset: 0.0px (0.0dp)\n" +
+ "\thotseatQsbSpace: 95.0px (36.190475dp)\n" +
+ "\thotseatQsbHeight: 165.0px (62.857143dp)\n" +
+ "\tspringLoadedHotseatBarTopMarginPx: 200.0px (76.190475dp)\n" +
+ "\tgetHotseatLayoutPadding(context).top: 0.0px (0.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).bottom: 334.0px (127.2381dp)\n" +
+ "\tgetHotseatLayoutPadding(context).left: 83.0px (31.619047dp)\n" +
+ "\tgetHotseatLayoutPadding(context).right: 83.0px (31.619047dp)\n" +
+ "\tnumShownHotseatIcons: 4\n" +
+ "\thotseatBorderSpace: 95.0px (36.190475dp)\n" +
+ "\tisQsbInline: false\n" +
+ "\tqsbWidth: 913.0px (347.8095dp)\n" +
+ "\tisTaskbarPresent:false\n" +
+ "\tisTaskbarPresentInApps:false\n" +
+ "\ttaskbarSize: 0.0px (0.0dp)\n" +
+ "\tdesiredWorkspaceHorizontalMarginPx: 57.0px (21.714285dp)\n" +
+ "\tworkspacePadding.left: 29.0px (11.047619dp)\n" +
+ "\tworkspacePadding.top: 67.0px (25.52381dp)\n" +
+ "\tworkspacePadding.right: 29.0px (11.047619dp)\n" +
+ "\tworkspacePadding.bottom: 567.0px (216.0dp)\n" +
+ "\ticonScale: 0.9981516px (0.38024822dp)\n" +
+ "\tcellScaleToFit : 0.9981516px (0.38024822dp)\n" +
+ "\textraSpace: 211.0px (80.38095dp)\n" +
+ "\tunscaled extraSpace: 211.39073px (80.5298dp)\n" +
+ "\tmaxEmptySpace: 315.0px (120.0dp)\n" +
+ "\tworkspaceTopPadding: 95.0px (36.190475dp)\n" +
+ "\tworkspaceBottomPadding: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskMarginPx: 42.0px (16.0dp)\n" +
+ "\toverviewTaskIconSizePx: 126.0px (48.0dp)\n" +
+ "\toverviewTaskIconDrawableSizePx: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskIconDrawableSizeGridPx: 0.0px (0.0dp)\n" +
+ "\toverviewTaskThumbnailTopMarginPx: 168.0px (64.0dp)\n" +
+ "\toverviewActionsTopMarginPx: 63.0px (24.0dp)\n" +
+ "\toverviewActionsHeight: 126.0px (48.0dp)\n" +
+ "\toverviewActionsButtonSpacing: 95.0px (36.190475dp)\n" +
+ "\toverviewPageSpacing: 42.0px (16.0dp)\n" +
+ "\toverviewRowSpacing: 0.0px (0.0dp)\n" +
+ "\toverviewGridSideMargin: 0.0px (0.0dp)\n" +
+ "\tdropTargetBarTopMarginPx: 84.0px (32.0dp)\n" +
+ "\tdropTargetBarSizePx: 147.0px (56.0dp)\n" +
+ "\tdropTargetBarBottomMarginPx: 42.0px (16.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkTop(): 391.0px (148.95238dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkBottom(): 1689.0px (643.4286dp)\n" +
+ "\tworkspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp)\n" +
+ "\tgetWorkspaceSpringLoadScale(): 0.81892747px (0.31197238dp)\n" +
+ "\tgetCellLayoutHeight(): 1585.0px (603.8095dp)\n" +
+ "\tgetCellLayoutWidth(): 1022.0px (389.33334dp)\n")
+ }
+
+ @Test
+ fun tabletLandscape3Button() {
+ initializeVarsForTablet(isLandscape = true, isGestureMode = false)
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" +
+ "\t1 dp = 2.0 px\n" +
+ "\tisTablet:true\n" +
+ "\tisPhone:false\n" +
+ "\ttransposeLayoutWithOrientation:false\n" +
+ "\tisGestureMode:false\n" +
+ "\tisLandscape:true\n" +
+ "\tisMultiWindowMode:false\n" +
+ "\tisTwoPanels:false\n" +
+ "\twindowX: 0.0px (0.0dp)\n" +
+ "\twindowY: 0.0px (0.0dp)\n" +
+ "\twidthPx: 2560.0px (1280.0dp)\n" +
+ "\theightPx: 1600.0px (800.0dp)\n" +
+ "\tavailableWidthPx: 2560.0px (1280.0dp)\n" +
+ "\tavailableHeightPx: 1496.0px (748.0dp)\n" +
+ "\tmInsets.left: 0.0px (0.0dp)\n" +
+ "\tmInsets.top: 104.0px (52.0dp)\n" +
+ "\tmInsets.right: 0.0px (0.0dp)\n" +
+ "\tmInsets.bottom: 0.0px (0.0dp)\n" +
+ "\taspectRatio:1.6\n" +
+ "\tisScalableGrid:true\n" +
+ "\tinv.numRows: 5\n" +
+ "\tinv.numColumns: 6\n" +
+ "\tinv.numSearchContainerColumns: 3\n" +
+ "\tminCellSize: PointF(120.0, 104.0)dp\n" +
+ "\tcellWidthPx: 240.0px (120.0dp)\n" +
+ "\tcellHeightPx: 208.0px (104.0dp)\n" +
+ "\tgetCellSize().x: 240.0px (120.0dp)\n" +
+ "\tgetCellSize().y: 208.0px (104.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Horizontal: 128.0px (64.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Vertical: 32.0px (16.0dp)\n" +
+ "\tcellLayoutPaddingPx.left: 59.0px (29.5dp)\n" +
+ "\tcellLayoutPaddingPx.top: 32.0px (16.0dp)\n" +
+ "\tcellLayoutPaddingPx.right: 59.0px (29.5dp)\n" +
+ "\tcellLayoutPaddingPx.bottom: 59.0px (29.5dp)\n" +
+ "\ticonSizePx: 120.0px (60.0dp)\n" +
+ "\ticonTextSizePx: 28.0px (14.0dp)\n" +
+ "\ticonDrawablePaddingPx: 14.0px (7.0dp)\n" +
+ "\tfolderCellWidthPx: 240.0px (120.0dp)\n" +
+ "\tfolderCellHeightPx: 208.0px (104.0dp)\n" +
+ "\tfolderChildIconSizePx: 120.0px (60.0dp)\n" +
+ "\tfolderChildTextSizePx: 28.0px (14.0dp)\n" +
+ "\tfolderChildDrawablePaddingPx: 16.0px (8.0dp)\n" +
+ "\tfolderCellLayoutBorderSpaceOriginalPx: 0.0px (0.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)\n" +
+ "\tbottomSheetTopPadding: 104.0px (52.0dp)\n" +
+ "\tallAppsShiftRange: 1496.0px (748.0dp)\n" +
+ "\tallAppsTopPadding: 104.0px (52.0dp)\n" +
+ "\tallAppsIconSizePx: 120.0px (60.0dp)\n" +
+ "\tallAppsIconTextSizePx: 28.0px (14.0dp)\n" +
+ "\tallAppsIconDrawablePaddingPx: 14.0px (7.0dp)\n" +
+ "\tallAppsCellHeightPx: 284.0px (142.0dp)\n" +
+ "\tallAppsCellWidthPx: 252.0px (126.0dp)\n" +
+ "\tallAppsBorderSpacePxX: 32.0px (16.0dp)\n" +
+ "\tallAppsBorderSpacePxY: 32.0px (16.0dp)\n" +
+ "\tnumShownAllAppsColumns: 6\n" +
+ "\tallAppsLeftRightPadding: 64.0px (32.0dp)\n" +
+ "\tallAppsLeftRightMargin: 380.0px (190.0dp)\n" +
+ "\thotseatBarSizePx: 200.0px (100.0dp)\n" +
+ "\tinv.hotseatColumnSpan: 4\n" +
+ "\thotseatCellHeightPx: 135.0px (67.5dp)\n" +
+ "\thotseatBarBottomSpacePx: 80.0px (40.0dp)\n" +
+ "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarEndOffset: 597.0px (298.5dp)\n" +
+ "\thotseatQsbSpace: 64.0px (32.0dp)\n" +
+ "\thotseatQsbHeight: 126.0px (63.0dp)\n" +
+ "\tspringLoadedHotseatBarTopMarginPx: 128.0px (64.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).top: -8.0px (-4.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).bottom: 73.0px (36.5dp)\n" +
+ "\tgetHotseatLayoutPadding(context).left: 959.0px (479.5dp)\n" +
+ "\tgetHotseatLayoutPadding(context).right: 597.0px (298.5dp)\n" +
+ "\tnumShownHotseatIcons: 5\n" +
+ "\thotseatBorderSpace: 101.0px (50.5dp)\n" +
+ "\tisQsbInline: true\n" +
+ "\tqsbWidth: 855.0px (427.5dp)\n" +
+ "\tisTaskbarPresent:true\n" +
+ "\tisTaskbarPresentInApps:true\n" +
+ "\ttaskbarSize: 120.0px (60.0dp)\n" +
+ "\tdesiredWorkspaceHorizontalMarginPx: 240.0px (120.0dp)\n" +
+ "\tworkspacePadding.left: 181.0px (90.5dp)\n" +
+ "\tworkspacePadding.top: 0.0px (0.0dp)\n" +
+ "\tworkspacePadding.right: 181.0px (90.5dp)\n" +
+ "\tworkspacePadding.bottom: 237.0px (118.5dp)\n" +
+ "\ticonScale: 1.0px (0.5dp)\n" +
+ "\tcellScaleToFit : 1.0px (0.5dp)\n" +
+ "\textraSpace: 104.0px (52.0dp)\n" +
+ "\tunscaled extraSpace: 104.0px (52.0dp)\n" +
+ "\tmaxEmptySpace: 200.0px (100.0dp)\n" +
+ "\tworkspaceTopPadding: 32.0px (16.0dp)\n" +
+ "\tworkspaceBottomPadding: 72.0px (36.0dp)\n" +
+ "\toverviewTaskMarginPx: 32.0px (16.0dp)\n" +
+ "\toverviewTaskIconSizePx: 96.0px (48.0dp)\n" +
+ "\toverviewTaskIconDrawableSizePx: 88.0px (44.0dp)\n" +
+ "\toverviewTaskIconDrawableSizeGridPx: 88.0px (44.0dp)\n" +
+ "\toverviewTaskThumbnailTopMarginPx: 128.0px (64.0dp)\n" +
+ "\toverviewActionsTopMarginPx: 40.0px (20.0dp)\n" +
+ "\toverviewActionsHeight: 96.0px (48.0dp)\n" +
+ "\toverviewActionsButtonSpacing: 72.0px (36.0dp)\n" +
+ "\toverviewPageSpacing: 88.0px (44.0dp)\n" +
+ "\toverviewRowSpacing: 72.0px (36.0dp)\n" +
+ "\toverviewGridSideMargin: 128.0px (64.0dp)\n" +
+ "\tdropTargetBarTopMarginPx: 0.0px (0.0dp)\n" +
+ "\tdropTargetBarSizePx: 144.0px (72.0dp)\n" +
+ "\tdropTargetBarBottomMarginPx: 64.0px (32.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkTop(): 312.0px (156.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkBottom(): 1272.0px (636.0dp)\n" +
+ "\tworkspaceSpringLoadedMinNextPageVisiblePx: 48.0px (24.0dp)\n" +
+ "\tgetWorkspaceSpringLoadScale(): 0.76250994px (0.38125497dp)\n" +
+ "\tgetCellLayoutHeight(): 1259.0px (629.5dp)\n" +
+ "\tgetCellLayoutWidth(): 2198.0px (1099.0dp)\n")
+ }
+
+ @Test
+ fun tabletLandscape() {
+ initializeVarsForTablet(isLandscape = true)
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" +
+ "\t1 dp = 2.0 px\n" +
+ "\tisTablet:true\n" +
+ "\tisPhone:false\n" +
+ "\ttransposeLayoutWithOrientation:false\n" +
+ "\tisGestureMode:true\n" +
+ "\tisLandscape:true\n" +
+ "\tisMultiWindowMode:false\n" +
+ "\tisTwoPanels:false\n" +
+ "\twindowX: 0.0px (0.0dp)\n" +
+ "\twindowY: 0.0px (0.0dp)\n" +
+ "\twidthPx: 2560.0px (1280.0dp)\n" +
+ "\theightPx: 1600.0px (800.0dp)\n" +
+ "\tavailableWidthPx: 2560.0px (1280.0dp)\n" +
+ "\tavailableHeightPx: 1496.0px (748.0dp)\n" +
+ "\tmInsets.left: 0.0px (0.0dp)\n" +
+ "\tmInsets.top: 104.0px (52.0dp)\n" +
+ "\tmInsets.right: 0.0px (0.0dp)\n" +
+ "\tmInsets.bottom: 0.0px (0.0dp)\n" +
+ "\taspectRatio:1.6\n" +
+ "\tisScalableGrid:true\n" +
+ "\tinv.numRows: 5\n" +
+ "\tinv.numColumns: 6\n" +
+ "\tinv.numSearchContainerColumns: 3\n" +
+ "\tminCellSize: PointF(120.0, 104.0)dp\n" +
+ "\tcellWidthPx: 240.0px (120.0dp)\n" +
+ "\tcellHeightPx: 208.0px (104.0dp)\n" +
+ "\tgetCellSize().x: 240.0px (120.0dp)\n" +
+ "\tgetCellSize().y: 208.0px (104.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Horizontal: 128.0px (64.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Vertical: 32.0px (16.0dp)\n" +
+ "\tcellLayoutPaddingPx.left: 59.0px (29.5dp)\n" +
+ "\tcellLayoutPaddingPx.top: 32.0px (16.0dp)\n" +
+ "\tcellLayoutPaddingPx.right: 59.0px (29.5dp)\n" +
+ "\tcellLayoutPaddingPx.bottom: 59.0px (29.5dp)\n" +
+ "\ticonSizePx: 120.0px (60.0dp)\n" +
+ "\ticonTextSizePx: 28.0px (14.0dp)\n" +
+ "\ticonDrawablePaddingPx: 14.0px (7.0dp)\n" +
+ "\tfolderCellWidthPx: 240.0px (120.0dp)\n" +
+ "\tfolderCellHeightPx: 208.0px (104.0dp)\n" +
+ "\tfolderChildIconSizePx: 120.0px (60.0dp)\n" +
+ "\tfolderChildTextSizePx: 28.0px (14.0dp)\n" +
+ "\tfolderChildDrawablePaddingPx: 16.0px (8.0dp)\n" +
+ "\tfolderCellLayoutBorderSpaceOriginalPx: 0.0px (0.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)\n" +
+ "\tbottomSheetTopPadding: 104.0px (52.0dp)\n" +
+ "\tallAppsShiftRange: 1496.0px (748.0dp)\n" +
+ "\tallAppsTopPadding: 104.0px (52.0dp)\n" +
+ "\tallAppsIconSizePx: 120.0px (60.0dp)\n" +
+ "\tallAppsIconTextSizePx: 28.0px (14.0dp)\n" +
+ "\tallAppsIconDrawablePaddingPx: 14.0px (7.0dp)\n" +
+ "\tallAppsCellHeightPx: 284.0px (142.0dp)\n" +
+ "\tallAppsCellWidthPx: 252.0px (126.0dp)\n" +
+ "\tallAppsBorderSpacePxX: 32.0px (16.0dp)\n" +
+ "\tallAppsBorderSpacePxY: 32.0px (16.0dp)\n" +
+ "\tnumShownAllAppsColumns: 6\n" +
+ "\tallAppsLeftRightPadding: 64.0px (32.0dp)\n" +
+ "\tallAppsLeftRightMargin: 380.0px (190.0dp)\n" +
+ "\thotseatBarSizePx: 200.0px (100.0dp)\n" +
+ "\tinv.hotseatColumnSpan: 4\n" +
+ "\thotseatCellHeightPx: 135.0px (67.5dp)\n" +
+ "\thotseatBarBottomSpacePx: 80.0px (40.0dp)\n" +
+ "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarEndOffset: 0.0px (0.0dp)\n" +
+ "\thotseatQsbSpace: 64.0px (32.0dp)\n" +
+ "\thotseatQsbHeight: 126.0px (63.0dp)\n" +
+ "\tspringLoadedHotseatBarTopMarginPx: 128.0px (64.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).top: -8.0px (-4.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).bottom: 73.0px (36.5dp)\n" +
+ "\tgetHotseatLayoutPadding(context).left: 1040.0px (520.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).right: 300.0px (150.0dp)\n" +
+ "\tnumShownHotseatIcons: 6\n" +
+ "\thotseatBorderSpace: 100.0px (50.0dp)\n" +
+ "\tisQsbInline: true\n" +
+ "\tqsbWidth: 640.0px (320.0dp)\n" +
+ "\tisTaskbarPresent:true\n" +
+ "\tisTaskbarPresentInApps:true\n" +
+ "\ttaskbarSize: 120.0px (60.0dp)\n" +
+ "\tdesiredWorkspaceHorizontalMarginPx: 240.0px (120.0dp)\n" +
+ "\tworkspacePadding.left: 181.0px (90.5dp)\n" +
+ "\tworkspacePadding.top: 0.0px (0.0dp)\n" +
+ "\tworkspacePadding.right: 181.0px (90.5dp)\n" +
+ "\tworkspacePadding.bottom: 237.0px (118.5dp)\n" +
+ "\ticonScale: 1.0px (0.5dp)\n" +
+ "\tcellScaleToFit : 1.0px (0.5dp)\n" +
+ "\textraSpace: 104.0px (52.0dp)\n" +
+ "\tunscaled extraSpace: 104.0px (52.0dp)\n" +
+ "\tmaxEmptySpace: 200.0px (100.0dp)\n" +
+ "\tworkspaceTopPadding: 32.0px (16.0dp)\n" +
+ "\tworkspaceBottomPadding: 72.0px (36.0dp)\n" +
+ "\toverviewTaskMarginPx: 32.0px (16.0dp)\n" +
+ "\toverviewTaskIconSizePx: 96.0px (48.0dp)\n" +
+ "\toverviewTaskIconDrawableSizePx: 88.0px (44.0dp)\n" +
+ "\toverviewTaskIconDrawableSizeGridPx: 88.0px (44.0dp)\n" +
+ "\toverviewTaskThumbnailTopMarginPx: 128.0px (64.0dp)\n" +
+ "\toverviewActionsTopMarginPx: 40.0px (20.0dp)\n" +
+ "\toverviewActionsHeight: 96.0px (48.0dp)\n" +
+ "\toverviewActionsButtonSpacing: 72.0px (36.0dp)\n" +
+ "\toverviewPageSpacing: 88.0px (44.0dp)\n" +
+ "\toverviewRowSpacing: 72.0px (36.0dp)\n" +
+ "\toverviewGridSideMargin: 128.0px (64.0dp)\n" +
+ "\tdropTargetBarTopMarginPx: 0.0px (0.0dp)\n" +
+ "\tdropTargetBarSizePx: 144.0px (72.0dp)\n" +
+ "\tdropTargetBarBottomMarginPx: 64.0px (32.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkTop(): 312.0px (156.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkBottom(): 1272.0px (636.0dp)\n" +
+ "\tworkspaceSpringLoadedMinNextPageVisiblePx: 48.0px (24.0dp)\n" +
+ "\tgetWorkspaceSpringLoadScale(): 0.76250994px (0.38125497dp)\n" +
+ "\tgetCellLayoutHeight(): 1259.0px (629.5dp)\n" +
+ "\tgetCellLayoutWidth(): 2198.0px (1099.0dp)\n")
+ }
+
+ @Test
+ fun tabletPortrait3Button() {
+ initializeVarsForTablet(isGestureMode = false)
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" +
+ "\t1 dp = 2.0 px\n" +
+ "\tisTablet:true\n" +
+ "\tisPhone:false\n" +
+ "\ttransposeLayoutWithOrientation:false\n" +
+ "\tisGestureMode:false\n" +
+ "\tisLandscape:false\n" +
+ "\tisMultiWindowMode:false\n" +
+ "\tisTwoPanels:false\n" +
+ "\twindowX: 0.0px (0.0dp)\n" +
+ "\twindowY: 0.0px (0.0dp)\n" +
+ "\twidthPx: 1600.0px (800.0dp)\n" +
+ "\theightPx: 2560.0px (1280.0dp)\n" +
+ "\tavailableWidthPx: 1600.0px (800.0dp)\n" +
+ "\tavailableHeightPx: 2456.0px (1228.0dp)\n" +
+ "\tmInsets.left: 0.0px (0.0dp)\n" +
+ "\tmInsets.top: 104.0px (52.0dp)\n" +
+ "\tmInsets.right: 0.0px (0.0dp)\n" +
+ "\tmInsets.bottom: 0.0px (0.0dp)\n" +
+ "\taspectRatio:1.6\n" +
+ "\tisScalableGrid:true\n" +
+ "\tinv.numRows: 5\n" +
+ "\tinv.numColumns: 6\n" +
+ "\tinv.numSearchContainerColumns: 3\n" +
+ "\tminCellSize: PointF(102.0, 120.0)dp\n" +
+ "\tcellWidthPx: 204.0px (102.0dp)\n" +
+ "\tcellHeightPx: 240.0px (120.0dp)\n" +
+ "\tgetCellSize().x: 204.0px (102.0dp)\n" +
+ "\tgetCellSize().y: 240.0px (120.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Horizontal: 32.0px (16.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Vertical: 128.0px (64.0dp)\n" +
+ "\tcellLayoutPaddingPx.left: 72.0px (36.0dp)\n" +
+ "\tcellLayoutPaddingPx.top: 72.0px (36.0dp)\n" +
+ "\tcellLayoutPaddingPx.right: 72.0px (36.0dp)\n" +
+ "\tcellLayoutPaddingPx.bottom: 72.0px (36.0dp)\n" +
+ "\ticonSizePx: 120.0px (60.0dp)\n" +
+ "\ticonTextSizePx: 28.0px (14.0dp)\n" +
+ "\ticonDrawablePaddingPx: 14.0px (7.0dp)\n" +
+ "\tfolderCellWidthPx: 204.0px (102.0dp)\n" +
+ "\tfolderCellHeightPx: 240.0px (120.0dp)\n" +
+ "\tfolderChildIconSizePx: 120.0px (60.0dp)\n" +
+ "\tfolderChildTextSizePx: 28.0px (14.0dp)\n" +
+ "\tfolderChildDrawablePaddingPx: 27.0px (13.5dp)\n" +
+ "\tfolderCellLayoutBorderSpaceOriginalPx: 0.0px (0.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)\n" +
+ "\tbottomSheetTopPadding: 704.0px (352.0dp)\n" +
+ "\tallAppsShiftRange: 1856.0px (928.0dp)\n" +
+ "\tallAppsTopPadding: 704.0px (352.0dp)\n" +
+ "\tallAppsIconSizePx: 120.0px (60.0dp)\n" +
+ "\tallAppsIconTextSizePx: 28.0px (14.0dp)\n" +
+ "\tallAppsIconDrawablePaddingPx: 14.0px (7.0dp)\n" +
+ "\tallAppsCellHeightPx: 316.0px (158.0dp)\n" +
+ "\tallAppsCellWidthPx: 192.0px (96.0dp)\n" +
+ "\tallAppsBorderSpacePxX: 16.0px (8.0dp)\n" +
+ "\tallAppsBorderSpacePxY: 32.0px (16.0dp)\n" +
+ "\tnumShownAllAppsColumns: 6\n" +
+ "\tallAppsLeftRightPadding: 56.0px (28.0dp)\n" +
+ "\tallAppsLeftRightMargin: 128.0px (64.0dp)\n" +
+ "\thotseatBarSizePx: 358.0px (179.0dp)\n" +
+ "\tinv.hotseatColumnSpan: 6\n" +
+ "\thotseatCellHeightPx: 135.0px (67.5dp)\n" +
+ "\thotseatBarBottomSpacePx: 72.0px (36.0dp)\n" +
+ "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarEndOffset: 460.0px (230.0dp)\n" +
+ "\thotseatQsbSpace: 64.0px (32.0dp)\n" +
+ "\thotseatQsbHeight: 126.0px (63.0dp)\n" +
+ "\tspringLoadedHotseatBarTopMarginPx: 216.0px (108.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).top: 158.0px (79.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).bottom: 65.0px (32.5dp)\n" +
+ "\tgetHotseatLayoutPadding(context).left: 76.0px (38.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).right: 460.0px (230.0dp)\n" +
+ "\tnumShownHotseatIcons: 5\n" +
+ "\thotseatBorderSpace: 116.0px (58.0dp)\n" +
+ "\tisQsbInline: false\n" +
+ "\tqsbWidth: 1300.0px (650.0dp)\n" +
+ "\tisTaskbarPresent:true\n" +
+ "\tisTaskbarPresentInApps:true\n" +
+ "\ttaskbarSize: 120.0px (60.0dp)\n" +
+ "\tdesiredWorkspaceHorizontalMarginPx: 108.0px (54.0dp)\n" +
+ "\tworkspacePadding.left: 36.0px (18.0dp)\n" +
+ "\tworkspacePadding.top: 87.0px (43.5dp)\n" +
+ "\tworkspacePadding.right: 36.0px (18.0dp)\n" +
+ "\tworkspacePadding.bottom: 513.0px (256.5dp)\n" +
+ "\ticonScale: 1.0px (0.5dp)\n" +
+ "\tcellScaleToFit : 1.0px (0.5dp)\n" +
+ "\textraSpace: 362.0px (181.0dp)\n" +
+ "\tunscaled extraSpace: 362.0px (181.0dp)\n" +
+ "\tmaxEmptySpace: 19998.0px (9999.0dp)\n" +
+ "\tworkspaceTopPadding: 159.0px (79.5dp)\n" +
+ "\tworkspaceBottomPadding: 203.0px (101.5dp)\n" +
+ "\toverviewTaskMarginPx: 32.0px (16.0dp)\n" +
+ "\toverviewTaskIconSizePx: 96.0px (48.0dp)\n" +
+ "\toverviewTaskIconDrawableSizePx: 88.0px (44.0dp)\n" +
+ "\toverviewTaskIconDrawableSizeGridPx: 88.0px (44.0dp)\n" +
+ "\toverviewTaskThumbnailTopMarginPx: 128.0px (64.0dp)\n" +
+ "\toverviewActionsTopMarginPx: 48.0px (24.0dp)\n" +
+ "\toverviewActionsHeight: 96.0px (48.0dp)\n" +
+ "\toverviewActionsButtonSpacing: 72.0px (36.0dp)\n" +
+ "\toverviewPageSpacing: 88.0px (44.0dp)\n" +
+ "\toverviewRowSpacing: 72.0px (36.0dp)\n" +
+ "\toverviewGridSideMargin: 128.0px (64.0dp)\n" +
+ "\tdropTargetBarTopMarginPx: 220.0px (110.0dp)\n" +
+ "\tdropTargetBarSizePx: 144.0px (72.0dp)\n" +
+ "\tdropTargetBarBottomMarginPx: 96.0px (48.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkTop(): 564.0px (282.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkBottom(): 1986.0px (993.0dp)\n" +
+ "\tworkspaceSpringLoadedMinNextPageVisiblePx: 48.0px (24.0dp)\n" +
+ "\tgetWorkspaceSpringLoadScale(): 0.76616377px (0.38308188dp)\n" +
+ "\tgetCellLayoutHeight(): 1856.0px (928.0dp)\n" +
+ "\tgetCellLayoutWidth(): 1528.0px (764.0dp)\n")
+ }
+
+ @Test
+ fun tabletPortrait() {
+ initializeVarsForTablet()
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" +
+ "\t1 dp = 2.0 px\n" +
+ "\tisTablet:true\n" +
+ "\tisPhone:false\n" +
+ "\ttransposeLayoutWithOrientation:false\n" +
+ "\tisGestureMode:true\n" +
+ "\tisLandscape:false\n" +
+ "\tisMultiWindowMode:false\n" +
+ "\tisTwoPanels:false\n" +
+ "\twindowX: 0.0px (0.0dp)\n" +
+ "\twindowY: 0.0px (0.0dp)\n" +
+ "\twidthPx: 1600.0px (800.0dp)\n" +
+ "\theightPx: 2560.0px (1280.0dp)\n" +
+ "\tavailableWidthPx: 1600.0px (800.0dp)\n" +
+ "\tavailableHeightPx: 2456.0px (1228.0dp)\n" +
+ "\tmInsets.left: 0.0px (0.0dp)\n" +
+ "\tmInsets.top: 104.0px (52.0dp)\n" +
+ "\tmInsets.right: 0.0px (0.0dp)\n" +
+ "\tmInsets.bottom: 0.0px (0.0dp)\n" +
+ "\taspectRatio:1.6\n" +
+ "\tisScalableGrid:true\n" +
+ "\tinv.numRows: 5\n" +
+ "\tinv.numColumns: 6\n" +
+ "\tinv.numSearchContainerColumns: 3\n" +
+ "\tminCellSize: PointF(102.0, 120.0)dp\n" +
+ "\tcellWidthPx: 204.0px (102.0dp)\n" +
+ "\tcellHeightPx: 240.0px (120.0dp)\n" +
+ "\tgetCellSize().x: 204.0px (102.0dp)\n" +
+ "\tgetCellSize().y: 240.0px (120.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Horizontal: 32.0px (16.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Vertical: 128.0px (64.0dp)\n" +
+ "\tcellLayoutPaddingPx.left: 72.0px (36.0dp)\n" +
+ "\tcellLayoutPaddingPx.top: 72.0px (36.0dp)\n" +
+ "\tcellLayoutPaddingPx.right: 72.0px (36.0dp)\n" +
+ "\tcellLayoutPaddingPx.bottom: 72.0px (36.0dp)\n" +
+ "\ticonSizePx: 120.0px (60.0dp)\n" +
+ "\ticonTextSizePx: 28.0px (14.0dp)\n" +
+ "\ticonDrawablePaddingPx: 14.0px (7.0dp)\n" +
+ "\tfolderCellWidthPx: 204.0px (102.0dp)\n" +
+ "\tfolderCellHeightPx: 240.0px (120.0dp)\n" +
+ "\tfolderChildIconSizePx: 120.0px (60.0dp)\n" +
+ "\tfolderChildTextSizePx: 28.0px (14.0dp)\n" +
+ "\tfolderChildDrawablePaddingPx: 27.0px (13.5dp)\n" +
+ "\tfolderCellLayoutBorderSpaceOriginalPx: 0.0px (0.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)\n" +
+ "\tbottomSheetTopPadding: 704.0px (352.0dp)\n" +
+ "\tallAppsShiftRange: 1856.0px (928.0dp)\n" +
+ "\tallAppsTopPadding: 704.0px (352.0dp)\n" +
+ "\tallAppsIconSizePx: 120.0px (60.0dp)\n" +
+ "\tallAppsIconTextSizePx: 28.0px (14.0dp)\n" +
+ "\tallAppsIconDrawablePaddingPx: 14.0px (7.0dp)\n" +
+ "\tallAppsCellHeightPx: 316.0px (158.0dp)\n" +
+ "\tallAppsCellWidthPx: 192.0px (96.0dp)\n" +
+ "\tallAppsBorderSpacePxX: 16.0px (8.0dp)\n" +
+ "\tallAppsBorderSpacePxY: 32.0px (16.0dp)\n" +
+ "\tnumShownAllAppsColumns: 6\n" +
+ "\tallAppsLeftRightPadding: 56.0px (28.0dp)\n" +
+ "\tallAppsLeftRightMargin: 128.0px (64.0dp)\n" +
+ "\thotseatBarSizePx: 358.0px (179.0dp)\n" +
+ "\tinv.hotseatColumnSpan: 6\n" +
+ "\thotseatCellHeightPx: 135.0px (67.5dp)\n" +
+ "\thotseatBarBottomSpacePx: 72.0px (36.0dp)\n" +
+ "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarEndOffset: 0.0px (0.0dp)\n" +
+ "\thotseatQsbSpace: 64.0px (32.0dp)\n" +
+ "\thotseatQsbHeight: 126.0px (63.0dp)\n" +
+ "\tspringLoadedHotseatBarTopMarginPx: 216.0px (108.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).top: 158.0px (79.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).bottom: 65.0px (32.5dp)\n" +
+ "\tgetHotseatLayoutPadding(context).left: 150.0px (75.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).right: 150.0px (75.0dp)\n" +
+ "\tnumShownHotseatIcons: 6\n" +
+ "\thotseatBorderSpace: 116.0px (58.0dp)\n" +
+ "\tisQsbInline: false\n" +
+ "\tqsbWidth: 1300.0px (650.0dp)\n" +
+ "\tisTaskbarPresent:true\n" +
+ "\tisTaskbarPresentInApps:true\n" +
+ "\ttaskbarSize: 120.0px (60.0dp)\n" +
+ "\tdesiredWorkspaceHorizontalMarginPx: 108.0px (54.0dp)\n" +
+ "\tworkspacePadding.left: 36.0px (18.0dp)\n" +
+ "\tworkspacePadding.top: 87.0px (43.5dp)\n" +
+ "\tworkspacePadding.right: 36.0px (18.0dp)\n" +
+ "\tworkspacePadding.bottom: 513.0px (256.5dp)\n" +
+ "\ticonScale: 1.0px (0.5dp)\n" +
+ "\tcellScaleToFit : 1.0px (0.5dp)\n" +
+ "\textraSpace: 362.0px (181.0dp)\n" +
+ "\tunscaled extraSpace: 362.0px (181.0dp)\n" +
+ "\tmaxEmptySpace: 19998.0px (9999.0dp)\n" +
+ "\tworkspaceTopPadding: 159.0px (79.5dp)\n" +
+ "\tworkspaceBottomPadding: 203.0px (101.5dp)\n" +
+ "\toverviewTaskMarginPx: 32.0px (16.0dp)\n" +
+ "\toverviewTaskIconSizePx: 96.0px (48.0dp)\n" +
+ "\toverviewTaskIconDrawableSizePx: 88.0px (44.0dp)\n" +
+ "\toverviewTaskIconDrawableSizeGridPx: 88.0px (44.0dp)\n" +
+ "\toverviewTaskThumbnailTopMarginPx: 128.0px (64.0dp)\n" +
+ "\toverviewActionsTopMarginPx: 48.0px (24.0dp)\n" +
+ "\toverviewActionsHeight: 96.0px (48.0dp)\n" +
+ "\toverviewActionsButtonSpacing: 72.0px (36.0dp)\n" +
+ "\toverviewPageSpacing: 88.0px (44.0dp)\n" +
+ "\toverviewRowSpacing: 72.0px (36.0dp)\n" +
+ "\toverviewGridSideMargin: 128.0px (64.0dp)\n" +
+ "\tdropTargetBarTopMarginPx: 220.0px (110.0dp)\n" +
+ "\tdropTargetBarSizePx: 144.0px (72.0dp)\n" +
+ "\tdropTargetBarBottomMarginPx: 96.0px (48.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkTop(): 564.0px (282.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkBottom(): 1986.0px (993.0dp)\n" +
+ "\tworkspaceSpringLoadedMinNextPageVisiblePx: 48.0px (24.0dp)\n" +
+ "\tgetWorkspaceSpringLoadScale(): 0.76616377px (0.38308188dp)\n" +
+ "\tgetCellLayoutHeight(): 1856.0px (928.0dp)\n" +
+ "\tgetCellLayoutWidth(): 1528.0px (764.0dp)\n")
+ }
+
+ @Test
+ fun twoPanelLandscape3Button() {
+ initializeVarsForTwoPanel(isLandscape = true, isGestureMode = false)
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" +
+ "\t1 dp = 2.625 px\n" +
+ "\tisTablet:true\n" +
+ "\tisPhone:false\n" +
+ "\ttransposeLayoutWithOrientation:false\n" +
+ "\tisGestureMode:false\n" +
+ "\tisLandscape:true\n" +
+ "\tisMultiWindowMode:false\n" +
+ "\tisTwoPanels:true\n" +
+ "\twindowX: 0.0px (0.0dp)\n" +
+ "\twindowY: 0.0px (0.0dp)\n" +
+ "\twidthPx: 2208.0px (841.1429dp)\n" +
+ "\theightPx: 1840.0px (700.9524dp)\n" +
+ "\tavailableWidthPx: 2208.0px (841.1429dp)\n" +
+ "\tavailableHeightPx: 1730.0px (659.0476dp)\n" +
+ "\tmInsets.left: 0.0px (0.0dp)\n" +
+ "\tmInsets.top: 110.0px (41.904762dp)\n" +
+ "\tmInsets.right: 0.0px (0.0dp)\n" +
+ "\tmInsets.bottom: 0.0px (0.0dp)\n" +
+ "\taspectRatio:1.2\n" +
+ "\tisScalableGrid:true\n" +
+ "\tinv.numRows: 4\n" +
+ "\tinv.numColumns: 4\n" +
+ "\tinv.numSearchContainerColumns: 4\n" +
+ "\tminCellSize: PointF(80.0, 102.0)dp\n" +
+ "\tcellWidthPx: 210.0px (80.0dp)\n" +
+ "\tcellHeightPx: 267.0px (101.71429dp)\n" +
+ "\tgetCellSize().x: 210.0px (80.0dp)\n" +
+ "\tgetCellSize().y: 267.0px (101.71429dp)\n" +
+ "\tcellLayoutBorderSpacePx Horizontal: 52.0px (19.809525dp)\n" +
+ "\tcellLayoutBorderSpacePx Vertical: 52.0px (19.809525dp)\n" +
+ "\tcellLayoutPaddingPx.left: 26.0px (9.904762dp)\n" +
+ "\tcellLayoutPaddingPx.top: 18.0px (6.857143dp)\n" +
+ "\tcellLayoutPaddingPx.right: 26.0px (9.904762dp)\n" +
+ "\tcellLayoutPaddingPx.bottom: 26.0px (9.904762dp)\n" +
+ "\ticonSizePx: 157.0px (59.809525dp)\n" +
+ "\ticonTextSizePx: 36.0px (13.714286dp)\n" +
+ "\ticonDrawablePaddingPx: 17.0px (6.4761906dp)\n" +
+ "\tfolderCellWidthPx: 210.0px (80.0dp)\n" +
+ "\tfolderCellHeightPx: 267.0px (101.71429dp)\n" +
+ "\tfolderChildIconSizePx: 158.0px (60.190475dp)\n" +
+ "\tfolderChildTextSizePx: 37.0px (14.095238dp)\n" +
+ "\tfolderChildDrawablePaddingPx: 19.0px (7.2380953dp)\n" +
+ "\tfolderCellLayoutBorderSpaceOriginalPx: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
+ "\tbottomSheetTopPadding: 110.0px (41.904762dp)\n" +
+ "\tallAppsShiftRange: 1730.0px (659.0476dp)\n" +
+ "\tallAppsTopPadding: 110.0px (41.904762dp)\n" +
+ "\tallAppsIconSizePx: 157.0px (59.809525dp)\n" +
+ "\tallAppsIconTextSizePx: 37.0px (14.095238dp)\n" +
+ "\tallAppsIconDrawablePaddingPx: 18.0px (6.857143dp)\n" +
+ "\tallAppsCellHeightPx: 315.0px (120.0dp)\n" +
+ "\tallAppsCellWidthPx: 210.0px (80.0dp)\n" +
+ "\tallAppsBorderSpacePxX: 52.0px (19.809525dp)\n" +
+ "\tallAppsBorderSpacePxY: 42.0px (16.0dp)\n" +
+ "\tnumShownAllAppsColumns: 6\n" +
+ "\tallAppsLeftRightPadding: 137.0px (52.190475dp)\n" +
+ "\tallAppsLeftRightMargin: 207.0px (78.85714dp)\n" +
+ "\thotseatBarSizePx: 417.0px (158.85715dp)\n" +
+ "\tinv.hotseatColumnSpan: 6\n" +
+ "\thotseatCellHeightPx: 177.0px (67.42857dp)\n" +
+ "\thotseatBarBottomSpacePx: 53.0px (20.190475dp)\n" +
+ "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarEndOffset: 744.0px (283.42856dp)\n" +
+ "\thotseatQsbSpace: 74.0px (28.190475dp)\n" +
+ "\thotseatQsbHeight: 165.0px (62.857143dp)\n" +
+ "\tspringLoadedHotseatBarTopMarginPx: 116.0px (44.190475dp)\n" +
+ "\tgetHotseatLayoutPadding(context).top: 197.0px (75.04762dp)\n" +
+ "\tgetHotseatLayoutPadding(context).bottom: 43.0px (16.380953dp)\n" +
+ "\tgetHotseatLayoutPadding(context).left: 216.0px (82.28571dp)\n" +
+ "\tgetHotseatLayoutPadding(context).right: 744.0px (283.42856dp)\n" +
+ "\tnumShownHotseatIcons: 6\n" +
+ "\thotseatBorderSpace: 61.0px (23.238094dp)\n" +
+ "\tisQsbInline: false\n" +
+ "\tqsbWidth: 1467.0px (558.8571dp)\n" +
+ "\tisTaskbarPresent:true\n" +
+ "\tisTaskbarPresentInApps:true\n" +
+ "\ttaskbarSize: 158.0px (60.190475dp)\n" +
+ "\tdesiredWorkspaceHorizontalMarginPx: 79.0px (30.095238dp)\n" +
+ "\tworkspacePadding.left: 53.0px (20.190475dp)\n" +
+ "\tworkspacePadding.top: 0.0px (0.0dp)\n" +
+ "\tworkspacePadding.right: 53.0px (20.190475dp)\n" +
+ "\tworkspacePadding.bottom: 461.0px (175.61905dp)\n" +
+ "\ticonScale: 0.99864316px (0.3804355dp)\n" +
+ "\tcellScaleToFit : 0.99864316px (0.3804355dp)\n" +
+ "\textraSpace: 57.0px (21.714285dp)\n" +
+ "\tunscaled extraSpace: 57.077446px (21.74379dp)\n" +
+ "\tmaxEmptySpace: 131.0px (49.904762dp)\n" +
+ "\tworkspaceTopPadding: 18.0px (6.857143dp)\n" +
+ "\tworkspaceBottomPadding: 39.0px (14.857142dp)\n" +
+ "\toverviewTaskMarginPx: 32.0px (12.190476dp)\n" +
+ "\toverviewTaskIconSizePx: 126.0px (48.0dp)\n" +
+ "\toverviewTaskIconDrawableSizePx: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskIconDrawableSizeGridPx: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskThumbnailTopMarginPx: 158.0px (60.190475dp)\n" +
+ "\toverviewActionsTopMarginPx: 32.0px (12.190476dp)\n" +
+ "\toverviewActionsHeight: 126.0px (48.0dp)\n" +
+ "\toverviewActionsButtonSpacing: 95.0px (36.190475dp)\n" +
+ "\toverviewPageSpacing: 95.0px (36.190475dp)\n" +
+ "\toverviewRowSpacing: 74.0px (28.190475dp)\n" +
+ "\toverviewGridSideMargin: 168.0px (64.0dp)\n" +
+ "\tdropTargetBarTopMarginPx: 0.0px (0.0dp)\n" +
+ "\tdropTargetBarSizePx: 147.0px (56.0dp)\n" +
+ "\tdropTargetBarBottomMarginPx: 42.0px (16.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkTop(): 299.0px (113.90476dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkBottom(): 1307.0px (497.90475dp)\n" +
+ "\tworkspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp)\n" +
+ "\tgetWorkspaceSpringLoadScale(): 0.79432625px (0.30260047dp)\n" +
+ "\tgetCellLayoutHeight(): 1269.0px (483.42856dp)\n" +
+ "\tgetCellLayoutWidth(): 1051.0px (400.38095dp)\n")
+ }
+
+ @Test
+ fun twoPanelLandscape() {
+ initializeVarsForTwoPanel(isLandscape = true)
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" +
+ "\t1 dp = 2.625 px\n" +
+ "\tisTablet:true\n" +
+ "\tisPhone:false\n" +
+ "\ttransposeLayoutWithOrientation:false\n" +
+ "\tisGestureMode:true\n" +
+ "\tisLandscape:true\n" +
+ "\tisMultiWindowMode:false\n" +
+ "\tisTwoPanels:true\n" +
+ "\twindowX: 0.0px (0.0dp)\n" +
+ "\twindowY: 0.0px (0.0dp)\n" +
+ "\twidthPx: 2208.0px (841.1429dp)\n" +
+ "\theightPx: 1840.0px (700.9524dp)\n" +
+ "\tavailableWidthPx: 2208.0px (841.1429dp)\n" +
+ "\tavailableHeightPx: 1730.0px (659.0476dp)\n" +
+ "\tmInsets.left: 0.0px (0.0dp)\n" +
+ "\tmInsets.top: 110.0px (41.904762dp)\n" +
+ "\tmInsets.right: 0.0px (0.0dp)\n" +
+ "\tmInsets.bottom: 0.0px (0.0dp)\n" +
+ "\taspectRatio:1.2\n" +
+ "\tisScalableGrid:true\n" +
+ "\tinv.numRows: 4\n" +
+ "\tinv.numColumns: 4\n" +
+ "\tinv.numSearchContainerColumns: 4\n" +
+ "\tminCellSize: PointF(80.0, 102.0)dp\n" +
+ "\tcellWidthPx: 210.0px (80.0dp)\n" +
+ "\tcellHeightPx: 267.0px (101.71429dp)\n" +
+ "\tgetCellSize().x: 210.0px (80.0dp)\n" +
+ "\tgetCellSize().y: 267.0px (101.71429dp)\n" +
+ "\tcellLayoutBorderSpacePx Horizontal: 52.0px (19.809525dp)\n" +
+ "\tcellLayoutBorderSpacePx Vertical: 52.0px (19.809525dp)\n" +
+ "\tcellLayoutPaddingPx.left: 26.0px (9.904762dp)\n" +
+ "\tcellLayoutPaddingPx.top: 18.0px (6.857143dp)\n" +
+ "\tcellLayoutPaddingPx.right: 26.0px (9.904762dp)\n" +
+ "\tcellLayoutPaddingPx.bottom: 26.0px (9.904762dp)\n" +
+ "\ticonSizePx: 157.0px (59.809525dp)\n" +
+ "\ticonTextSizePx: 36.0px (13.714286dp)\n" +
+ "\ticonDrawablePaddingPx: 17.0px (6.4761906dp)\n" +
+ "\tfolderCellWidthPx: 210.0px (80.0dp)\n" +
+ "\tfolderCellHeightPx: 267.0px (101.71429dp)\n" +
+ "\tfolderChildIconSizePx: 158.0px (60.190475dp)\n" +
+ "\tfolderChildTextSizePx: 37.0px (14.095238dp)\n" +
+ "\tfolderChildDrawablePaddingPx: 19.0px (7.2380953dp)\n" +
+ "\tfolderCellLayoutBorderSpaceOriginalPx: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
+ "\tbottomSheetTopPadding: 110.0px (41.904762dp)\n" +
+ "\tallAppsShiftRange: 1730.0px (659.0476dp)\n" +
+ "\tallAppsTopPadding: 110.0px (41.904762dp)\n" +
+ "\tallAppsIconSizePx: 157.0px (59.809525dp)\n" +
+ "\tallAppsIconTextSizePx: 37.0px (14.095238dp)\n" +
+ "\tallAppsIconDrawablePaddingPx: 18.0px (6.857143dp)\n" +
+ "\tallAppsCellHeightPx: 315.0px (120.0dp)\n" +
+ "\tallAppsCellWidthPx: 210.0px (80.0dp)\n" +
+ "\tallAppsBorderSpacePxX: 52.0px (19.809525dp)\n" +
+ "\tallAppsBorderSpacePxY: 42.0px (16.0dp)\n" +
+ "\tnumShownAllAppsColumns: 6\n" +
+ "\tallAppsLeftRightPadding: 137.0px (52.190475dp)\n" +
+ "\tallAppsLeftRightMargin: 207.0px (78.85714dp)\n" +
+ "\thotseatBarSizePx: 417.0px (158.85715dp)\n" +
+ "\tinv.hotseatColumnSpan: 6\n" +
+ "\thotseatCellHeightPx: 177.0px (67.42857dp)\n" +
+ "\thotseatBarBottomSpacePx: 53.0px (20.190475dp)\n" +
+ "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarEndOffset: 0.0px (0.0dp)\n" +
+ "\thotseatQsbSpace: 74.0px (28.190475dp)\n" +
+ "\thotseatQsbHeight: 165.0px (62.857143dp)\n" +
+ "\tspringLoadedHotseatBarTopMarginPx: 116.0px (44.190475dp)\n" +
+ "\tgetHotseatLayoutPadding(context).top: 197.0px (75.04762dp)\n" +
+ "\tgetHotseatLayoutPadding(context).bottom: 43.0px (16.380953dp)\n" +
+ "\tgetHotseatLayoutPadding(context).left: 370.0px (140.95238dp)\n" +
+ "\tgetHotseatLayoutPadding(context).right: 370.0px (140.95238dp)\n" +
+ "\tnumShownHotseatIcons: 6\n" +
+ "\thotseatBorderSpace: 105.0px (40.0dp)\n" +
+ "\tisQsbInline: false\n" +
+ "\tqsbWidth: 1467.0px (558.8571dp)\n" +
+ "\tisTaskbarPresent:true\n" +
+ "\tisTaskbarPresentInApps:true\n" +
+ "\ttaskbarSize: 158.0px (60.190475dp)\n" +
+ "\tdesiredWorkspaceHorizontalMarginPx: 79.0px (30.095238dp)\n" +
+ "\tworkspacePadding.left: 53.0px (20.190475dp)\n" +
+ "\tworkspacePadding.top: 0.0px (0.0dp)\n" +
+ "\tworkspacePadding.right: 53.0px (20.190475dp)\n" +
+ "\tworkspacePadding.bottom: 461.0px (175.61905dp)\n" +
+ "\ticonScale: 0.99864316px (0.3804355dp)\n" +
+ "\tcellScaleToFit : 0.99864316px (0.3804355dp)\n" +
+ "\textraSpace: 57.0px (21.714285dp)\n" +
+ "\tunscaled extraSpace: 57.077446px (21.74379dp)\n" +
+ "\tmaxEmptySpace: 131.0px (49.904762dp)\n" +
+ "\tworkspaceTopPadding: 18.0px (6.857143dp)\n" +
+ "\tworkspaceBottomPadding: 39.0px (14.857142dp)\n" +
+ "\toverviewTaskMarginPx: 32.0px (12.190476dp)\n" +
+ "\toverviewTaskIconSizePx: 126.0px (48.0dp)\n" +
+ "\toverviewTaskIconDrawableSizePx: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskIconDrawableSizeGridPx: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskThumbnailTopMarginPx: 158.0px (60.190475dp)\n" +
+ "\toverviewActionsTopMarginPx: 32.0px (12.190476dp)\n" +
+ "\toverviewActionsHeight: 126.0px (48.0dp)\n" +
+ "\toverviewActionsButtonSpacing: 95.0px (36.190475dp)\n" +
+ "\toverviewPageSpacing: 95.0px (36.190475dp)\n" +
+ "\toverviewRowSpacing: 74.0px (28.190475dp)\n" +
+ "\toverviewGridSideMargin: 168.0px (64.0dp)\n" +
+ "\tdropTargetBarTopMarginPx: 0.0px (0.0dp)\n" +
+ "\tdropTargetBarSizePx: 147.0px (56.0dp)\n" +
+ "\tdropTargetBarBottomMarginPx: 42.0px (16.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkTop(): 299.0px (113.90476dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkBottom(): 1307.0px (497.90475dp)\n" +
+ "\tworkspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp)\n" +
+ "\tgetWorkspaceSpringLoadScale(): 0.79432625px (0.30260047dp)\n" +
+ "\tgetCellLayoutHeight(): 1269.0px (483.42856dp)\n" +
+ "\tgetCellLayoutWidth(): 1051.0px (400.38095dp)\n")
+ }
+
+ @Test
+ fun twoPanelPortrait3Button() {
+ initializeVarsForTwoPanel(isGestureMode = false)
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" +
+ "\t1 dp = 2.625 px\n" +
+ "\tisTablet:true\n" +
+ "\tisPhone:false\n" +
+ "\ttransposeLayoutWithOrientation:false\n" +
+ "\tisGestureMode:false\n" +
+ "\tisLandscape:false\n" +
+ "\tisMultiWindowMode:false\n" +
+ "\tisTwoPanels:true\n" +
+ "\twindowX: 0.0px (0.0dp)\n" +
+ "\twindowY: 0.0px (0.0dp)\n" +
+ "\twidthPx: 1840.0px (700.9524dp)\n" +
+ "\theightPx: 2208.0px (841.1429dp)\n" +
+ "\tavailableWidthPx: 1840.0px (700.9524dp)\n" +
+ "\tavailableHeightPx: 2098.0px (799.2381dp)\n" +
+ "\tmInsets.left: 0.0px (0.0dp)\n" +
+ "\tmInsets.top: 110.0px (41.904762dp)\n" +
+ "\tmInsets.right: 0.0px (0.0dp)\n" +
+ "\tmInsets.bottom: 0.0px (0.0dp)\n" +
+ "\taspectRatio:1.2\n" +
+ "\tisScalableGrid:true\n" +
+ "\tinv.numRows: 4\n" +
+ "\tinv.numColumns: 4\n" +
+ "\tinv.numSearchContainerColumns: 4\n" +
+ "\tminCellSize: PointF(68.0, 116.0)dp\n" +
+ "\tcellWidthPx: 178.0px (67.809525dp)\n" +
+ "\tcellHeightPx: 304.0px (115.809525dp)\n" +
+ "\tgetCellSize().x: 178.0px (67.809525dp)\n" +
+ "\tgetCellSize().y: 304.0px (115.809525dp)\n" +
+ "\tcellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Vertical: 52.0px (19.809525dp)\n" +
+ "\tcellLayoutPaddingPx.left: 21.0px (8.0dp)\n" +
+ "\tcellLayoutPaddingPx.top: 21.0px (8.0dp)\n" +
+ "\tcellLayoutPaddingPx.right: 21.0px (8.0dp)\n" +
+ "\tcellLayoutPaddingPx.bottom: 21.0px (8.0dp)\n" +
+ "\ticonSizePx: 136.0px (51.809525dp)\n" +
+ "\ticonTextSizePx: 31.0px (11.809524dp)\n" +
+ "\ticonDrawablePaddingPx: 17.0px (6.4761906dp)\n" +
+ "\tfolderCellWidthPx: 192.0px (73.14286dp)\n" +
+ "\tfolderCellHeightPx: 304.0px (115.809525dp)\n" +
+ "\tfolderChildIconSizePx: 158.0px (60.190475dp)\n" +
+ "\tfolderChildTextSizePx: 37.0px (14.095238dp)\n" +
+ "\tfolderChildDrawablePaddingPx: 32.0px (12.190476dp)\n" +
+ "\tfolderCellLayoutBorderSpaceOriginalPx: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
+ "\tbottomSheetTopPadding: 110.0px (41.904762dp)\n" +
+ "\tallAppsShiftRange: 2098.0px (799.2381dp)\n" +
+ "\tallAppsTopPadding: 110.0px (41.904762dp)\n" +
+ "\tallAppsIconSizePx: 136.0px (51.809525dp)\n" +
+ "\tallAppsIconTextSizePx: 31.0px (11.809524dp)\n" +
+ "\tallAppsIconDrawablePaddingPx: 18.0px (6.857143dp)\n" +
+ "\tallAppsCellHeightPx: 345.0px (131.42857dp)\n" +
+ "\tallAppsCellWidthPx: 178.0px (67.809525dp)\n" +
+ "\tallAppsBorderSpacePxX: 42.0px (16.0dp)\n" +
+ "\tallAppsBorderSpacePxY: 73.0px (27.809525dp)\n" +
+ "\tnumShownAllAppsColumns: 6\n" +
+ "\tallAppsLeftRightPadding: 126.0px (48.0dp)\n" +
+ "\tallAppsLeftRightMargin: 155.0px (59.04762dp)\n" +
+ "\thotseatBarSizePx: 459.0px (174.85715dp)\n" +
+ "\tinv.hotseatColumnSpan: 6\n" +
+ "\thotseatCellHeightPx: 153.0px (58.285713dp)\n" +
+ "\thotseatBarBottomSpacePx: 95.0px (36.190475dp)\n" +
+ "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarEndOffset: 660.0px (251.42857dp)\n" +
+ "\thotseatQsbSpace: 95.0px (36.190475dp)\n" +
+ "\thotseatQsbHeight: 165.0px (62.857143dp)\n" +
+ "\tspringLoadedHotseatBarTopMarginPx: 171.0px (65.14286dp)\n" +
+ "\tgetHotseatLayoutPadding(context).top: 219.0px (83.42857dp)\n" +
+ "\tgetHotseatLayoutPadding(context).bottom: 87.0px (33.142857dp)\n" +
+ "\tgetHotseatLayoutPadding(context).left: 128.0px (48.761906dp)\n" +
+ "\tgetHotseatLayoutPadding(context).right: 660.0px (251.42857dp)\n" +
+ "\tnumShownHotseatIcons: 6\n" +
+ "\thotseatBorderSpace: 47.0px (17.904762dp)\n" +
+ "\tisQsbInline: false\n" +
+ "\tqsbWidth: 1236.0px (470.85715dp)\n" +
+ "\tisTaskbarPresent:true\n" +
+ "\tisTaskbarPresentInApps:true\n" +
+ "\ttaskbarSize: 158.0px (60.190475dp)\n" +
+ "\tdesiredWorkspaceHorizontalMarginPx: 58.0px (22.095238dp)\n" +
+ "\tworkspacePadding.left: 37.0px (14.095238dp)\n" +
+ "\tworkspacePadding.top: 68.0px (25.904762dp)\n" +
+ "\tworkspacePadding.right: 37.0px (14.095238dp)\n" +
+ "\tworkspacePadding.bottom: 615.0px (234.28572dp)\n" +
+ "\ticonScale: 0.9978308px (0.38012603dp)\n" +
+ "\tcellScaleToFit : 0.9978308px (0.38012603dp)\n" +
+ "\textraSpace: 235.0px (89.52381dp)\n" +
+ "\tunscaled extraSpace: 235.51086px (89.71842dp)\n" +
+ "\tmaxEmptySpace: 236.0px (89.90476dp)\n" +
+ "\tworkspaceTopPadding: 89.0px (33.904762dp)\n" +
+ "\tworkspaceBottomPadding: 146.0px (55.61905dp)\n" +
+ "\toverviewTaskMarginPx: 32.0px (12.190476dp)\n" +
+ "\toverviewTaskIconSizePx: 126.0px (48.0dp)\n" +
+ "\toverviewTaskIconDrawableSizePx: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskIconDrawableSizeGridPx: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskThumbnailTopMarginPx: 158.0px (60.190475dp)\n" +
+ "\toverviewActionsTopMarginPx: 63.0px (24.0dp)\n" +
+ "\toverviewActionsHeight: 126.0px (48.0dp)\n" +
+ "\toverviewActionsButtonSpacing: 95.0px (36.190475dp)\n" +
+ "\toverviewPageSpacing: 95.0px (36.190475dp)\n" +
+ "\toverviewRowSpacing: 74.0px (28.190475dp)\n" +
+ "\toverviewGridSideMargin: 168.0px (64.0dp)\n" +
+ "\tdropTargetBarTopMarginPx: 168.0px (64.0dp)\n" +
+ "\tdropTargetBarSizePx: 147.0px (56.0dp)\n" +
+ "\tdropTargetBarBottomMarginPx: 42.0px (16.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkTop(): 467.0px (177.90475dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkBottom(): 1578.0px (601.1429dp)\n" +
+ "\tworkspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp)\n" +
+ "\tgetWorkspaceSpringLoadScale(): 0.785159px (0.29910818dp)\n" +
+ "\tgetCellLayoutHeight(): 1415.0px (539.0476dp)\n" +
+ "\tgetCellLayoutWidth(): 883.0px (336.38095dp)\n")
+ }
+
+ @Test
+ fun twoPanelPortrait() {
+ initializeVarsForTwoPanel()
+ val dp = newDP()
+ dp.isTaskbarPresentInApps = true
+
+ assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" +
+ "\t1 dp = 2.625 px\n" +
+ "\tisTablet:true\n" +
+ "\tisPhone:false\n" +
+ "\ttransposeLayoutWithOrientation:false\n" +
+ "\tisGestureMode:true\n" +
+ "\tisLandscape:false\n" +
+ "\tisMultiWindowMode:false\n" +
+ "\tisTwoPanels:true\n" +
+ "\twindowX: 0.0px (0.0dp)\n" +
+ "\twindowY: 0.0px (0.0dp)\n" +
+ "\twidthPx: 1840.0px (700.9524dp)\n" +
+ "\theightPx: 2208.0px (841.1429dp)\n" +
+ "\tavailableWidthPx: 1840.0px (700.9524dp)\n" +
+ "\tavailableHeightPx: 2098.0px (799.2381dp)\n" +
+ "\tmInsets.left: 0.0px (0.0dp)\n" +
+ "\tmInsets.top: 110.0px (41.904762dp)\n" +
+ "\tmInsets.right: 0.0px (0.0dp)\n" +
+ "\tmInsets.bottom: 0.0px (0.0dp)\n" +
+ "\taspectRatio:1.2\n" +
+ "\tisScalableGrid:true\n" +
+ "\tinv.numRows: 4\n" +
+ "\tinv.numColumns: 4\n" +
+ "\tinv.numSearchContainerColumns: 4\n" +
+ "\tminCellSize: PointF(68.0, 116.0)dp\n" +
+ "\tcellWidthPx: 178.0px (67.809525dp)\n" +
+ "\tcellHeightPx: 304.0px (115.809525dp)\n" +
+ "\tgetCellSize().x: 178.0px (67.809525dp)\n" +
+ "\tgetCellSize().y: 304.0px (115.809525dp)\n" +
+ "\tcellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Vertical: 52.0px (19.809525dp)\n" +
+ "\tcellLayoutPaddingPx.left: 21.0px (8.0dp)\n" +
+ "\tcellLayoutPaddingPx.top: 21.0px (8.0dp)\n" +
+ "\tcellLayoutPaddingPx.right: 21.0px (8.0dp)\n" +
+ "\tcellLayoutPaddingPx.bottom: 21.0px (8.0dp)\n" +
+ "\ticonSizePx: 136.0px (51.809525dp)\n" +
+ "\ticonTextSizePx: 31.0px (11.809524dp)\n" +
+ "\ticonDrawablePaddingPx: 17.0px (6.4761906dp)\n" +
+ "\tfolderCellWidthPx: 192.0px (73.14286dp)\n" +
+ "\tfolderCellHeightPx: 304.0px (115.809525dp)\n" +
+ "\tfolderChildIconSizePx: 158.0px (60.190475dp)\n" +
+ "\tfolderChildTextSizePx: 37.0px (14.095238dp)\n" +
+ "\tfolderChildDrawablePaddingPx: 32.0px (12.190476dp)\n" +
+ "\tfolderCellLayoutBorderSpaceOriginalPx: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
+ "\tbottomSheetTopPadding: 110.0px (41.904762dp)\n" +
+ "\tallAppsShiftRange: 2098.0px (799.2381dp)\n" +
+ "\tallAppsTopPadding: 110.0px (41.904762dp)\n" +
+ "\tallAppsIconSizePx: 136.0px (51.809525dp)\n" +
+ "\tallAppsIconTextSizePx: 31.0px (11.809524dp)\n" +
+ "\tallAppsIconDrawablePaddingPx: 18.0px (6.857143dp)\n" +
+ "\tallAppsCellHeightPx: 345.0px (131.42857dp)\n" +
+ "\tallAppsCellWidthPx: 178.0px (67.809525dp)\n" +
+ "\tallAppsBorderSpacePxX: 42.0px (16.0dp)\n" +
+ "\tallAppsBorderSpacePxY: 73.0px (27.809525dp)\n" +
+ "\tnumShownAllAppsColumns: 6\n" +
+ "\tallAppsLeftRightPadding: 126.0px (48.0dp)\n" +
+ "\tallAppsLeftRightMargin: 155.0px (59.04762dp)\n" +
+ "\thotseatBarSizePx: 459.0px (174.85715dp)\n" +
+ "\tinv.hotseatColumnSpan: 6\n" +
+ "\thotseatCellHeightPx: 153.0px (58.285713dp)\n" +
+ "\thotseatBarBottomSpacePx: 95.0px (36.190475dp)\n" +
+ "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" +
+ "\thotseatBarEndOffset: 0.0px (0.0dp)\n" +
+ "\thotseatQsbSpace: 95.0px (36.190475dp)\n" +
+ "\thotseatQsbHeight: 165.0px (62.857143dp)\n" +
+ "\tspringLoadedHotseatBarTopMarginPx: 171.0px (65.14286dp)\n" +
+ "\tgetHotseatLayoutPadding(context).top: 219.0px (83.42857dp)\n" +
+ "\tgetHotseatLayoutPadding(context).bottom: 87.0px (33.142857dp)\n" +
+ "\tgetHotseatLayoutPadding(context).left: 302.0px (115.04762dp)\n" +
+ "\tgetHotseatLayoutPadding(context).right: 302.0px (115.04762dp)\n" +
+ "\tnumShownHotseatIcons: 6\n" +
+ "\thotseatBorderSpace: 84.0px (32.0dp)\n" +
+ "\tisQsbInline: false\n" +
+ "\tqsbWidth: 1236.0px (470.85715dp)\n" +
+ "\tisTaskbarPresent:true\n" +
+ "\tisTaskbarPresentInApps:true\n" +
+ "\ttaskbarSize: 158.0px (60.190475dp)\n" +
+ "\tdesiredWorkspaceHorizontalMarginPx: 58.0px (22.095238dp)\n" +
+ "\tworkspacePadding.left: 37.0px (14.095238dp)\n" +
+ "\tworkspacePadding.top: 68.0px (25.904762dp)\n" +
+ "\tworkspacePadding.right: 37.0px (14.095238dp)\n" +
+ "\tworkspacePadding.bottom: 615.0px (234.28572dp)\n" +
+ "\ticonScale: 0.9978308px (0.38012603dp)\n" +
+ "\tcellScaleToFit : 0.9978308px (0.38012603dp)\n" +
+ "\textraSpace: 235.0px (89.52381dp)\n" +
+ "\tunscaled extraSpace: 235.51086px (89.71842dp)\n" +
+ "\tmaxEmptySpace: 236.0px (89.90476dp)\n" +
+ "\tworkspaceTopPadding: 89.0px (33.904762dp)\n" +
+ "\tworkspaceBottomPadding: 146.0px (55.61905dp)\n" +
+ "\toverviewTaskMarginPx: 32.0px (12.190476dp)\n" +
+ "\toverviewTaskIconSizePx: 126.0px (48.0dp)\n" +
+ "\toverviewTaskIconDrawableSizePx: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskIconDrawableSizeGridPx: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskThumbnailTopMarginPx: 158.0px (60.190475dp)\n" +
+ "\toverviewActionsTopMarginPx: 63.0px (24.0dp)\n" +
+ "\toverviewActionsHeight: 126.0px (48.0dp)\n" +
+ "\toverviewActionsButtonSpacing: 95.0px (36.190475dp)\n" +
+ "\toverviewPageSpacing: 95.0px (36.190475dp)\n" +
+ "\toverviewRowSpacing: 74.0px (28.190475dp)\n" +
+ "\toverviewGridSideMargin: 168.0px (64.0dp)\n" +
+ "\tdropTargetBarTopMarginPx: 168.0px (64.0dp)\n" +
+ "\tdropTargetBarSizePx: 147.0px (56.0dp)\n" +
+ "\tdropTargetBarBottomMarginPx: 42.0px (16.0dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkTop(): 467.0px (177.90475dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkBottom(): 1578.0px (601.1429dp)\n" +
+ "\tworkspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp)\n" +
+ "\tgetWorkspaceSpringLoadScale(): 0.785159px (0.29910818dp)\n" +
+ "\tgetCellLayoutHeight(): 1415.0px (539.0476dp)\n" +
+ "\tgetCellLayoutWidth(): 883.0px (336.38095dp)\n")
+ }
+
+ @Test
+ fun phoneVerticalBar3Button() {
+ initializeVarsForPhone(isVerticalBar = true, isGestureMode = false)
+ val dp = newDP()
+
+ assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" +
+ "\t1 dp = 2.625 px\n" +
+ "\tisTablet:false\n" +
+ "\tisPhone:true\n" +
+ "\ttransposeLayoutWithOrientation:true\n" +
+ "\tisGestureMode:false\n" +
+ "\tisLandscape:true\n" +
+ "\tisMultiWindowMode:false\n" +
+ "\tisTwoPanels:false\n" +
+ "\twindowX: 0.0px (0.0dp)\n" +
+ "\twindowY: 0.0px (0.0dp)\n" +
+ "\twidthPx: 2400.0px (914.2857dp)\n" +
+ "\theightPx: 1080.0px (411.42856dp)\n" +
+ "\tavailableWidthPx: 2156.0px (821.3333dp)\n" +
+ "\tavailableHeightPx: 1006.0px (383.2381dp)\n" +
+ "\tmInsets.left: 118.0px (44.95238dp)\n" +
+ "\tmInsets.top: 74.0px (28.190475dp)\n" +
+ "\tmInsets.right: 126.0px (48.0dp)\n" +
+ "\tmInsets.bottom: 0.0px (0.0dp)\n" +
+ "\taspectRatio:2.2222223\n" +
+ "\tisScalableGrid:false\n" +
+ "\tinv.numRows: 5\n" +
+ "\tinv.numColumns: 4\n" +
+ "\tinv.numSearchContainerColumns: 4\n" +
+ "\tminCellSize: PointF(80.0, 104.0)dp\n" +
+ "\tcellWidthPx: 153.0px (58.285713dp)\n" +
+ "\tcellHeightPx: 160.0px (60.95238dp)\n" +
+ "\tgetCellSize().x: 461.0px (175.61905dp)\n" +
+ "\tgetCellSize().y: 193.0px (73.52381dp)\n" +
+ "\tcellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)\n" +
+ "\tcellLayoutPaddingPx.left: 53.0px (20.190475dp)\n" +
+ "\tcellLayoutPaddingPx.top: 0.0px (0.0dp)\n" +
+ "\tcellLayoutPaddingPx.right: 53.0px (20.190475dp)\n" +
+ "\tcellLayoutPaddingPx.bottom: 40.0px (15.238095dp)\n" +
+ "\ticonSizePx: 142.0px (54.095238dp)\n" +
+ "\ticonTextSizePx: 0.0px (0.0dp)\n" +
+ "\ticonDrawablePaddingPx: 0.0px (0.0dp)\n" +
+ "\tfolderCellWidthPx: 179.0px (68.190475dp)\n" +
+ "\tfolderCellHeightPx: 212.0px (80.7619dp)\n" +
+ "\tfolderChildIconSizePx: 135.0px (51.42857dp)\n" +
+ "\tfolderChildTextSizePx: 35.0px (13.333333dp)\n" +
+ "\tfolderChildDrawablePaddingPx: 10.0px (3.8095238dp)\n" +
+ "\tfolderCellLayoutBorderSpaceOriginalPx: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
+ "\tbottomSheetTopPadding: 114.0px (43.42857dp)\n" +
+ "\tallAppsShiftRange: 788.0px (300.1905dp)\n" +
+ "\tallAppsTopPadding: 0.0px (0.0dp)\n" +
+ "\tallAppsIconSizePx: 158.0px (60.190475dp)\n" +
+ "\tallAppsIconTextSizePx: 37.0px (14.095238dp)\n" +
+ "\tallAppsIconDrawablePaddingPx: 21.0px (8.0dp)\n" +
+ "\tallAppsCellHeightPx: 329.0px (125.333336dp)\n" +
+ "\tallAppsCellWidthPx: 200.0px (76.190475dp)\n" +
+ "\tallAppsBorderSpacePxX: 42.0px (16.0dp)\n" +
+ "\tallAppsBorderSpacePxY: 42.0px (16.0dp)\n" +
+ "\tnumShownAllAppsColumns: 4\n" +
+ "\tallAppsLeftRightPadding: 0.0px (0.0dp)\n" +
+ "\tallAppsLeftRightMargin: 0.0px (0.0dp)\n" +
+ "\thotseatBarSizePx: 247.0px (94.09524dp)\n" +
+ "\tinv.hotseatColumnSpan: 4\n" +
+ "\thotseatCellHeightPx: 160.0px (60.95238dp)\n" +
+ "\thotseatBarBottomSpacePx: 126.0px (48.0dp)\n" +
+ "\thotseatBarSidePaddingStartPx: 63.0px (24.0dp)\n" +
+ "\thotseatBarSidePaddingEndPx: 42.0px (16.0dp)\n" +
+ "\thotseatBarEndOffset: 0.0px (0.0dp)\n" +
+ "\thotseatQsbSpace: 95.0px (36.190475dp)\n" +
+ "\thotseatQsbHeight: 165.0px (62.857143dp)\n" +
+ "\tspringLoadedHotseatBarTopMarginPx: 118.0px (44.95238dp)\n" +
+ "\tgetHotseatLayoutPadding(context).top: 65.0px (24.761906dp)\n" +
+ "\tgetHotseatLayoutPadding(context).bottom: 48.0px (18.285715dp)\n" +
+ "\tgetHotseatLayoutPadding(context).left: 42.0px (16.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).right: 189.0px (72.0dp)\n" +
+ "\tnumShownHotseatIcons: 4\n" +
+ "\thotseatBorderSpace: 0.0px (0.0dp)\n" +
+ "\tisQsbInline: false\n" +
+ "\tqsbWidth: 1525.0px (580.9524dp)\n" +
+ "\tisTaskbarPresent:false\n" +
+ "\tisTaskbarPresentInApps:false\n" +
+ "\ttaskbarSize: 0.0px (0.0dp)\n" +
+ "\tdesiredWorkspaceHorizontalMarginPx: 0.0px (0.0dp)\n" +
+ "\tworkspacePadding.left: 10.0px (3.8095238dp)\n" +
+ "\tworkspacePadding.top: 0.0px (0.0dp)\n" +
+ "\tworkspacePadding.right: 194.0px (73.90476dp)\n" +
+ "\tworkspacePadding.bottom: 0.0px (0.0dp)\n" +
+ "\ticonScale: 1.0px (0.3809524dp)\n" +
+ "\tcellScaleToFit : 1.0px (0.3809524dp)\n" +
+ "\textraSpace: 166.0px (63.238094dp)\n" +
+ "\tunscaled extraSpace: 166.0px (63.238094dp)\n" +
+ "\tmaxEmptySpace: 184.0px (70.09524dp)\n" +
+ "\tworkspaceTopPadding: 0.0px (0.0dp)\n" +
+ "\tworkspaceBottomPadding: 0.0px (0.0dp)\n" +
+ "\toverviewTaskMarginPx: 42.0px (16.0dp)\n" +
+ "\toverviewTaskIconSizePx: 126.0px (48.0dp)\n" +
+ "\toverviewTaskIconDrawableSizePx: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskIconDrawableSizeGridPx: 0.0px (0.0dp)\n" +
+ "\toverviewTaskThumbnailTopMarginPx: 168.0px (64.0dp)\n" +
+ "\toverviewActionsTopMarginPx: 32.0px (12.190476dp)\n" +
+ "\toverviewActionsHeight: 126.0px (48.0dp)\n" +
+ "\toverviewActionsButtonSpacing: 95.0px (36.190475dp)\n" +
+ "\toverviewPageSpacing: 42.0px (16.0dp)\n" +
+ "\toverviewRowSpacing: 0.0px (0.0dp)\n" +
+ "\toverviewGridSideMargin: 0.0px (0.0dp)\n" +
+ "\tdropTargetBarTopMarginPx: 16.0px (6.095238dp)\n" +
+ "\tdropTargetBarSizePx: 95.0px (36.190475dp)\n" +
+ "\tdropTargetBarBottomMarginPx: 16.0px (6.095238dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkTop(): 201.0px (76.57143dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkBottom(): 983.0px (374.4762dp)\n" +
+ "\tworkspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp)\n" +
+ "\tgetWorkspaceSpringLoadScale(): 0.777336px (0.296128dp)\n" +
+ "\tgetCellLayoutHeight(): 1006.0px (383.2381dp)\n" +
+ "\tgetCellLayoutWidth(): 1952.0px (743.619dp)\n")
+ }
+
+ @Test
+ fun phoneVerticalBar() {
+ initializeVarsForPhone(isVerticalBar = true)
+ val dp = newDP()
+
+ assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" +
+ "\t1 dp = 2.625 px\n" +
+ "\tisTablet:false\n" +
+ "\tisPhone:true\n" +
+ "\ttransposeLayoutWithOrientation:true\n" +
+ "\tisGestureMode:true\n" +
+ "\tisLandscape:true\n" +
+ "\tisMultiWindowMode:false\n" +
+ "\tisTwoPanels:false\n" +
+ "\twindowX: 0.0px (0.0dp)\n" +
+ "\twindowY: 0.0px (0.0dp)\n" +
+ "\twidthPx: 2400.0px (914.2857dp)\n" +
+ "\theightPx: 1080.0px (411.42856dp)\n" +
+ "\tavailableWidthPx: 2282.0px (869.3333dp)\n" +
+ "\tavailableHeightPx: 943.0px (359.2381dp)\n" +
+ "\tmInsets.left: 118.0px (44.95238dp)\n" +
+ "\tmInsets.top: 74.0px (28.190475dp)\n" +
+ "\tmInsets.right: 0.0px (0.0dp)\n" +
+ "\tmInsets.bottom: 63.0px (24.0dp)\n" +
+ "\taspectRatio:2.2222223\n" +
+ "\tisScalableGrid:false\n" +
+ "\tinv.numRows: 5\n" +
+ "\tinv.numColumns: 4\n" +
+ "\tinv.numSearchContainerColumns: 4\n" +
+ "\tminCellSize: PointF(80.0, 104.0)dp\n" +
+ "\tcellWidthPx: 153.0px (58.285713dp)\n" +
+ "\tcellHeightPx: 160.0px (60.95238dp)\n" +
+ "\tgetCellSize().x: 493.0px (187.80952dp)\n" +
+ "\tgetCellSize().y: 180.0px (68.57143dp)\n" +
+ "\tcellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)\n" +
+ "\tcellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)\n" +
+ "\tcellLayoutPaddingPx.left: 53.0px (20.190475dp)\n" +
+ "\tcellLayoutPaddingPx.top: 0.0px (0.0dp)\n" +
+ "\tcellLayoutPaddingPx.right: 53.0px (20.190475dp)\n" +
+ "\tcellLayoutPaddingPx.bottom: 40.0px (15.238095dp)\n" +
+ "\ticonSizePx: 142.0px (54.095238dp)\n" +
+ "\ticonTextSizePx: 0.0px (0.0dp)\n" +
+ "\ticonDrawablePaddingPx: 0.0px (0.0dp)\n" +
+ "\tfolderCellWidthPx: 163.0px (62.095238dp)\n" +
+ "\tfolderCellHeightPx: 192.0px (73.14286dp)\n" +
+ "\tfolderChildIconSizePx: 123.0px (46.857143dp)\n" +
+ "\tfolderChildTextSizePx: 32.0px (12.190476dp)\n" +
+ "\tfolderChildDrawablePaddingPx: 8.0px (3.047619dp)\n" +
+ "\tfolderCellLayoutBorderSpaceOriginalPx: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
+ "\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
+ "\tbottomSheetTopPadding: 114.0px (43.42857dp)\n" +
+ "\tallAppsShiftRange: 788.0px (300.1905dp)\n" +
+ "\tallAppsTopPadding: 0.0px (0.0dp)\n" +
+ "\tallAppsIconSizePx: 158.0px (60.190475dp)\n" +
+ "\tallAppsIconTextSizePx: 37.0px (14.095238dp)\n" +
+ "\tallAppsIconDrawablePaddingPx: 21.0px (8.0dp)\n" +
+ "\tallAppsCellHeightPx: 329.0px (125.333336dp)\n" +
+ "\tallAppsCellWidthPx: 200.0px (76.190475dp)\n" +
+ "\tallAppsBorderSpacePxX: 42.0px (16.0dp)\n" +
+ "\tallAppsBorderSpacePxY: 42.0px (16.0dp)\n" +
+ "\tnumShownAllAppsColumns: 4\n" +
+ "\tallAppsLeftRightPadding: 0.0px (0.0dp)\n" +
+ "\tallAppsLeftRightMargin: 0.0px (0.0dp)\n" +
+ "\thotseatBarSizePx: 247.0px (94.09524dp)\n" +
+ "\tinv.hotseatColumnSpan: 4\n" +
+ "\thotseatCellHeightPx: 160.0px (60.95238dp)\n" +
+ "\thotseatBarBottomSpacePx: 126.0px (48.0dp)\n" +
+ "\thotseatBarSidePaddingStartPx: 63.0px (24.0dp)\n" +
+ "\thotseatBarSidePaddingEndPx: 42.0px (16.0dp)\n" +
+ "\thotseatBarEndOffset: 0.0px (0.0dp)\n" +
+ "\thotseatQsbSpace: 95.0px (36.190475dp)\n" +
+ "\thotseatQsbHeight: 165.0px (62.857143dp)\n" +
+ "\tspringLoadedHotseatBarTopMarginPx: 118.0px (44.95238dp)\n" +
+ "\tgetHotseatLayoutPadding(context).top: 65.0px (24.761906dp)\n" +
+ "\tgetHotseatLayoutPadding(context).bottom: 111.0px (42.285713dp)\n" +
+ "\tgetHotseatLayoutPadding(context).left: 42.0px (16.0dp)\n" +
+ "\tgetHotseatLayoutPadding(context).right: 63.0px (24.0dp)\n" +
+ "\tnumShownHotseatIcons: 4\n" +
+ "\thotseatBorderSpace: 0.0px (0.0dp)\n" +
+ "\tisQsbInline: false\n" +
+ "\tqsbWidth: 1621.0px (617.5238dp)\n" +
+ "\tisTaskbarPresent:false\n" +
+ "\tisTaskbarPresentInApps:false\n" +
+ "\ttaskbarSize: 0.0px (0.0dp)\n" +
+ "\tdesiredWorkspaceHorizontalMarginPx: 0.0px (0.0dp)\n" +
+ "\tworkspacePadding.left: 10.0px (3.8095238dp)\n" +
+ "\tworkspacePadding.top: 0.0px (0.0dp)\n" +
+ "\tworkspacePadding.right: 194.0px (73.90476dp)\n" +
+ "\tworkspacePadding.bottom: 0.0px (0.0dp)\n" +
+ "\ticonScale: 1.0px (0.3809524dp)\n" +
+ "\tcellScaleToFit : 1.0px (0.3809524dp)\n" +
+ "\textraSpace: 103.0px (39.238094dp)\n" +
+ "\tunscaled extraSpace: 103.0px (39.238094dp)\n" +
+ "\tmaxEmptySpace: 131.0px (49.904762dp)\n" +
+ "\tworkspaceTopPadding: 0.0px (0.0dp)\n" +
+ "\tworkspaceBottomPadding: 0.0px (0.0dp)\n" +
+ "\toverviewTaskMarginPx: 42.0px (16.0dp)\n" +
+ "\toverviewTaskIconSizePx: 126.0px (48.0dp)\n" +
+ "\toverviewTaskIconDrawableSizePx: 116.0px (44.190475dp)\n" +
+ "\toverviewTaskIconDrawableSizeGridPx: 0.0px (0.0dp)\n" +
+ "\toverviewTaskThumbnailTopMarginPx: 168.0px (64.0dp)\n" +
+ "\toverviewActionsTopMarginPx: 32.0px (12.190476dp)\n" +
+ "\toverviewActionsHeight: 126.0px (48.0dp)\n" +
+ "\toverviewActionsButtonSpacing: 95.0px (36.190475dp)\n" +
+ "\toverviewPageSpacing: 42.0px (16.0dp)\n" +
+ "\toverviewRowSpacing: 0.0px (0.0dp)\n" +
+ "\toverviewGridSideMargin: 0.0px (0.0dp)\n" +
+ "\tdropTargetBarTopMarginPx: 16.0px (6.095238dp)\n" +
+ "\tdropTargetBarSizePx: 95.0px (36.190475dp)\n" +
+ "\tdropTargetBarBottomMarginPx: 16.0px (6.095238dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkTop(): 201.0px (76.57143dp)\n" +
+ "\tgetCellLayoutSpringLoadShrunkBottom(): 927.0px (353.14285dp)\n" +
+ "\tworkspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp)\n" +
+ "\tgetWorkspaceSpringLoadScale(): 0.76988333px (0.2932889dp)\n" +
+ "\tgetCellLayoutHeight(): 943.0px (359.2381dp)\n" +
+ "\tgetCellLayoutWidth(): 2078.0px (791.619dp)\n")
+ }
+}
\ 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
deleted file mode 100644
index 6728540..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscape3ButtonTest.kt
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * 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.quickstep
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.launcher3.DeviceProfile
-import com.android.launcher3.DeviceProfileBaseTest
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Tests for DeviceProfile for two panel in landscape with 3-Button navigation.
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class DeviceProfileTwoPanelLandscape3ButtonTest : DeviceProfileBaseTest() {
-
- lateinit var dp: DeviceProfile
-
- @Before
- fun before() {
- initializeVarsForTablet(isLandscape = true, isTwoPanel = true, isGestureMode = false)
- dp = newDP()
- }
-
- @Test
- fun isScalableGrid() {
- assertThat(dp.isScalableGrid).isTrue()
- }
-
- @Test
- fun cellWidthPx() {
- assertThat(dp.cellWidthPx).isEqualTo(200)
- }
-
- @Test
- fun cellHeightPx() {
- assertThat(dp.cellHeightPx).isEqualTo(260)
- }
-
- @Test
- fun getCellSizeX() {
- assertThat(dp.cellSize.x).isEqualTo(259)
- }
-
- @Test
- fun getCellSizeY() {
- assertThat(dp.cellSize.y).isEqualTo(260)
- }
-
- @Test
- fun cellLayoutBorderSpacePxX() {
- assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(50)
- }
-
- @Test
- fun cellLayoutBorderSpacePxY() {
- assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(50)
- }
-
- @Test
- fun cellLayoutPaddingPxLeft() {
- assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(25)
- }
-
- @Test
- fun cellLayoutPaddingPxTop() {
- assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxRight() {
- assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(25)
- }
-
- @Test
- fun cellLayoutPaddingPxBottom() {
- assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(25)
- }
-
- @Test
- fun iconSizePx() {
- assertThat(dp.iconSizePx).isEqualTo(112)
- }
-
- @Test
- fun iconTextSizePx() {
- assertThat(dp.iconTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun iconDrawablePaddingPx() {
- assertThat(dp.iconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun folderCellWidthPx() {
- assertThat(dp.folderCellWidthPx).isEqualTo(200)
- }
-
- @Test
- fun folderCellHeightPx() {
- assertThat(dp.folderCellHeightPx).isEqualTo(260)
- }
-
- @Test
- fun folderChildIconSizePx() {
- assertThat(dp.folderChildIconSizePx).isEqualTo(112)
- }
-
- @Test
- fun folderChildTextSizePx() {
- assertThat(dp.folderChildTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun folderChildDrawablePaddingPx() {
- assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(36)
- }
-
- @Test
- fun folderCellLayoutBorderSpaceOriginalPx() {
- assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxX() {
- assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxY() {
- assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun bottomSheetTopPadding() {
- assertThat(dp.bottomSheetTopPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsShiftRange() {
- assertThat(dp.allAppsShiftRange).isEqualTo(1600)
- }
-
- @Test
- fun allAppsTopPadding() {
- assertThat(dp.allAppsTopPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsIconSizePx() {
- assertThat(dp.allAppsIconSizePx).isEqualTo(175)
- }
-
- @Test
- fun allAppsIconTextSizePx() {
- assertThat(dp.allAppsIconTextSizePx).isEqualTo(44)
- }
-
- @Test
- fun allAppsIconDrawablePaddingPx() {
- assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun allAppsCellHeightPx() {
- assertThat(dp.allAppsCellHeightPx).isEqualTo(310)
- }
-
- @Test
- fun allAppsCellWidthPx() {
- assertThat(dp.allAppsCellWidthPx).isEqualTo(200)
- }
-
- @Test
- fun allAppsBorderSpacePxX() {
- assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(50)
- }
-
- @Test
- fun allAppsBorderSpacePxY() {
- assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(50)
- }
-
- @Test
- fun numShownAllAppsColumns() {
- assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightPadding() {
- assertThat(dp.allAppsLeftRightPadding).isEqualTo(64)
- }
-
- @Test
- fun allAppsLeftRightMargin() {
- assertThat(dp.allAppsLeftRightMargin).isEqualTo(1241)
- }
-
- @Test
- fun hotseatBarSizePx() {
- assertThat(dp.hotseatBarSizePx).isEqualTo(386)
- }
-
- @Test
- fun hotseatCellHeightPx() {
- assertThat(dp.hotseatCellHeightPx).isEqualTo(126)
- }
-
- @Test
- fun hotseatBarBottomSpacePx() {
- assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(116)
- }
-
- @Test
- fun hotseatBarSidePaddingStartPx() {
- assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSidePaddingEndPx() {
- assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatQsbSpace() {
- assertThat(dp.hotseatQsbSpace).isEqualTo(56)
- }
-
- @Test
- fun hotseatQsbHeight() {
- assertThat(dp.hotseatQsbHeight).isEqualTo(126)
- }
-
- @Test
- fun springLoadedHotseatBarTopMarginPx() {
- assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(128)
- }
-
- @Test
- fun numShownHotseatIcons() {
- assertThat(dp.numShownHotseatIcons).isEqualTo(6)
- }
-
- @Test
- fun hotseatBorderSpace() {
- assertThat(dp.hotseatBorderSpace).isEqualTo(32)
- }
-
- @Test
- fun isQsbInline() {
- assertThat(dp.isQsbInline).isEqualTo(false)
- }
-
- @Test
- fun qsbWidth() {
- assertThat(dp.qsbWidth).isEqualTo(1039)
- }
-
- @Test
- fun isTaskbarPresent() {
- assertThat(dp.isTaskbarPresent).isEqualTo(true)
- }
-
- @Test
- fun isTaskbarPresentInApps() {
- assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
- }
-
- @Test
- fun taskbarSize() {
- assertThat(dp.taskbarSize).isEqualTo(120)
- }
-
- @Test
- fun desiredWorkspaceHorizontalMarginPx() {
- assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(68)
- }
-
- @Test
- fun workspacePaddingLeft() {
- assertThat(dp.workspacePadding.left).isEqualTo(43)
- }
-
- @Test
- fun workspacePaddingTop() {
- assertThat(dp.workspacePadding.top).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingRight() {
- assertThat(dp.workspacePadding.right).isEqualTo(43)
- }
-
- @Test
- fun workspacePaddingBottom() {
- assertThat(dp.workspacePadding.bottom).isEqualTo(285)
- }
-
- @Test
- fun iconScale() {
- assertThat(dp.iconScale).isEqualTo(1)
- }
-
- @Test
- fun cellScaleToFit() {
- assertThat(dp.cellScaleToFit).isEqualTo(1.5657895f)
- }
-
- @Test
- fun workspaceTopPadding() {
- assertThat(dp.workspaceTopPadding).isEqualTo(0)
- }
-
- @Test
- fun workspaceBottomPadding() {
- assertThat(dp.workspaceBottomPadding).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskMarginPx() {
- assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskMarginGridPx() {
- assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskIconSizePx() {
- assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
- }
-
- @Test
- fun overviewTaskIconDrawableSizePx() {
- assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskIconDrawableSizeGridPx() {
- assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskThumbnailTopMarginPx() {
- assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
- }
-
- @Test
- fun overviewActionsTopMarginPx() {
- assertThat(dp.overviewActionsTopMarginPx).isEqualTo(40)
- }
-
- @Test
- fun overviewActionsHeight() {
- assertThat(dp.overviewActionsHeight).isEqualTo(96)
- }
-
- @Test
- fun overviewActionsButtonSpacing() {
- assertThat(dp.overviewActionsButtonSpacing).isEqualTo(72)
- }
-
- @Test
- fun overviewPageSpacing() {
- assertThat(dp.overviewPageSpacing).isEqualTo(88)
- }
-
- @Test
- fun overviewRowSpacing() {
- assertThat(dp.overviewRowSpacing).isEqualTo(40)
- }
-
- @Test
- fun overviewGridSideMargin() {
- assertThat(dp.overviewGridSideMargin).isEqualTo(128)
- }
-
- @Test
- fun dropTargetBarTopMarginPx() {
- assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(0)
- }
-
- @Test
- fun dropTargetBarSizePx() {
- assertThat(dp.dropTargetBarSizePx).isEqualTo(144)
- }
-
- @Test
- fun dropTargetBarBottomMarginPx() {
- assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(64)
- }
-
- @Test
- fun workspaceSpringLoadedMinNextPageVisiblePx() {
- assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(48)
- }
-
- @Test
- fun getWorkspaceSpringLoadScale() {
- assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.7226337f)
- }
-
- @Test
- fun getCellLayoutHeight() {
- assertThat(dp.cellLayoutHeight).isEqualTo(1215)
- }
-
- @Test
- fun getCellLayoutWidth() {
- assertThat(dp.cellLayoutWidth).isEqualTo(1237)
- }
-
- @Test
- fun getPanelCount() {
- assertThat(dp.panelCount).isEqualTo(2)
- }
-
- @Test
- fun isVerticalBarLayout() {
- assertThat(dp.isVerticalBarLayout).isEqualTo(false)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkTop() {
- assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(208)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkBottom() {
- assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1086)
- }
-
- @Test
- fun getQsbOffsetY() {
- assertThat(dp.qsbOffsetY).isEqualTo(272)
- }
-
- @Test
- fun getTaskbarOffsetY() {
- assertThat(dp.taskbarOffsetY).isEqualTo(112)
- }
-
- @Test
- fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(864)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(151)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(864)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- 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
deleted file mode 100644
index ba3ef55..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscapeTest.kt
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * 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.quickstep
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.launcher3.DeviceProfile
-import com.android.launcher3.DeviceProfileBaseTest
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Tests for DeviceProfile for two panel in landscape.
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class DeviceProfileTwoPanelLandscapeTest : DeviceProfileBaseTest() {
-
- lateinit var dp: DeviceProfile
-
- @Before
- fun before() {
- initializeVarsForTablet(isLandscape = true, isTwoPanel = true)
- dp = newDP()
- }
-
- @Test
- fun isScalableGrid() {
- assertThat(dp.isScalableGrid).isTrue()
- }
-
- @Test
- fun cellWidthPx() {
- assertThat(dp.cellWidthPx).isEqualTo(200)
- }
-
- @Test
- fun cellHeightPx() {
- assertThat(dp.cellHeightPx).isEqualTo(260)
- }
-
- @Test
- fun getCellSizeX() {
- assertThat(dp.cellSize.x).isEqualTo(259)
- }
-
- @Test
- fun getCellSizeY() {
- assertThat(dp.cellSize.y).isEqualTo(260)
- }
-
- @Test
- fun cellLayoutBorderSpacePxX() {
- assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(50)
- }
-
- @Test
- fun cellLayoutBorderSpacePxY() {
- assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(50)
- }
-
- @Test
- fun cellLayoutPaddingPxLeft() {
- assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(25)
- }
-
- @Test
- fun cellLayoutPaddingPxTop() {
- assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxRight() {
- assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(25)
- }
-
- @Test
- fun cellLayoutPaddingPxBottom() {
- assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(25)
- }
-
- @Test
- fun iconSizePx() {
- assertThat(dp.iconSizePx).isEqualTo(112)
- }
-
- @Test
- fun iconTextSizePx() {
- assertThat(dp.iconTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun iconDrawablePaddingPx() {
- assertThat(dp.iconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun folderCellWidthPx() {
- assertThat(dp.folderCellWidthPx).isEqualTo(200)
- }
-
- @Test
- fun folderCellHeightPx() {
- assertThat(dp.folderCellHeightPx).isEqualTo(260)
- }
-
- @Test
- fun folderChildIconSizePx() {
- assertThat(dp.folderChildIconSizePx).isEqualTo(112)
- }
-
- @Test
- fun folderChildTextSizePx() {
- assertThat(dp.folderChildTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun folderChildDrawablePaddingPx() {
- assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(36)
- }
-
- @Test
- fun folderCellLayoutBorderSpaceOriginalPx() {
- assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxX() {
- assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxY() {
- assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun bottomSheetTopPadding() {
- assertThat(dp.bottomSheetTopPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsShiftRange() {
- assertThat(dp.allAppsShiftRange).isEqualTo(1600)
- }
-
- @Test
- fun allAppsTopPadding() {
- assertThat(dp.allAppsTopPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsIconSizePx() {
- assertThat(dp.allAppsIconSizePx).isEqualTo(175)
- }
-
- @Test
- fun allAppsIconTextSizePx() {
- assertThat(dp.allAppsIconTextSizePx).isEqualTo(44)
- }
-
- @Test
- fun allAppsIconDrawablePaddingPx() {
- assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun allAppsCellHeightPx() {
- assertThat(dp.allAppsCellHeightPx).isEqualTo(310)
- }
-
- @Test
- fun allAppsCellWidthPx() {
- assertThat(dp.allAppsCellWidthPx).isEqualTo(200)
- }
-
- @Test
- fun allAppsBorderSpacePxX() {
- assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(50)
- }
-
- @Test
- fun allAppsBorderSpacePxY() {
- assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(50)
- }
-
- @Test
- fun numShownAllAppsColumns() {
- assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightPadding() {
- assertThat(dp.allAppsLeftRightPadding).isEqualTo(64)
- }
-
- @Test
- fun allAppsLeftRightMargin() {
- assertThat(dp.allAppsLeftRightMargin).isEqualTo(1241)
- }
-
- @Test
- fun hotseatBarSizePx() {
- assertThat(dp.hotseatBarSizePx).isEqualTo(386)
- }
-
- @Test
- fun hotseatCellHeightPx() {
- assertThat(dp.hotseatCellHeightPx).isEqualTo(126)
- }
-
- @Test
- fun hotseatBarBottomSpacePx() {
- assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(116)
- }
-
- @Test
- fun hotseatBarSidePaddingStartPx() {
- assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSidePaddingEndPx() {
- assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatQsbSpace() {
- assertThat(dp.hotseatQsbSpace).isEqualTo(56)
- }
-
- @Test
- fun hotseatQsbHeight() {
- assertThat(dp.hotseatQsbHeight).isEqualTo(126)
- }
-
- @Test
- fun springLoadedHotseatBarTopMarginPx() {
- assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(128)
- }
-
- @Test
- fun numShownHotseatIcons() {
- assertThat(dp.numShownHotseatIcons).isEqualTo(6)
- }
-
- @Test
- fun hotseatBorderSpace() {
- assertThat(dp.hotseatBorderSpace).isEqualTo(73)
- }
-
- @Test
- fun isQsbInline() {
- assertThat(dp.isQsbInline).isEqualTo(false)
- }
-
- @Test
- fun qsbWidth() {
- assertThat(dp.qsbWidth).isEqualTo(1039)
- }
-
- @Test
- fun isTaskbarPresent() {
- assertThat(dp.isTaskbarPresent).isEqualTo(true)
- }
-
- @Test
- fun isTaskbarPresentInApps() {
- assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
- }
-
- @Test
- fun taskbarSize() {
- assertThat(dp.taskbarSize).isEqualTo(120)
- }
-
- @Test
- fun desiredWorkspaceHorizontalMarginPx() {
- assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(68)
- }
-
- @Test
- fun workspacePaddingLeft() {
- assertThat(dp.workspacePadding.left).isEqualTo(43)
- }
-
- @Test
- fun workspacePaddingTop() {
- assertThat(dp.workspacePadding.top).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingRight() {
- assertThat(dp.workspacePadding.right).isEqualTo(43)
- }
-
- @Test
- fun workspacePaddingBottom() {
- assertThat(dp.workspacePadding.bottom).isEqualTo(285)
- }
-
- @Test
- fun iconScale() {
- assertThat(dp.iconScale).isEqualTo(1)
- }
-
- @Test
- fun cellScaleToFit() {
- assertThat(dp.cellScaleToFit).isEqualTo(1.5657895f)
- }
-
- @Test
- fun workspaceTopPadding() {
- assertThat(dp.workspaceTopPadding).isEqualTo(0)
- }
-
- @Test
- fun workspaceBottomPadding() {
- assertThat(dp.workspaceBottomPadding).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskMarginPx() {
- assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskMarginGridPx() {
- assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskIconSizePx() {
- assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
- }
-
- @Test
- fun overviewTaskIconDrawableSizePx() {
- assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskIconDrawableSizeGridPx() {
- assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskThumbnailTopMarginPx() {
- assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
- }
-
- @Test
- fun overviewActionsTopMarginPx() {
- assertThat(dp.overviewActionsTopMarginPx).isEqualTo(40)
- }
-
- @Test
- fun overviewActionsHeight() {
- assertThat(dp.overviewActionsHeight).isEqualTo(96)
- }
-
- @Test
- fun overviewActionsButtonSpacing() {
- assertThat(dp.overviewActionsButtonSpacing).isEqualTo(72)
- }
-
- @Test
- fun overviewPageSpacing() {
- assertThat(dp.overviewPageSpacing).isEqualTo(88)
- }
-
- @Test
- fun overviewRowSpacing() {
- assertThat(dp.overviewRowSpacing).isEqualTo(40)
- }
-
- @Test
- fun overviewGridSideMargin() {
- assertThat(dp.overviewGridSideMargin).isEqualTo(128)
- }
-
- @Test
- fun dropTargetBarTopMarginPx() {
- assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(0)
- }
-
- @Test
- fun dropTargetBarSizePx() {
- assertThat(dp.dropTargetBarSizePx).isEqualTo(144)
- }
-
- @Test
- fun dropTargetBarBottomMarginPx() {
- assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(64)
- }
-
- @Test
- fun workspaceSpringLoadedMinNextPageVisiblePx() {
- assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(48)
- }
-
- @Test
- fun getWorkspaceSpringLoadScale() {
- assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.7226337f)
- }
-
- @Test
- fun getCellLayoutHeight() {
- assertThat(dp.cellLayoutHeight).isEqualTo(1215)
- }
-
- @Test
- fun getCellLayoutWidth() {
- assertThat(dp.cellLayoutWidth).isEqualTo(1237)
- }
-
- @Test
- fun getPanelCount() {
- assertThat(dp.panelCount).isEqualTo(2)
- }
-
- @Test
- fun isVerticalBarLayout() {
- assertThat(dp.isVerticalBarLayout).isEqualTo(false)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkTop() {
- assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(208)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkBottom() {
- assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1086)
- }
-
- @Test
- fun getQsbOffsetY() {
- assertThat(dp.qsbOffsetY).isEqualTo(272)
- }
-
- @Test
- fun getTaskbarOffsetY() {
- assertThat(dp.taskbarOffsetY).isEqualTo(112)
- }
-
- @Test
- fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(761)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(151)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(761)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
- }
-}
\ 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
deleted file mode 100644
index a4b446a..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortrait3ButtonTest.kt
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * 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.quickstep
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.launcher3.DeviceProfile
-import com.android.launcher3.DeviceProfileBaseTest
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Tests for DeviceProfile for two panel in portrait with 3-Button navigation.
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class DeviceProfileTwoPanelPortrait3ButtonTest : DeviceProfileBaseTest() {
-
- lateinit var dp: DeviceProfile
-
- @Before
- fun before() {
- initializeVarsForTablet(isTwoPanel = true, isGestureMode = false)
- dp = newDP()
- }
-
- @Test
- fun isScalableGrid() {
- assertThat(dp.isScalableGrid).isTrue()
- }
-
- @Test
- fun cellWidthPx() {
- assertThat(dp.cellWidthPx).isEqualTo(153)
- }
-
- @Test
- fun cellHeightPx() {
- assertThat(dp.cellHeightPx).isEqualTo(199)
- }
-
- @Test
- fun getCellSizeX() {
- assertThat(dp.cellSize.x).isEqualTo(153)
- }
-
- @Test
- fun getCellSizeY() {
- assertThat(dp.cellSize.y).isEqualTo(509)
- }
-
- @Test
- fun cellLayoutBorderSpacePxX() {
- assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(38)
- }
-
- @Test
- fun cellLayoutBorderSpacePxY() {
- assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(38)
- }
-
- @Test
- fun cellLayoutPaddingPxLeft() {
- assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(19)
- }
-
- @Test
- fun cellLayoutPaddingPxTop() {
- assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxRight() {
- assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(19)
- }
-
- @Test
- fun cellLayoutPaddingPxBottom() {
- assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(19)
- }
-
- @Test
- fun iconSizePx() {
- assertThat(dp.iconSizePx).isEqualTo(112)
- }
-
- @Test
- fun iconTextSizePx() {
- assertThat(dp.iconTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun iconDrawablePaddingPx() {
- assertThat(dp.iconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun folderCellWidthPx() {
- assertThat(dp.folderCellWidthPx).isEqualTo(153)
- }
-
- @Test
- fun folderCellHeightPx() {
- assertThat(dp.folderCellHeightPx).isEqualTo(199)
- }
-
- @Test
- fun folderChildIconSizePx() {
- assertThat(dp.folderChildIconSizePx).isEqualTo(112)
- }
-
- @Test
- fun folderChildTextSizePx() {
- assertThat(dp.folderChildTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun folderChildDrawablePaddingPx() {
- assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(16)
- }
-
- @Test
- fun folderCellLayoutBorderSpaceOriginalPx() {
- assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxX() {
- assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxY() {
- assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun bottomSheetTopPadding() {
- assertThat(dp.bottomSheetTopPadding).isEqualTo(600)
- }
-
- @Test
- fun allAppsShiftRange() {
- assertThat(dp.allAppsShiftRange).isEqualTo(1960)
- }
-
- @Test
- fun allAppsTopPadding() {
- assertThat(dp.allAppsTopPadding).isEqualTo(600)
- }
-
- @Test
- fun allAppsIconSizePx() {
- assertThat(dp.allAppsIconSizePx).isEqualTo(134)
- }
-
- @Test
- fun allAppsIconTextSizePx() {
- assertThat(dp.allAppsIconTextSizePx).isEqualTo(34)
- }
-
- @Test
- fun allAppsIconDrawablePaddingPx() {
- assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun allAppsCellHeightPx() {
- assertThat(dp.allAppsCellHeightPx).isEqualTo(237)
- }
-
- @Test
- fun allAppsCellWidthPx() {
- assertThat(dp.allAppsCellWidthPx).isEqualTo(153)
- }
-
- @Test
- fun allAppsBorderSpacePxX() {
- assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(38)
- }
-
- @Test
- fun allAppsBorderSpacePxY() {
- assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(38)
- }
-
- @Test
- fun numShownAllAppsColumns() {
- assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightPadding() {
- assertThat(dp.allAppsLeftRightPadding).isEqualTo(56)
- }
-
- @Test
- fun allAppsLeftRightMargin() {
- assertThat(dp.allAppsLeftRightMargin).isEqualTo(763)
- }
-
- @Test
- fun hotseatBarSizePx() {
- assertThat(dp.hotseatBarSizePx).isEqualTo(386)
- }
-
- @Test
- fun hotseatCellHeightPx() {
- assertThat(dp.hotseatCellHeightPx).isEqualTo(126)
- }
-
- @Test
- fun hotseatBarBottomSpacePx() {
- assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(116)
- }
-
- @Test
- fun hotseatBarSidePaddingStartPx() {
- assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSidePaddingEndPx() {
- assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatQsbSpace() {
- assertThat(dp.hotseatQsbSpace).isEqualTo(56)
- }
-
- @Test
- fun hotseatQsbHeight() {
- assertThat(dp.hotseatQsbHeight).isEqualTo(126)
- }
-
- @Test
- fun springLoadedHotseatBarTopMarginPx() {
- assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(216)
- }
-
- @Test
- fun numShownHotseatIcons() {
- assertThat(dp.numShownHotseatIcons).isEqualTo(6)
- }
-
- @Test
- fun hotseatBorderSpace() {
- assertThat(dp.hotseatBorderSpace).isEqualTo(32)
- }
-
- @Test
- fun isQsbInline() {
- assertThat(dp.isQsbInline).isEqualTo(false)
- }
-
- @Test
- fun qsbWidth() {
- assertThat(dp.qsbWidth).isEqualTo(685)
- }
-
- @Test
- fun isTaskbarPresent() {
- assertThat(dp.isTaskbarPresent).isEqualTo(true)
- }
-
- @Test
- fun isTaskbarPresentInApps() {
- assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
- }
-
- @Test
- fun taskbarSize() {
- assertThat(dp.taskbarSize).isEqualTo(120)
- }
-
- @Test
- fun desiredWorkspaceHorizontalMarginPx() {
- assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(52)
- }
-
- @Test
- fun workspacePaddingLeft() {
- assertThat(dp.workspacePadding.left).isEqualTo(33)
- }
-
- @Test
- fun workspacePaddingTop() {
- assertThat(dp.workspacePadding.top).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingRight() {
- assertThat(dp.workspacePadding.right).isEqualTo(33)
- }
-
- @Test
- fun workspacePaddingBottom() {
- assertThat(dp.workspacePadding.bottom).isEqualTo(291)
- }
-
- @Test
- fun iconScale() {
- assertThat(dp.iconScale).isEqualTo(1)
- }
-
- @Test
- fun cellScaleToFit() {
- assertThat(dp.cellScaleToFit).isEqualTo(1.1976048f)
- }
-
- @Test
- fun workspaceTopPadding() {
- assertThat(dp.workspaceTopPadding).isEqualTo(0)
- }
-
- @Test
- fun workspaceBottomPadding() {
- assertThat(dp.workspaceBottomPadding).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskMarginPx() {
- assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskMarginGridPx() {
- assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskIconSizePx() {
- assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
- }
-
- @Test
- fun overviewTaskIconDrawableSizePx() {
- assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskIconDrawableSizeGridPx() {
- assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskThumbnailTopMarginPx() {
- assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
- }
-
- @Test
- fun overviewActionsTopMarginPx() {
- assertThat(dp.overviewActionsTopMarginPx).isEqualTo(48)
- }
-
- @Test
- fun overviewActionsHeight() {
- assertThat(dp.overviewActionsHeight).isEqualTo(96)
- }
-
- @Test
- fun overviewActionsButtonSpacing() {
- assertThat(dp.overviewActionsButtonSpacing).isEqualTo(72)
- }
-
- @Test
- fun overviewPageSpacing() {
- assertThat(dp.overviewPageSpacing).isEqualTo(88)
- }
-
- @Test
- fun overviewRowSpacing() {
- assertThat(dp.overviewRowSpacing).isEqualTo(40)
- }
-
- @Test
- fun overviewGridSideMargin() {
- assertThat(dp.overviewGridSideMargin).isEqualTo(128)
- }
-
- @Test
- fun dropTargetBarTopMarginPx() {
- assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(220)
- }
-
- @Test
- fun dropTargetBarSizePx() {
- assertThat(dp.dropTargetBarSizePx).isEqualTo(144)
- }
-
- @Test
- fun dropTargetBarBottomMarginPx() {
- assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(96)
- }
-
- @Test
- fun workspaceSpringLoadedMinNextPageVisiblePx() {
- assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(48)
- }
-
- @Test
- fun getWorkspaceSpringLoadScale() {
- assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.69064087f)
- }
-
- @Test
- fun getCellLayoutHeight() {
- assertThat(dp.cellLayoutHeight).isEqualTo(2169)
- }
-
- @Test
- fun getCellLayoutWidth() {
- assertThat(dp.cellLayoutWidth).isEqualTo(767)
- }
-
- @Test
- fun getPanelCount() {
- assertThat(dp.panelCount).isEqualTo(2)
- }
-
- @Test
- fun isVerticalBarLayout() {
- assertThat(dp.isVerticalBarLayout).isEqualTo(false)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkTop() {
- assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(460)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkBottom() {
- assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1958)
- }
-
- @Test
- fun getQsbOffsetY() {
- assertThat(dp.qsbOffsetY).isEqualTo(272)
- }
-
- @Test
- fun getTaskbarOffsetY() {
- assertThat(dp.taskbarOffsetY).isEqualTo(112)
- }
-
- @Test
- fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(266)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(151)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(502)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- 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
deleted file mode 100644
index 0c5968e..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortraitTest.kt
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * 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.quickstep
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.launcher3.DeviceProfile
-import com.android.launcher3.DeviceProfileBaseTest
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Tests for DeviceProfile for two panel in portrait.
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class DeviceProfileTwoPanelPortraitTest : DeviceProfileBaseTest() {
-
- lateinit var dp: DeviceProfile
-
- @Before
- fun before() {
- initializeVarsForTablet(isTwoPanel = true)
- dp = newDP()
- }
-
- @Test
- fun isScalableGrid() {
- assertThat(dp.isScalableGrid).isTrue()
- }
-
- @Test
- fun cellWidthPx() {
- assertThat(dp.cellWidthPx).isEqualTo(153)
- }
-
- @Test
- fun cellHeightPx() {
- assertThat(dp.cellHeightPx).isEqualTo(199)
- }
-
- @Test
- fun getCellSizeX() {
- assertThat(dp.cellSize.x).isEqualTo(153)
- }
-
- @Test
- fun getCellSizeY() {
- assertThat(dp.cellSize.y).isEqualTo(509)
- }
-
- @Test
- fun cellLayoutBorderSpacePxX() {
- assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(38)
- }
-
- @Test
- fun cellLayoutBorderSpacePxY() {
- assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(38)
- }
-
- @Test
- fun cellLayoutPaddingPxLeft() {
- assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(19)
- }
-
- @Test
- fun cellLayoutPaddingPxTop() {
- assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxRight() {
- assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(19)
- }
-
- @Test
- fun cellLayoutPaddingPxBottom() {
- assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(19)
- }
-
- @Test
- fun iconSizePx() {
- assertThat(dp.iconSizePx).isEqualTo(112)
- }
-
- @Test
- fun iconTextSizePx() {
- assertThat(dp.iconTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun iconDrawablePaddingPx() {
- assertThat(dp.iconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun folderCellWidthPx() {
- assertThat(dp.folderCellWidthPx).isEqualTo(153)
- }
-
- @Test
- fun folderCellHeightPx() {
- assertThat(dp.folderCellHeightPx).isEqualTo(199)
- }
-
- @Test
- fun folderChildIconSizePx() {
- assertThat(dp.folderChildIconSizePx).isEqualTo(112)
- }
-
- @Test
- fun folderChildTextSizePx() {
- assertThat(dp.folderChildTextSizePx).isEqualTo(28)
- }
-
- @Test
- fun folderChildDrawablePaddingPx() {
- assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(16)
- }
-
- @Test
- fun folderCellLayoutBorderSpaceOriginalPx() {
- assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxX() {
- assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxY() {
- assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun bottomSheetTopPadding() {
- assertThat(dp.bottomSheetTopPadding).isEqualTo(600)
- }
-
- @Test
- fun allAppsShiftRange() {
- assertThat(dp.allAppsShiftRange).isEqualTo(1960)
- }
-
- @Test
- fun allAppsTopPadding() {
- assertThat(dp.allAppsTopPadding).isEqualTo(600)
- }
-
- @Test
- fun allAppsIconSizePx() {
- assertThat(dp.allAppsIconSizePx).isEqualTo(134)
- }
-
- @Test
- fun allAppsIconTextSizePx() {
- assertThat(dp.allAppsIconTextSizePx).isEqualTo(34)
- }
-
- @Test
- fun allAppsIconDrawablePaddingPx() {
- assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun allAppsCellHeightPx() {
- assertThat(dp.allAppsCellHeightPx).isEqualTo(237)
- }
-
- @Test
- fun allAppsCellWidthPx() {
- assertThat(dp.allAppsCellWidthPx).isEqualTo(153)
- }
-
- @Test
- fun allAppsBorderSpacePxX() {
- assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(38)
- }
-
- @Test
- fun allAppsBorderSpacePxY() {
- assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(38)
- }
-
- @Test
- fun numShownAllAppsColumns() {
- assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightPadding() {
- assertThat(dp.allAppsLeftRightPadding).isEqualTo(56)
- }
-
- @Test
- fun allAppsLeftRightMargin() {
- assertThat(dp.allAppsLeftRightMargin).isEqualTo(763)
- }
-
- @Test
- fun hotseatBarSizePx() {
- assertThat(dp.hotseatBarSizePx).isEqualTo(386)
- }
-
- @Test
- fun hotseatCellHeightPx() {
- assertThat(dp.hotseatCellHeightPx).isEqualTo(126)
- }
-
- @Test
- fun hotseatBarBottomSpacePx() {
- assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(116)
- }
-
- @Test
- fun hotseatBarSidePaddingStartPx() {
- assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSidePaddingEndPx() {
- assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
- }
-
- @Test
- fun hotseatQsbSpace() {
- assertThat(dp.hotseatQsbSpace).isEqualTo(56)
- }
-
- @Test
- fun hotseatQsbHeight() {
- assertThat(dp.hotseatQsbHeight).isEqualTo(126)
- }
-
- @Test
- fun springLoadedHotseatBarTopMarginPx() {
- assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(216)
- }
-
- @Test
- fun numShownHotseatIcons() {
- assertThat(dp.numShownHotseatIcons).isEqualTo(6)
- }
-
- @Test
- fun hotseatBorderSpace() {
- assertThat(dp.hotseatBorderSpace).isEqualTo(2)
- }
-
- @Test
- fun isQsbInline() {
- assertThat(dp.isQsbInline).isEqualTo(false)
- }
-
- @Test
- fun qsbWidth() {
- assertThat(dp.qsbWidth).isEqualTo(685)
- }
-
- @Test
- fun isTaskbarPresent() {
- assertThat(dp.isTaskbarPresent).isEqualTo(true)
- }
-
- @Test
- fun isTaskbarPresentInApps() {
- assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
- }
-
- @Test
- fun taskbarSize() {
- assertThat(dp.taskbarSize).isEqualTo(120)
- }
-
- @Test
- fun desiredWorkspaceHorizontalMarginPx() {
- assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(52)
- }
-
- @Test
- fun workspacePaddingLeft() {
- assertThat(dp.workspacePadding.left).isEqualTo(33)
- }
-
- @Test
- fun workspacePaddingTop() {
- assertThat(dp.workspacePadding.top).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingRight() {
- assertThat(dp.workspacePadding.right).isEqualTo(33)
- }
-
- @Test
- fun workspacePaddingBottom() {
- assertThat(dp.workspacePadding.bottom).isEqualTo(291)
- }
-
- @Test
- fun iconScale() {
- assertThat(dp.iconScale).isEqualTo(1)
- }
-
- @Test
- fun cellScaleToFit() {
- assertThat(dp.cellScaleToFit).isEqualTo(1.1976048f)
- }
-
- @Test
- fun workspaceTopPadding() {
- assertThat(dp.workspaceTopPadding).isEqualTo(0)
- }
-
- @Test
- fun workspaceBottomPadding() {
- assertThat(dp.workspaceBottomPadding).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskMarginPx() {
- assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskMarginGridPx() {
- assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
- }
-
- @Test
- fun overviewTaskIconSizePx() {
- assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
- }
-
- @Test
- fun overviewTaskIconDrawableSizePx() {
- assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskIconDrawableSizeGridPx() {
- assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(88)
- }
-
- @Test
- fun overviewTaskThumbnailTopMarginPx() {
- assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
- }
-
- @Test
- fun overviewActionsTopMarginPx() {
- assertThat(dp.overviewActionsTopMarginPx).isEqualTo(48)
- }
-
- @Test
- fun overviewActionsHeight() {
- assertThat(dp.overviewActionsHeight).isEqualTo(96)
- }
-
- @Test
- fun overviewActionsButtonSpacing() {
- assertThat(dp.overviewActionsButtonSpacing).isEqualTo(72)
- }
-
- @Test
- fun overviewPageSpacing() {
- assertThat(dp.overviewPageSpacing).isEqualTo(88)
- }
-
- @Test
- fun overviewRowSpacing() {
- assertThat(dp.overviewRowSpacing).isEqualTo(40)
- }
-
- @Test
- fun overviewGridSideMargin() {
- assertThat(dp.overviewGridSideMargin).isEqualTo(128)
- }
-
- @Test
- fun dropTargetBarTopMarginPx() {
- assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(220)
- }
-
- @Test
- fun dropTargetBarSizePx() {
- assertThat(dp.dropTargetBarSizePx).isEqualTo(144)
- }
-
- @Test
- fun dropTargetBarBottomMarginPx() {
- assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(96)
- }
-
- @Test
- fun workspaceSpringLoadedMinNextPageVisiblePx() {
- assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(48)
- }
-
- @Test
- fun getWorkspaceSpringLoadScale() {
- assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.69064087f)
- }
-
- @Test
- fun getCellLayoutHeight() {
- assertThat(dp.cellLayoutHeight).isEqualTo(2169)
- }
-
- @Test
- fun getCellLayoutWidth() {
- assertThat(dp.cellLayoutWidth).isEqualTo(767)
- }
-
- @Test
- fun getPanelCount() {
- assertThat(dp.panelCount).isEqualTo(2)
- }
-
- @Test
- fun isVerticalBarLayout() {
- assertThat(dp.isVerticalBarLayout).isEqualTo(false)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkTop() {
- assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(460)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkBottom() {
- assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1958)
- }
-
- @Test
- fun getQsbOffsetY() {
- assertThat(dp.qsbOffsetY).isEqualTo(272)
- }
-
- @Test
- fun getTaskbarOffsetY() {
- assertThat(dp.taskbarOffsetY).isEqualTo(112)
- }
-
- @Test
- fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(459)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(151)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(459)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
- }
-}
\ 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
deleted file mode 100644
index 2bad6bb..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBar3ButtonTest.kt
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * 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.quickstep
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.launcher3.DeviceProfile
-import com.android.launcher3.DeviceProfileBaseTest
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Tests for DeviceProfile for landscape phone with vertical bar and 3-Button navigation.
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class DeviceProfileVerticalBar3ButtonTest : DeviceProfileBaseTest() {
-
- lateinit var dp: DeviceProfile
-
- @Before
- fun before() {
- initializeVarsForPhone(isVerticalBar = true, isGestureMode = false)
- dp = newDP()
- }
-
- @Test
- fun isScalableGrid() {
- assertThat(dp.isScalableGrid).isFalse()
- }
-
- @Test
- fun cellWidthPx() {
- assertThat(dp.cellWidthPx).isEqualTo(210)
- }
-
- @Test
- fun cellHeightPx() {
- assertThat(dp.cellHeightPx).isEqualTo(221)
- }
-
- @Test
- fun getCellSizeX() {
- assertThat(dp.cellSize.x).isEqualTo(675)
- }
-
- @Test
- fun getCellSizeY() {
- assertThat(dp.cellSize.y).isEqualTo(321)
- }
-
- @Test
- fun cellLayoutBorderSpacePxX() {
- assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutBorderSpacePxY() {
- assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxLeft() {
- assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(70)
- }
-
- @Test
- fun cellLayoutPaddingPxTop() {
- assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxRight() {
- assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(70)
- }
-
- @Test
- fun cellLayoutPaddingPxBottom() {
- assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(53)
- }
-
- @Test
- fun iconSizePx() {
- assertThat(dp.iconSizePx).isEqualTo(196)
- }
-
- @Test
- fun iconTextSizePx() {
- assertThat(dp.iconTextSizePx).isEqualTo(0)
- }
-
- @Test
- fun iconDrawablePaddingPx() {
- assertThat(dp.iconDrawablePaddingPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellWidthPx() {
- assertThat(dp.folderCellWidthPx).isEqualTo(260)
- }
-
- @Test
- fun folderCellHeightPx() {
- assertThat(dp.folderCellHeightPx).isEqualTo(304)
- }
-
- @Test
- fun folderChildIconSizePx() {
- assertThat(dp.folderChildIconSizePx).isEqualTo(196)
- }
-
- @Test
- fun folderChildTextSizePx() {
- assertThat(dp.folderChildTextSizePx).isEqualTo(49)
- }
-
- @Test
- fun folderChildDrawablePaddingPx() {
- assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun folderCellLayoutBorderSpaceOriginalPx() {
- assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxX() {
- assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxY() {
- assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun bottomSheetTopPadding() {
- assertThat(dp.bottomSheetTopPadding).isEqualTo(53)
- }
-
- @Test
- fun allAppsShiftRange() {
- assertThat(dp.allAppsShiftRange).isEqualTo(1050)
- }
-
- @Test
- fun allAppsTopPadding() {
- assertThat(dp.allAppsTopPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsIconSizePx() {
- assertThat(dp.allAppsIconSizePx).isEqualTo(196)
- }
-
- @Test
- fun allAppsIconTextSizePx() {
- assertThat(dp.allAppsIconTextSizePx).isEqualTo(49)
- }
-
- @Test
- fun allAppsIconDrawablePaddingPx() {
- assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(28)
- }
-
- @Test
- fun allAppsCellHeightPx() {
- assertThat(dp.allAppsCellHeightPx).isEqualTo(422)
- }
-
- @Test
- fun allAppsCellWidthPx() {
- assertThat(dp.allAppsCellWidthPx).isEqualTo(252)
- }
-
- @Test
- fun allAppsBorderSpacePxX() {
- assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(56)
- }
-
- @Test
- fun allAppsBorderSpacePxY() {
- assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(56)
- }
-
- @Test
- fun numShownAllAppsColumns() {
- assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightPadding() {
- assertThat(dp.allAppsLeftRightPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightMargin() {
- assertThat(dp.allAppsLeftRightMargin).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSizePx() {
- assertThat(dp.hotseatBarSizePx).isEqualTo(336)
- }
-
- @Test
- fun hotseatCellHeightPx() {
- assertThat(dp.hotseatCellHeightPx).isEqualTo(221)
- }
-
- @Test
- fun hotseatBarBottomSpacePx() {
- assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(168)
- }
-
- @Test
- fun hotseatBarSidePaddingStartPx() {
- assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(84)
- }
-
- @Test
- fun hotseatBarSidePaddingEndPx() {
- assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(56)
- }
-
- @Test
- fun hotseatQsbSpace() {
- assertThat(dp.hotseatQsbSpace).isEqualTo(126)
- }
-
- @Test
- fun hotseatQsbHeight() {
- assertThat(dp.hotseatQsbHeight).isEqualTo(221)
- }
-
- @Test
- fun springLoadedHotseatBarTopMarginPx() {
- assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(158)
- }
-
- @Test
- fun numShownHotseatIcons() {
- assertThat(dp.numShownHotseatIcons).isEqualTo(4)
- }
-
- @Test
- fun hotseatBorderSpace() {
- assertThat(dp.hotseatBorderSpace).isEqualTo(0)
- }
-
- @Test
- fun isQsbInline() {
- assertThat(dp.isQsbInline).isEqualTo(false)
- }
-
- @Test
- fun qsbWidth() {
- assertThat(dp.qsbWidth).isEqualTo(2221)
- }
-
- @Test
- fun isTaskbarPresent() {
- assertThat(dp.isTaskbarPresent).isEqualTo(false)
- }
-
- @Test
- fun isTaskbarPresentInApps() {
- assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
- }
-
- @Test
- fun taskbarSize() {
- assertThat(dp.taskbarSize).isEqualTo(0)
- }
-
- @Test
- fun desiredWorkspaceHorizontalMarginPx() {
- assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingLeft() {
- assertThat(dp.workspacePadding.left).isEqualTo(14)
- }
-
- @Test
- fun workspacePaddingTop() {
- assertThat(dp.workspacePadding.top).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingRight() {
- assertThat(dp.workspacePadding.right).isEqualTo(266)
- }
-
- @Test
- fun workspacePaddingBottom() {
- assertThat(dp.workspacePadding.bottom).isEqualTo(0)
- }
-
- @Test
- fun iconScale() {
- assertThat(dp.iconScale).isEqualTo(1)
- }
-
- @Test
- fun cellScaleToFit() {
- assertThat(dp.cellScaleToFit).isEqualTo(1.0f)
- }
-
- @Test
- fun workspaceTopPadding() {
- assertThat(dp.workspaceTopPadding).isEqualTo(0)
- }
-
- @Test
- fun workspaceBottomPadding() {
- assertThat(dp.workspaceBottomPadding).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskMarginPx() {
- assertThat(dp.overviewTaskMarginPx).isEqualTo(56)
- }
-
- @Test
- fun overviewTaskMarginGridPx() {
- assertThat(dp.overviewTaskMarginGridPx).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskIconSizePx() {
- assertThat(dp.overviewTaskIconSizePx).isEqualTo(168)
- }
-
- @Test
- fun overviewTaskIconDrawableSizePx() {
- assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(154)
- }
-
- @Test
- fun overviewTaskIconDrawableSizeGridPx() {
- assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskThumbnailTopMarginPx() {
- assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(280)
- }
-
- @Test
- fun overviewActionsTopMarginPx() {
- assertThat(dp.overviewActionsTopMarginPx).isEqualTo(42)
- }
-
- @Test
- fun overviewActionsHeight() {
- assertThat(dp.overviewActionsHeight).isEqualTo(168)
- }
-
- @Test
- fun overviewActionsButtonSpacing() {
- assertThat(dp.overviewActionsButtonSpacing).isEqualTo(126)
- }
-
- @Test
- fun overviewPageSpacing() {
- assertThat(dp.overviewPageSpacing).isEqualTo(56)
- }
-
- @Test
- fun overviewRowSpacing() {
- assertThat(dp.overviewRowSpacing).isEqualTo(-112)
- }
-
- @Test
- fun overviewGridSideMargin() {
- assertThat(dp.overviewGridSideMargin).isEqualTo(0)
- }
-
- @Test
- fun dropTargetBarTopMarginPx() {
- assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(21)
- }
-
- @Test
- fun dropTargetBarSizePx() {
- assertThat(dp.dropTargetBarSizePx).isEqualTo(126)
- }
-
- @Test
- fun dropTargetBarBottomMarginPx() {
- assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(21)
- }
-
- @Test
- fun workspaceSpringLoadedMinNextPageVisiblePx() {
- assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(84)
- }
-
- @Test
- fun getWorkspaceSpringLoadScale() {
- assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.8880597f)
- }
-
- @Test
- fun getCellLayoutHeight() {
- assertThat(dp.cellLayoutHeight).isEqualTo(1340)
- }
-
- @Test
- fun getCellLayoutWidth() {
- assertThat(dp.cellLayoutWidth).isEqualTo(2840)
- }
-
- @Test
- fun getPanelCount() {
- assertThat(dp.panelCount).isEqualTo(1)
- }
-
- @Test
- fun isVerticalBarLayout() {
- assertThat(dp.isVerticalBarLayout).isEqualTo(true)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkTop() {
- assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(168)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkBottom() {
- assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1358)
- }
-
- @Test
- fun getQsbOffsetY() {
- assertThat(dp.qsbOffsetY).isEqualTo(147)
- }
-
- @Test
- fun getTaskbarOffsetY() {
- assertThat(dp.taskbarOffsetY).isEqualTo(225)
- }
-
- @Test
- fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(56)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(0)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(84)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(165)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
- }
-}
\ 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
deleted file mode 100644
index 6256a43..0000000
--- a/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBarTest.kt
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * 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.quickstep
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.launcher3.DeviceProfile
-import com.android.launcher3.DeviceProfileBaseTest
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Tests for DeviceProfile for landscape phone with vertical bar.
- */
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class DeviceProfileVerticalBarTest : DeviceProfileBaseTest() {
-
- lateinit var dp: DeviceProfile
-
- @Before
- fun before() {
- initializeVarsForPhone(isVerticalBar = true)
- dp = newDP()
- }
-
- @Test
- fun isScalableGrid() {
- assertThat(dp.isScalableGrid).isFalse()
- }
-
- @Test
- fun cellWidthPx() {
- assertThat(dp.cellWidthPx).isEqualTo(210)
- }
-
- @Test
- fun cellHeightPx() {
- assertThat(dp.cellHeightPx).isEqualTo(221)
- }
-
- @Test
- fun getCellSizeX() {
- assertThat(dp.cellSize.x).isEqualTo(675)
- }
-
- @Test
- fun getCellSizeY() {
- assertThat(dp.cellSize.y).isEqualTo(321)
- }
-
- @Test
- fun cellLayoutBorderSpacePxX() {
- assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutBorderSpacePxY() {
- assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxLeft() {
- assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(70)
- }
-
- @Test
- fun cellLayoutPaddingPxTop() {
- assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
- }
-
- @Test
- fun cellLayoutPaddingPxRight() {
- assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(70)
- }
-
- @Test
- fun cellLayoutPaddingPxBottom() {
- assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(53)
- }
-
- @Test
- fun iconSizePx() {
- assertThat(dp.iconSizePx).isEqualTo(196)
- }
-
- @Test
- fun iconTextSizePx() {
- assertThat(dp.iconTextSizePx).isEqualTo(0)
- }
-
- @Test
- fun iconDrawablePaddingPx() {
- assertThat(dp.iconDrawablePaddingPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellWidthPx() {
- assertThat(dp.folderCellWidthPx).isEqualTo(260)
- }
-
- @Test
- fun folderCellHeightPx() {
- assertThat(dp.folderCellHeightPx).isEqualTo(304)
- }
-
- @Test
- fun folderChildIconSizePx() {
- assertThat(dp.folderChildIconSizePx).isEqualTo(196)
- }
-
- @Test
- fun folderChildTextSizePx() {
- assertThat(dp.folderChildTextSizePx).isEqualTo(49)
- }
-
- @Test
- fun folderChildDrawablePaddingPx() {
- assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(14)
- }
-
- @Test
- fun folderCellLayoutBorderSpaceOriginalPx() {
- assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxX() {
- assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
- }
-
- @Test
- fun folderCellLayoutBorderSpacePxY() {
- assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
- }
-
- @Test
- fun bottomSheetTopPadding() {
- assertThat(dp.bottomSheetTopPadding).isEqualTo(53)
- }
-
- @Test
- fun allAppsShiftRange() {
- assertThat(dp.allAppsShiftRange).isEqualTo(1050)
- }
-
- @Test
- fun allAppsTopPadding() {
- assertThat(dp.allAppsTopPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsIconSizePx() {
- assertThat(dp.allAppsIconSizePx).isEqualTo(196)
- }
-
- @Test
- fun allAppsIconTextSizePx() {
- assertThat(dp.allAppsIconTextSizePx).isEqualTo(49)
- }
-
- @Test
- fun allAppsIconDrawablePaddingPx() {
- assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(28)
- }
-
- @Test
- fun allAppsCellHeightPx() {
- assertThat(dp.allAppsCellHeightPx).isEqualTo(422)
- }
-
- @Test
- fun allAppsCellWidthPx() {
- assertThat(dp.allAppsCellWidthPx).isEqualTo(252)
- }
-
- @Test
- fun allAppsBorderSpacePxX() {
- assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(56)
- }
-
- @Test
- fun allAppsBorderSpacePxY() {
- assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(56)
- }
-
- @Test
- fun numShownAllAppsColumns() {
- assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightPadding() {
- assertThat(dp.allAppsLeftRightPadding).isEqualTo(0)
- }
-
- @Test
- fun allAppsLeftRightMargin() {
- assertThat(dp.allAppsLeftRightMargin).isEqualTo(0)
- }
-
- @Test
- fun hotseatBarSizePx() {
- assertThat(dp.hotseatBarSizePx).isEqualTo(336)
- }
-
- @Test
- fun hotseatCellHeightPx() {
- assertThat(dp.hotseatCellHeightPx).isEqualTo(221)
- }
-
- @Test
- fun hotseatBarBottomSpacePx() {
- assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(168)
- }
-
- @Test
- fun hotseatBarSidePaddingStartPx() {
- assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(84)
- }
-
- @Test
- fun hotseatBarSidePaddingEndPx() {
- assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(56)
- }
-
- @Test
- fun hotseatQsbSpace() {
- assertThat(dp.hotseatQsbSpace).isEqualTo(126)
- }
-
- @Test
- fun hotseatQsbHeight() {
- assertThat(dp.hotseatQsbHeight).isEqualTo(221)
- }
-
- @Test
- fun springLoadedHotseatBarTopMarginPx() {
- assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(158)
- }
-
- @Test
- fun numShownHotseatIcons() {
- assertThat(dp.numShownHotseatIcons).isEqualTo(4)
- }
-
- @Test
- fun hotseatBorderSpace() {
- assertThat(dp.hotseatBorderSpace).isEqualTo(0)
- }
-
- @Test
- fun isQsbInline() {
- assertThat(dp.isQsbInline).isEqualTo(false)
- }
-
- @Test
- fun qsbWidth() {
- assertThat(dp.qsbWidth).isEqualTo(2221)
- }
-
- @Test
- fun isTaskbarPresent() {
- assertThat(dp.isTaskbarPresent).isEqualTo(false)
- }
-
- @Test
- fun isTaskbarPresentInApps() {
- assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
- }
-
- @Test
- fun taskbarSize() {
- assertThat(dp.taskbarSize).isEqualTo(0)
- }
-
- @Test
- fun desiredWorkspaceHorizontalMarginPx() {
- assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingLeft() {
- assertThat(dp.workspacePadding.left).isEqualTo(14)
- }
-
- @Test
- fun workspacePaddingTop() {
- assertThat(dp.workspacePadding.top).isEqualTo(0)
- }
-
- @Test
- fun workspacePaddingRight() {
- assertThat(dp.workspacePadding.right).isEqualTo(266)
- }
-
- @Test
- fun workspacePaddingBottom() {
- assertThat(dp.workspacePadding.bottom).isEqualTo(0)
- }
-
- @Test
- fun iconScale() {
- assertThat(dp.iconScale).isEqualTo(1)
- }
-
- @Test
- fun cellScaleToFit() {
- assertThat(dp.cellScaleToFit).isEqualTo(1.0f)
- }
-
- @Test
- fun workspaceTopPadding() {
- assertThat(dp.workspaceTopPadding).isEqualTo(0)
- }
-
- @Test
- fun workspaceBottomPadding() {
- assertThat(dp.workspaceBottomPadding).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskMarginPx() {
- assertThat(dp.overviewTaskMarginPx).isEqualTo(56)
- }
-
- @Test
- fun overviewTaskMarginGridPx() {
- assertThat(dp.overviewTaskMarginGridPx).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskIconSizePx() {
- assertThat(dp.overviewTaskIconSizePx).isEqualTo(168)
- }
-
- @Test
- fun overviewTaskIconDrawableSizePx() {
- assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(154)
- }
-
- @Test
- fun overviewTaskIconDrawableSizeGridPx() {
- assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(0)
- }
-
- @Test
- fun overviewTaskThumbnailTopMarginPx() {
- assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(280)
- }
-
- @Test
- fun overviewActionsTopMarginPx() {
- assertThat(dp.overviewActionsTopMarginPx).isEqualTo(42)
- }
-
- @Test
- fun overviewActionsHeight() {
- assertThat(dp.overviewActionsHeight).isEqualTo(168)
- }
-
- @Test
- fun overviewActionsButtonSpacing() {
- assertThat(dp.overviewActionsButtonSpacing).isEqualTo(126)
- }
-
- @Test
- fun overviewPageSpacing() {
- assertThat(dp.overviewPageSpacing).isEqualTo(56)
- }
-
- @Test
- fun overviewRowSpacing() {
- assertThat(dp.overviewRowSpacing).isEqualTo(-112)
- }
-
- @Test
- fun overviewGridSideMargin() {
- assertThat(dp.overviewGridSideMargin).isEqualTo(0)
- }
-
- @Test
- fun dropTargetBarTopMarginPx() {
- assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(21)
- }
-
- @Test
- fun dropTargetBarSizePx() {
- assertThat(dp.dropTargetBarSizePx).isEqualTo(126)
- }
-
- @Test
- fun dropTargetBarBottomMarginPx() {
- assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(21)
- }
-
- @Test
- fun workspaceSpringLoadedMinNextPageVisiblePx() {
- assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(84)
- }
-
- @Test
- fun getWorkspaceSpringLoadScale() {
- assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.8880597f)
- }
-
- @Test
- fun getCellLayoutHeight() {
- assertThat(dp.cellLayoutHeight).isEqualTo(1340)
- }
-
- @Test
- fun getCellLayoutWidth() {
- assertThat(dp.cellLayoutWidth).isEqualTo(2840)
- }
-
- @Test
- fun getPanelCount() {
- assertThat(dp.panelCount).isEqualTo(1)
- }
-
- @Test
- fun isVerticalBarLayout() {
- assertThat(dp.isVerticalBarLayout).isEqualTo(true)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkTop() {
- assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(168)
- }
-
- @Test
- fun getCellLayoutSpringLoadShrunkBottom() {
- assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1358)
- }
-
- @Test
- fun getQsbOffsetY() {
- assertThat(dp.qsbOffsetY).isEqualTo(147)
- }
-
- @Test
- fun getTaskbarOffsetY() {
- assertThat(dp.taskbarOffsetY).isEqualTo(225)
- }
-
- @Test
- fun getHotseatLayoutPaddingLeft() {
- assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(56)
- }
-
- @Test
- fun getHotseatLayoutPaddingTop() {
- assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(0)
- }
-
- @Test
- fun getHotseatLayoutPaddingRight() {
- assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(84)
- }
-
- @Test
- fun getHotseatLayoutPaddingBottom() {
- assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(165)
- }
-
- @Test
- fun hotseatBarEndOffset() {
- assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
- }
-}
\ No newline at end of file
diff --git a/res/drawable/ic_all_apps_bg_hand.xml b/res/drawable/ic_all_apps_bg_hand.xml
deleted file mode 100644
index 7f3fe14..0000000
--- a/res/drawable/ic_all_apps_bg_hand.xml
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2017 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.
--->
-
-<vector
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="208dp"
- android:height="212dp"
- android:viewportWidth="208.0"
- android:viewportHeight="212.0">
- <path
- android:fillColor="#1A000000"
- android:pathData="M89.4,61.8H85l-1.6-1.5c5.5-6.4,8.8-14.7,8.8-23.7C92.2,16.6,76,0.3,55.9,0.3
- S19.5,16.6,19.5,36.6S35.8,73,55.9,73c9,0,17.3-3.3,23.7-8.8l1.5,1.6v4.4l40.5,40.4l8.3-8.3L89.4,61.8z M54,66.6
- c-13.9,0-28.8-16-28.8-30S41.5,8.9,55.4,8.9S81,22.7,81,36.6S67.9,66.6,54,66.6z"/>
- <path
- android:fillColor="#1A000000"
- android:pathData="M33.4,29.2l-0.3-1.8l-4.2-3.1L18.1,26l-3.1,4.2l0.3,1.8L4.5,33.7L9,62.5
- c0.2,1.5,1.6,2.5,3.1,2.3l34.2-5.3c1.5-0.2,2.5-1.6,2.3-3.1l-4.4-28.8L33.4,29.2z"/>
- <path
- android:fillColor="#3367D6"
- android:pathData="M30.2,27.9l-0.3-1.8l-4.1-3L15,24.7l-3,4.1l0.3,1.8L1.6,32.3L6,60.9
- c0.2,1.5,1.6,2.5,3.1,2.3L43,57.9c1.5-0.2,2.5-1.6,2.3-3.1l-4.4-28.6L30.2,27.9z M26.6,28.4l-10.7,1.6l-0.3-1.8l10.7-1.6L26.6,28.4z"/>
- <group>
- <clip-path
- android:pathData="M25.1,37.7a28.9,28.9 0 1,0 57.8,0a28.9,28.9 0 1,0 -57.8,0"/>
- <path
- android:fillColor="#4285F4"
- android:pathData="M41.7,23l-0.3-2.1l-4.9-3.6l-12.6,1.9l-3.6,4.9l0.3,2.1L8.1,28.1l5.2,33.7
- c0.3,1.7,1.9,2.9,3.6,2.7l40-6.1c1.7-0.3,2.9-1.9,2.7-3.6L54.4,21L41.7,23z M37.5,23.6l-12.6,1.9l-0.3-2.1l12.6-1.9L37.5,23.6z"/>
- </group>
- <path
- android:fillColor="?android:attr/colorControlHighlight"
- android:pathData="M87.5,62.9h-4.4l-1.6-1.5c5.5-6.4,8.8-14.7,8.8-23.7C90.3,17.7,74,1.4,54,1.4
- S17.6,17.7,17.6,37.7S33.9,74.1,54,74.1c9,0,17.3-3.3,23.7-8.8l1.5,1.6v4.4l40.5,40.4l8.3-8.3L87.5,62.9z M54,64.2
- c-14.7,0-26.5-11.8-26.5-26.5S39.3,11.2,54,11.2s26.5,11.8,26.5,26.5S68.6,64.2,54,64.2z"/>
- <path
- android:fillColor="#1A000000"
- android:pathData="M153.4,112.9c-14.9-17.2-38.6-9.1-38.6-9.1l-10.2-11.3c0,0-4.8-5.9-9-3.7
- c-7,3.6-0.6,10.7-0.6,10.7s12.3,15.1,15.4,20.1c2.1,3.4,8.4,4.5,10.1,4.9l17.1,3.7l-0.9-0.7l-1-0.7L153.4,112.9z"/>
- <path
- android:fillColor="#FFDBA6"
- android:pathData="M152.1,113.9c-14.9-17.2-37.6-8-37.6-8l-11.1-12.3c0,0-4.8-5.9-9-3.7
- c-7,3.6-0.6,10.7-0.6,10.7s12.3,15.1,15.4,20.1c2.1,3.4,8.4,4.5,10.1,4.9l19,4.1"/>
- <path
- android:fillColor="#1A000000"
- android:pathData="M148.6,77.9c0.6,0.7,2,2.5,2.1,2.6c1.1,1.7,6.2,13.6,11.8,35.1c0,0.1,1.9,3,1.9,3.1
- c0,0,0.1,0.1,0.1,0.2c0,0,0,0,0-0.1c0.9,1.3,4.4,6.6,8.9,13.7c0.1,0.2,0.3,0.5,0.4,0.7c0,0.1,0.1,0.1,0.1,0.2
- c0.2,0.3,0.4,0.6,0.6,0.9c0.1-0.1,0.2-0.2,0.3-0.3c0.2-0.3,0.6-0.3,0.8,0c2.9,4.8,21.2,35,26.7,49c2.1,5.3,3.2,8.4,3.6,11.6
- c0.3,2.3,0,4.4-1.2,6c1.5-1.9,3.5-6.8-1.5-19c-1.2-2.9-2.8-6.5-4.8-10.5c-7.5-15.2-20-35.6-22.4-39.6c-0.2-0.3-0.6-0.3-0.8,0
- c-0.2,0.2-0.3,0.4-0.5,0.6c-4.5-7.1-8.2-12.6-8.8-13.5c-0.1-0.1-1.9-3-1.9-3.1c-5.7-21.6-10.7-33.4-11.8-35.1
- c-0.1-0.1-1.5-1.9-2.1-2.6l-6.5-8.3c-1.9-2.3-4.2-4.1-6.7-2.3c-2.5,1.8-1.6,4.5-0.1,7.1l3.3,5.2l7-2
- C147.7,77.4,148.1,77.3,148.6,77.9z"/>
- <path
- android:fillColor="#FFDBA6"
- android:pathData="M148.6,77.9l-6.5-8.3c-1.9-2.3-4.2-4.1-6.7-2.3l0,0l0,0c-2.5,1.8-1.6,4.5-0.1,7.1l3.8,6L148.6,77.9C148.6,77.9,148.6,77.9,148.6,77.9z"/>
- <path
- android:fillColor="#1A000000"
- android:pathData="M151.1,92.5l-19.7-25.3c-1.9-2.3-4.2-4.1-6.7-2.3l0,0l0,0c-2.5,1.8-1.6,4.5-0.1,7.1l17.1,27.2L151.1,92.5z"/>
- <path
- android:fillColor="#FFDBA6"
- android:pathData="M149.7,92.9l-19.7-25.3c-1.9-2.3-4.2-4.1-6.7-2.3l0,0l0,0c-2.5,1.8-1.6,4.5-0.1,7.1l17.1,27.2L149.7,92.9z"/>
- <path
- android:fillColor="#1A000000"
- android:pathData="M141.6,94.6l-20.8-26.7c-2.1-2.5-4.4-4.3-7.1-2.5l0,0l0,0c-2.6,1.9-1.7,4.7-0.1,7.5l18,28.6L141.6,94.6z"/>
- <path
- android:fillColor="#FFDBA6"
- android:pathData="M140.1,95l-20.8-26.7c-2.1-2.5-4.4-4.3-7.1-2.5l0,0h0c-2.6,1.9-1.7,4.7-0.1,7.5l18,28.6L140.1,95z"/>
- <path
- android:fillColor="#1A000000"
- android:pathData="M140.4,99.1c-0.5-0.6-2.1-7.5-2.8-7.3l-15.9-6.9c-0.3,0-0.5-0.1-0.7-0.3l-2.3-3.5
- l-0.4-0.6L100,54.5c-1.5-2-3.3-4-5.3-4.3c-0.7-0.1-1.3-0.2-2,0.2v0c-1,0.6-1.2,1.5-1.3,2.4c-0.2,1.8,0.6,3.9,1.6,5.9L108.5,87
- l0.2,0.4l6.6,11.7l0,0c2.5,4.5,4.4,10.5,4.4,10.7L140.4,99.1"/>
- <path
- android:fillColor="#FFDBA6"
- android:pathData="M129.7,125.1c3,0.7,8.1,4,11.8,9.1c2.7,3.7,5.5,8.3,8.2,13
- c7.6-2.3,19.9-6.8,24.9-12.9c-0.2-0.3-0.4-0.6-0.6-0.9c0-0.1-0.1-0.1-0.1-0.2c-0.1-0.2-0.3-0.5-0.4-0.7c-4.5-7.1-8-12.4-8.9-13.7
- c0,0,0,0,0,0.1c0-0.1-0.1-0.1-0.1-0.2c-0.1-0.1-1.9-3-1.9-3.1c-5.7-21.5-10.7-33.4-11.8-35.1c-0.1-0.1-1.5-1.9-2.1-2.6
- c-0.5-0.6-0.9-0.5-1.6-0.3l-26.8,7.7c-0.3,0-0.5-0.1-0.7-0.3l-2.3-3.5l-0.4-0.6L98.5,54.8c-1.5-2-3.3-4-5.3-4.3
- c-0.7-0.1-1.3-0.2-2,0.2c-1,0.6-1.2,1.5-1.3,2.4c-0.2,1.8,0.6,3.9,1.6,5.9L107,87.3l0.2,0.4l6.6,11.7l0,0
- c2.5,4.5,4.4,10.5,4.4,10.7L129.7,125.1"/>
- <path
- android:fillColor="?android:attr/colorForeground"
- android:pathData="M202.3,183.1c-5.4-14.1-23.8-44.3-26.7-49c-0.2-0.3-0.6-0.3-0.8,0
- c-5.1,6.6-19,11.4-26.5,13.6c-0.3,0.1-1,0.1-1.2,0.6c-0.2,0.4,0.1,1,0.2,1.1c7.8,12.9,14.7,27.9,15.3,29.3c0,0.1,0.1,0.1,0.1,0.2
- l9.6,22.9c0,0,0,0,0,0l1.7,4.1c1.4,2.7,3,4.3,5.3,5.1c1.5,0.5,2.1,0.6,3.2,0.6c4.8,0.1,15.2-6.1,20.5-9.4c2.7-1.7,3.3-4.4,2.9-7.6
- C205.5,191.5,204.4,188.4,202.3,183.1z"/>
-</vector>
\ No newline at end of file
diff --git a/res/drawable/ic_all_apps_bg_icon_1.xml b/res/drawable/ic_all_apps_bg_icon_1.xml
deleted file mode 100644
index d226ac6..0000000
--- a/res/drawable/ic_all_apps_bg_icon_1.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2016 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.
--->
-
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="48dp"
- android:height="48dp"
- android:viewportWidth="48.0"
- android:viewportHeight="48.0">
-
- <path
- android:fillColor="#1A000000"
- android:pathData="M44.28,30.96c4.84-10.68,0.09-23.27-10.59-28.11S10.42,2.74,5.58,13.42
- C1,23.54,6.5,35.92,16.62,40.51l0,0l-3.23,7.12C27.84,47,39.79,40.86,44.28,30.96z" />
- <path
- android:fillColor="?android:attr/colorPrimary"
- android:pathData="M41.75,30.05c4.84-10.68,0.09-23.27-10.59-28.11S7.9,1.83,3.06,12.51
- c-4.59,10.12,0.92,22.5,11.03,27.09l0,0l-3.23,7.12C25.31,46.09,37.26,39.94,41.75,30.05z" />
-</vector>
\ No newline at end of file
diff --git a/res/drawable/ic_all_apps_bg_icon_2.xml b/res/drawable/ic_all_apps_bg_icon_2.xml
deleted file mode 100644
index 5966d99..0000000
--- a/res/drawable/ic_all_apps_bg_icon_2.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2016 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.
--->
-
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="48dp"
- android:height="48dp"
- android:viewportWidth="48.0"
- android:viewportHeight="48.0">
-
- <path
- android:fillColor="#1A000000"
- android:pathData="M20.54,44.59c0.57-0.04,1.15-0.38,1.67-1.04l24.23-30.62c0.62-0.78,0.77-1.54,0.52-2.12
- c-0.25-0.58-0.9-0.99-1.89-1.1L6.2,5.99C5.39,5.91,4.74,6.08,4.32,6.44l0,0C3.7,6.97,3.55,7.88,4.01,8.96l14.54,34.09
- C19,44.13,19.75,44.65,20.54,44.59L20.54,44.59z" />
- <path
- android:fillColor="?android:attr/colorPrimary"
- android:pathData="M18.49,43.22c0.57-0.04,1.15-0.38,1.67-1.04l24.23-30.62c0.62-0.78,0.77-1.54,0.52-2.12
- c-0.25-0.58-0.9-0.99-1.89-1.1L4.15,4.62C3.34,4.54,2.69,4.71,2.27,5.08l0,0C1.65,5.6,1.5,6.52,1.96,7.6L16.5,41.69
- C16.96,42.76,17.7,43.28,18.49,43.22L18.49,43.22z" />
-</vector>
\ No newline at end of file
diff --git a/res/drawable/ic_all_apps_bg_icon_3.xml b/res/drawable/ic_all_apps_bg_icon_3.xml
deleted file mode 100644
index b18f8bc..0000000
--- a/res/drawable/ic_all_apps_bg_icon_3.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2016 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.
--->
-
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="48dp"
- android:height="48dp"
- android:viewportWidth="48.0"
- android:viewportHeight="48.0">
-
- <path
- android:fillColor="#1A000000"
- android:pathData="M25.18,1.27c-12.32,0-23.41,9.99-23.41,22.31s11.09,22.31,23.41,22.31
- s22.31-9.99,22.31-22.31S37.5,1.27,25.18,1.27z M25.18,33.55c-5.5,0-14.35-5.1-14.35-10.6s8.32-12.19,13.82-12.19
- c5.5,0,10.49,7.33,10.49,12.83S30.68,33.55,25.18,33.55z" />
- <path
- android:fillColor="?android:attr/colorPrimary"
- android:pathData="M22.93,0.22c-12.32,0-22.31,9.99-22.31,22.31s9.99,22.31,22.31,22.31
- s22.31-9.99,22.31-22.31S35.25,0.22,22.93,0.22z M22.93,32.5c-5.5,0-9.97-4.46-9.97-9.97s4.46-9.97,9.97-9.97
- c5.5,0,9.97,4.46,9.97,9.97S28.43,32.5,22.93,32.5z" />
- <path
- android:fillColor="?android:attr/colorPrimary"
- android:pathData="M14.81,22.53a8.12,8.12 0 1,0 16.24,0a8.12,8.12 0 1,0 -16.24,0z" />
-</vector>
diff --git a/res/drawable/ic_all_apps_bg_icon_4.xml b/res/drawable/ic_all_apps_bg_icon_4.xml
deleted file mode 100644
index 8eb4d90..0000000
--- a/res/drawable/ic_all_apps_bg_icon_4.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2016 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.
--->
-
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="48dp"
- android:height="48dp"
- android:viewportWidth="48.0"
- android:viewportHeight="48.0">
-
- <path
- android:fillColor="#1A000000"
- android:pathData="M11.53,8.02l23.39-5.73c1.61-0.39,3.25,0.6,3.64,2.21l7.64,31.19
- c0.39,1.61-0.6,3.25-2.21,3.64L12.8,46.97c-1.61,0.39-3.25-0.6-3.64-2.21L3.43,21.37L11.53,8.02z" />
- <path
- android:fillColor="?android:attr/colorPrimary"
- android:pathData="M9.2,6.53L32.59,0.8C34.2,0.4,35.84,1.4,36.23,3l7.64,31.19c0.39,1.61-0.6,3.25-2.21,3.64
- l-31.19,7.64c-1.61,0.39-3.25-0.6-3.64-2.21L1.11,19.87L9.2,6.53z" />
- <path
- android:fillColor="#1A000000"
- android:pathData="M9.27,6.47l1.91,7.8c0.4,1.62-0.59,3.24-2.21,3.64l-7.8,1.91L9.27,6.47z" />
-</vector>
\ No newline at end of file
diff --git a/res/layout/all_apps_search_market.xml b/res/layout/all_apps_search_market.xml
deleted file mode 100644
index 6f2dd3d..0000000
--- a/res/layout/all_apps_search_market.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2015 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.
--->
-<TextView
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/search_market_text"
- android:layout_width="match_parent"
- android:layout_height="48dp"
- android:gravity="center"
- android:paddingLeft="@dimen/dynamic_grid_edge_margin"
- android:paddingRight="@dimen/dynamic_grid_edge_margin"
- android:fontFamily="sans-serif-medium"
- android:textSize="14sp"
- android:textColor="?android:attr/colorAccent"
- android:text="@string/all_apps_search_market_message"
- android:textAllCaps="true"
- android:focusable="true"
- android:background="?android:selectableItemBackground" />
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index b19e739..c8554ec 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -108,9 +108,6 @@
<dimen name="all_apps_search_bar_content_overlap">24dp</dimen>
<dimen name="all_apps_search_bar_bottom_padding">30dp</dimen>
<dimen name="all_apps_empty_search_message_top_offset">40dp</dimen>
- <dimen name="all_apps_empty_search_bg_top_offset">144dp</dimen>
- <dimen name="all_apps_background_canvas_width">700dp</dimen>
- <dimen name="all_apps_background_canvas_height">475dp</dimen>
<dimen name="all_apps_header_pill_height">48dp</dimen>
<dimen name="all_apps_header_pill_corner_radius">12dp</dimen>
<dimen name="all_apps_header_tab_height">48dp</dimen>
@@ -381,7 +378,6 @@
<dimen name="task_thumbnail_icon_drawable_size">0dp</dimen>
<dimen name="task_thumbnail_icon_drawable_size_grid">0dp</dimen>
<dimen name="overview_task_margin">0dp</dimen>
- <dimen name="overview_task_margin_grid">0dp</dimen>
<dimen name="overview_actions_height">0dp</dimen>
<dimen name="overview_actions_button_spacing">0dp</dimen>
<dimen name="overview_actions_margin_gesture">0dp</dimen>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 2addf50..3eb08ba 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -128,8 +128,6 @@
<string name="all_apps_loading_message">Loading apps…</string>
<!-- No-search-results text. [CHAR_LIMIT=50] -->
<string name="all_apps_no_search_results">No apps found matching \"<xliff:g id="query" example="Android">%1$s</xliff:g>\"</string>
- <!-- Label for the button which allows the user to get app search results. [CHAR_LIMIT=50] -->
- <string name="all_apps_search_market_message">Search for more apps</string>
<!-- Label for an icon representing any generic app. [CHAR_LIMIT=50] -->
<string name="label_application">App</string>
<!-- Label for the header text of the All Apps section in All Apps view, used to separate Predicted Apps and Actions section from All Apps section. [CHAR_LIMIT=50] -->
diff --git a/res/values/styles.xml b/res/values/styles.xml
index a8cbf08..90553a1 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -292,17 +292,6 @@
<style name="TextTitle" parent="@android:style/TextAppearance.DeviceDefault" />
- <style name="AllAppsEmptySearchBackground">
- <item name="android:colorPrimary">#E0E0E0</item>
- <item name="android:colorControlHighlight">#19BDBDBD</item>
- <item name="android:colorForeground">@color/all_apps_bg_hand_fill</item>
- </style>
- <style name="AllAppsEmptySearchBackground.Dark">
- <item name="android:colorPrimary">#9AA0A6</item>
- <item name="android:colorControlHighlight">#19DFE1E5</item>
- <item name="android:colorForeground">@color/all_apps_bg_hand_fill_dark</item>
- </style>
-
<style name="Button.TopRounded.Bordered" parent="@android:style/Widget.Material.Button">
<item name="android:background">@drawable/button_top_rounded_bordered_ripple</item>
<item name="android:stateListAnimator">@null</item>
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index a19a8e8..0faa75d 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -20,10 +20,10 @@
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.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;
+import static com.android.launcher3.testing.shared.ResourceUtils.pxFromDp;
import android.annotation.SuppressLint;
import android.content.Context;
@@ -108,8 +108,6 @@
public final int edgeMarginPx;
public final float workspaceContentScale;
- private float mWorkspaceSpringLoadShrunkTop;
- private float mWorkspaceSpringLoadShrunkBottom;
public final int workspaceSpringLoadedMinNextPageVisiblePx;
private final int extraSpace;
@@ -191,7 +189,6 @@
// Overview
public int overviewTaskMarginPx;
- public int overviewTaskMarginGridPx;
public int overviewTaskIconSizePx;
public int overviewTaskIconDrawableSizePx;
public int overviewTaskIconDrawableSizeGridPx;
@@ -220,7 +217,6 @@
// Insets
private final Rect mInsets = new Rect();
public final Rect workspacePadding = new Rect();
- private final Rect mHotseatBarPadding = new Rect();
// When true, nav bar is on the left side of the screen.
private boolean mIsSeascape;
@@ -426,25 +422,18 @@
}
overviewTaskMarginPx = res.getDimensionPixelSize(R.dimen.overview_task_margin);
- overviewTaskMarginGridPx = res.getDimensionPixelSize(R.dimen.overview_task_margin_grid);
overviewTaskIconSizePx = res.getDimensionPixelSize(R.dimen.task_thumbnail_icon_size);
overviewTaskIconDrawableSizePx =
res.getDimensionPixelSize(R.dimen.task_thumbnail_icon_drawable_size);
overviewTaskIconDrawableSizeGridPx =
res.getDimensionPixelSize(R.dimen.task_thumbnail_icon_drawable_size_grid);
- overviewTaskThumbnailTopMarginPx = overviewTaskIconSizePx + overviewTaskMarginPx * 2;
+ overviewTaskThumbnailTopMarginPx = overviewTaskIconSizePx + overviewTaskMarginPx;
overviewActionsTopMarginPx = res.getDimensionPixelSize(R.dimen.overview_actions_top_margin);
overviewPageSpacing = res.getDimensionPixelSize(R.dimen.overview_page_spacing);
overviewActionsButtonSpacing = res.getDimensionPixelSize(
R.dimen.overview_actions_button_spacing);
overviewActionsHeight = res.getDimensionPixelSize(R.dimen.overview_actions_height);
- // Grid task's top margin is only overviewTaskIconSizePx + overviewTaskMarginGridPx, but
- // overviewTaskThumbnailTopMarginPx is applied to all TaskThumbnailView, so exclude the
- // extra margin when calculating row spacing.
- int extraTopMargin = overviewTaskThumbnailTopMarginPx - overviewTaskIconSizePx
- - overviewTaskMarginGridPx;
- overviewRowSpacing = res.getDimensionPixelSize(R.dimen.overview_grid_row_spacing)
- - extraTopMargin;
+ overviewRowSpacing = res.getDimensionPixelSize(R.dimen.overview_grid_row_spacing);
overviewGridSideMargin = res.getDimensionPixelSize(R.dimen.overview_grid_side_margin);
// Calculate all of the remaining variables.
@@ -918,40 +907,39 @@
* Gets the space in px from the bottom of last item in the vertical-bar hotseat to the
* bottom of the screen.
*/
- private int getVerticalHotseatLastItemBottomOffset() {
+ private int getVerticalHotseatLastItemBottomOffset(Context context) {
+ Rect hotseatBarPadding = getHotseatLayoutPadding(context);
int cellHeight = calculateCellHeight(
- heightPx - mHotseatBarPadding.top - mHotseatBarPadding.bottom, hotseatBorderSpace,
+ heightPx - hotseatBarPadding.top - hotseatBarPadding.bottom, hotseatBorderSpace,
numShownHotseatIcons);
int extraIconEndSpacing = (cellHeight - iconSizePx) / 2;
- return extraIconEndSpacing + mHotseatBarPadding.bottom;
+ return extraIconEndSpacing + hotseatBarPadding.bottom;
}
/**
* Gets the scaled top of the workspace in px for the spring-loaded edit state.
*/
public float getCellLayoutSpringLoadShrunkTop() {
- mWorkspaceSpringLoadShrunkTop = mInsets.top + dropTargetBarTopMarginPx + dropTargetBarSizePx
+ return mInsets.top + dropTargetBarTopMarginPx + dropTargetBarSizePx
+ dropTargetBarBottomMarginPx;
- return mWorkspaceSpringLoadShrunkTop;
}
/**
* Gets the scaled bottom of the workspace in px for the spring-loaded edit state.
*/
- public float getCellLayoutSpringLoadShrunkBottom() {
+ public float getCellLayoutSpringLoadShrunkBottom(Context context) {
int topOfHotseat = hotseatBarSizePx + springLoadedHotseatBarTopMarginPx;
- mWorkspaceSpringLoadShrunkBottom =
- heightPx - (isVerticalBarLayout() ? getVerticalHotseatLastItemBottomOffset()
- : topOfHotseat);
- return mWorkspaceSpringLoadShrunkBottom;
+ return heightPx - (isVerticalBarLayout()
+ ? getVerticalHotseatLastItemBottomOffset(context) : topOfHotseat);
}
/**
* Gets the scale of the workspace for the spring-loaded edit state.
*/
- public float getWorkspaceSpringLoadScale() {
- float scale = (getCellLayoutSpringLoadShrunkBottom() - getCellLayoutSpringLoadShrunkTop())
- / getCellLayoutHeight();
+ public float getWorkspaceSpringLoadScale(Context context) {
+ float scale =
+ (getCellLayoutSpringLoadShrunkBottom(context) - getCellLayoutSpringLoadShrunkTop())
+ / getCellLayoutHeight();
scale = Math.min(scale, 1f);
// Reduce scale if next pages would not be visible after scaling the workspace
@@ -1036,6 +1024,7 @@
* Returns the padding for hotseat view
*/
public Rect getHotseatLayoutPadding(Context context) {
+ Rect hotseatBarPadding = new Rect();
if (isVerticalBarLayout()) {
// The hotseat icons will be placed in the middle of the hotseat cells.
// Changing the hotseatCellHeightPx is not affecting hotseat icon positions
@@ -1049,10 +1038,10 @@
+ diffOverlapFactor), 0);
if (isSeascape()) {
- mHotseatBarPadding.set(mInsets.left + hotseatBarSidePaddingStartPx, paddingTop,
+ hotseatBarPadding.set(mInsets.left + hotseatBarSidePaddingStartPx, paddingTop,
hotseatBarSidePaddingEndPx, paddingBottom);
} else {
- mHotseatBarPadding.set(hotseatBarSidePaddingEndPx, paddingTop,
+ hotseatBarPadding.set(hotseatBarSidePaddingEndPx, paddingTop,
mInsets.right + hotseatBarSidePaddingStartPx, paddingBottom);
}
} else if (isTaskbarPresent) {
@@ -1069,26 +1058,26 @@
int hotseatWidth = Math.min(requiredWidth, availableWidthPx - hotseatBarEndOffset);
int sideSpacing = (availableWidthPx - hotseatWidth) / 2;
- mHotseatBarPadding.set(sideSpacing, hotseatBarTopPadding, sideSpacing,
+ hotseatBarPadding.set(sideSpacing, hotseatBarTopPadding, sideSpacing,
hotseatBarBottomPadding);
boolean isRtl = Utilities.isRtl(context.getResources());
if (isRtl) {
- mHotseatBarPadding.right += additionalQsbSpace;
+ hotseatBarPadding.right += additionalQsbSpace;
} else {
- mHotseatBarPadding.left += additionalQsbSpace;
+ hotseatBarPadding.left += additionalQsbSpace;
}
if (hotseatBarEndOffset > sideSpacing) {
int diff = isRtl
? sideSpacing - hotseatBarEndOffset
: hotseatBarEndOffset - sideSpacing;
- mHotseatBarPadding.left -= diff;
- mHotseatBarPadding.right += diff;
+ hotseatBarPadding.left -= diff;
+ hotseatBarPadding.right += diff;
}
} else if (isScalableGrid) {
int sideSpacing = (availableWidthPx - qsbWidth) / 2;
- mHotseatBarPadding.set(sideSpacing,
+ hotseatBarPadding.set(sideSpacing,
0,
sideSpacing,
getHotseatBarBottomPadding());
@@ -1100,7 +1089,7 @@
float workspaceCellWidth = (float) widthPx / inv.numColumns;
float hotseatCellWidth = (float) widthPx / numShownHotseatIcons;
int hotseatAdjustment = Math.round((workspaceCellWidth - hotseatCellWidth) / 2);
- mHotseatBarPadding.set(
+ hotseatBarPadding.set(
hotseatAdjustment + workspacePadding.left + cellLayoutPaddingPx.left
+ mInsets.left,
0,
@@ -1108,7 +1097,7 @@
+ mInsets.right,
getHotseatBarBottomPadding());
}
- return mHotseatBarPadding;
+ return hotseatBarPadding;
}
/**
@@ -1246,8 +1235,8 @@
return "\t" + name + ": " + value + "px (" + dpiFromPx(value, mMetrics.densityDpi) + "dp)";
}
- // LINT.IfChange
- public void dump(String prefix, PrintWriter writer) {
+ /** Dumps various DeviceProfile variables to the specified writer. */
+ public void dump(Context context, String prefix, PrintWriter writer) {
writer.println(prefix + "DeviceProfile:");
writer.println(prefix + "\t1 dp = " + mMetrics.density + " px");
@@ -1293,9 +1282,12 @@
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));
@@ -1345,10 +1337,15 @@
writer.println(prefix + pxToDpStr("hotseatQsbHeight", hotseatQsbHeight));
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));
+ Rect hotseatLayoutPadding = getHotseatLayoutPadding(context);
+ writer.println(prefix + pxToDpStr("getHotseatLayoutPadding(context).top",
+ hotseatLayoutPadding.top));
+ writer.println(prefix + pxToDpStr("getHotseatLayoutPadding(context).bottom",
+ hotseatLayoutPadding.bottom));
+ writer.println(prefix + pxToDpStr("getHotseatLayoutPadding(context).left",
+ hotseatLayoutPadding.left));
+ writer.println(prefix + pxToDpStr("getHotseatLayoutPadding(context).right",
+ hotseatLayoutPadding.right));
writer.println(prefix + "\tnumShownHotseatIcons: " + numShownHotseatIcons);
writer.println(prefix + pxToDpStr("hotseatBorderSpace", hotseatBorderSpace));
writer.println(prefix + "\tisQsbInline: " + isQsbInline);
@@ -1379,7 +1376,6 @@
writer.println(prefix + pxToDpStr("workspaceBottomPadding", workspaceBottomPadding));
writer.println(prefix + pxToDpStr("overviewTaskMarginPx", overviewTaskMarginPx));
- writer.println(prefix + pxToDpStr("overviewTaskMarginGridPx", overviewTaskMarginGridPx));
writer.println(prefix + pxToDpStr("overviewTaskIconSizePx", overviewTaskIconSizePx));
writer.println(prefix + pxToDpStr("overviewTaskIconDrawableSizePx",
overviewTaskIconDrawableSizePx));
@@ -1402,30 +1398,17 @@
writer.println(
prefix + pxToDpStr("dropTargetBarBottomMarginPx", dropTargetBarBottomMarginPx));
- writer.println(
- prefix + pxToDpStr("workspaceSpringLoadShrunkTop", mWorkspaceSpringLoadShrunkTop));
- writer.println(prefix + pxToDpStr("workspaceSpringLoadShrunkBottom",
- mWorkspaceSpringLoadShrunkBottom));
+ writer.println(prefix + pxToDpStr("getCellLayoutSpringLoadShrunkTop()",
+ getCellLayoutSpringLoadShrunkTop()));
+ writer.println(prefix + pxToDpStr("getCellLayoutSpringLoadShrunkBottom()",
+ getCellLayoutSpringLoadShrunkBottom(context)));
writer.println(prefix + pxToDpStr("workspaceSpringLoadedMinNextPageVisiblePx",
workspaceSpringLoadedMinNextPageVisiblePx));
- writer.println(
- prefix + pxToDpStr("getWorkspaceSpringLoadScale()", getWorkspaceSpringLoadScale()));
+ writer.println(prefix + pxToDpStr("getWorkspaceSpringLoadScale()",
+ getWorkspaceSpringLoadScale(context)));
writer.println(prefix + pxToDpStr("getCellLayoutHeight()", getCellLayoutHeight()));
writer.println(prefix + pxToDpStr("getCellLayoutWidth()", getCellLayoutWidth()));
}
- // LINT.ThenChange(
- // packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfilePhoneTest.kt,
- // packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBarTest.kt,
- // packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfilePhone3ButtonTest.kt,
- // packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBar3ButtonTest.kt,
- // packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscapeTest.kt,
- // packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortraitTest.kt,
- // packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscape3ButtonTest.kt,
- // packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortrait3ButtonTest.kt,
- // packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscapeTest.kt,
- // packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortraitTest.kt,
- // packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscape3ButtonTest.kt,
- // packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortrait3ButtonTest.kt)
private static Context getContext(Context c, Info info, int orientation, WindowBounds bounds) {
Configuration config = new Configuration(c.getResources().getConfiguration());
diff --git a/src/com/android/launcher3/DropTargetBar.java b/src/com/android/launcher3/DropTargetBar.java
index 3eb2ee0..d64cb26 100644
--- a/src/com/android/launcher3/DropTargetBar.java
+++ b/src/com/android/launcher3/DropTargetBar.java
@@ -175,7 +175,7 @@
secondButton.setPadding(horizontalPadding, verticalPadding, horizontalPadding,
verticalPadding);
- float scale = dp.getWorkspaceSpringLoadScale();
+ float scale = dp.getWorkspaceSpringLoadScale(mLauncher);
int scaledPanelWidth = (int) (dp.getCellLayoutWidth() * scale);
int availableWidth;
@@ -232,7 +232,7 @@
DeviceProfile dp = mLauncher.getDeviceProfile();
// Center vertical bar over scaled workspace, accounting for hotseat offset.
- float scale = dp.getWorkspaceSpringLoadScale();
+ float scale = dp.getWorkspaceSpringLoadScale(mLauncher);
Workspace<?> ws = mLauncher.getWorkspace();
int barCenter;
if (dp.isTwoPanels) {
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/Launcher.java b/src/com/android/launcher3/Launcher.java
index 9a9403c..38b46b0 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -60,7 +60,6 @@
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.shared.TestProtocol.BAD_STATE;
import static com.android.launcher3.util.ItemInfoMatcher.forFolderMatch;
import android.animation.Animator;
@@ -513,7 +512,6 @@
if (!mModel.addCallbacksAndLoad(this)) {
if (!internalStateHandled) {
- Log.d(BAD_STATE, "Launcher onCreate not binding sync, prevent drawing");
// If we are not binding synchronously, pause drawing until initial bind complete,
// so that the system could continue to show the device loading prompt
mOnInitialBindListener = Boolean.FALSE::booleanValue;
@@ -636,7 +634,10 @@
@Override
public void onIdpChanged(boolean modelPropertiesChanged) {
- initDeviceProfile(mDeviceProfile.inv);
+ if (!initDeviceProfile(mDeviceProfile.inv)) {
+ return;
+ }
+
dispatchDeviceProfileChanged();
reapplyUi();
mDragLayer.recreateControllers();
@@ -659,9 +660,17 @@
mDragLayer.onOneHandedModeStateChanged(activated);
}
- protected void initDeviceProfile(InvariantDeviceProfile idp) {
+ /**
+ * Returns {@code true} if a new DeviceProfile is initialized, and {@code false} otherwise.
+ */
+ protected boolean initDeviceProfile(InvariantDeviceProfile idp) {
// Load configuration-specific DeviceProfile
- mDeviceProfile = idp.getDeviceProfile(this);
+ DeviceProfile deviceProfile = idp.getDeviceProfile(this);
+ if (mDeviceProfile == deviceProfile) {
+ return false;
+ }
+
+ mDeviceProfile = deviceProfile;
if (isInMultiWindowMode()) {
mDeviceProfile = mDeviceProfile.getMultiWindowProfile(
this, getMultiWindowDisplaySize());
@@ -669,6 +678,7 @@
onDeviceProfileInitiated();
mModelWriter = mModel.getWriter(getDeviceProfile().isVerticalBarLayout(), true, this);
+ return true;
}
public RotationHelper getRotationHelper() {
@@ -3024,7 +3034,7 @@
mDragLayer.dump(prefix, writer);
mStateManager.dump(prefix, writer);
mPopupDataProvider.dump(prefix, writer);
- mDeviceProfile.dump(prefix, writer);
+ mDeviceProfile.dump(this, prefix, writer);
try {
FileLog.flushAll(writer);
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java
index dc8c739..d0dbaf4 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -88,6 +88,7 @@
import com.android.launcher3.pm.ShortcutConfigActivityInfo;
import com.android.launcher3.shortcuts.ShortcutKey;
import com.android.launcher3.shortcuts.ShortcutRequest;
+import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption;
@@ -525,10 +526,11 @@
}
public static int pxFromSp(float size, DisplayMetrics metrics, float scale) {
- return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP,
- size, metrics) * scale);
+ float value = scale * TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, size, metrics);
+ return ResourceUtils.roundPxValueFromFloat(value);
}
+
public static String createDbSelectionQuery(String columnName, IntArray values) {
return String.format(Locale.ENGLISH, "%s IN (%s)", columnName, values.toConcatString());
}
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index ffb72b3..83d0752 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -30,7 +30,6 @@
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.shared.TestProtocol.BAD_STATE;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -169,7 +168,7 @@
/**
* CellInfo for the cell that is currently being dragged
*/
- private CellLayout.CellInfo mDragInfo;
+ protected CellLayout.CellInfo mDragInfo;
/**
* Target drop area calculated during last acceptDrop call.
@@ -214,7 +213,7 @@
private boolean mUnlockWallpaperFromDefaultPageOnLayout;
public static final int REORDER_TIMEOUT = 650;
- private final Alarm mReorderAlarm = new Alarm();
+ protected final Alarm mReorderAlarm = new Alarm();
private PreviewBackground mFolderCreateBg;
private FolderIcon mDragOverFolderIcon = null;
private boolean mCreateUserFolderOnDrop = false;
@@ -242,7 +241,7 @@
private static final int DRAG_MODE_CREATE_FOLDER = 1;
private static final int DRAG_MODE_ADD_TO_FOLDER = 2;
private static final int DRAG_MODE_REORDER = 3;
- private int mDragMode = DRAG_MODE_NONE;
+ protected int mDragMode = DRAG_MODE_NONE;
@Thunk int mLastReorderX = -1;
@Thunk int mLastReorderY = -1;
@@ -1248,7 +1247,6 @@
// different effects based on device performance. On at least one relatively high-end
// device I've tried, translating the launcher causes things to get quite laggy.
mLauncher.getDragLayer().setTranslationX(transX);
- Log.d(BAD_STATE, "Workspace onOverlayScrollChanged DragLayer ALPHA_INDEX_OVERLAY=" + alpha);
mLauncher.getDragLayer().getAlphaProperty(ALPHA_INDEX_OVERLAY).setValue(alpha);
}
@@ -1980,10 +1978,10 @@
// If the item being dropped is a shortcut and the nearest drop
// cell also contains a shortcut, then create a folder with the two shortcuts.
- if (createUserFolderIfNecessary(cell, container,
- dropTargetLayout, mTargetCell, distance, false, d)
+ if (createUserFolderIfNecessary(cell, container, dropTargetLayout, mTargetCell,
+ distance, false, d)
|| addToExistingFolderIfNecessary(cell, dropTargetLayout, mTargetCell,
- distance, d, false)) {
+ distance, d, false)) {
mLauncher.getStateManager().goToState(NORMAL, SPRING_LOADED_EXIT_DELAY);
return;
}
@@ -2012,8 +2010,8 @@
mTargetCell[0] = mTargetCell[1] = -1;
} else {
mTargetCell = dropTargetLayout.performReorder((int) mDragViewVisualCenter[0],
- (int) mDragViewVisualCenter[1], minSpanX, minSpanY, spanX, spanY, cell,
- mTargetCell, resultSpan, CellLayout.MODE_ON_DROP);
+ (int) mDragViewVisualCenter[1], minSpanX, minSpanY, spanX, spanY,
+ cell, mTargetCell, resultSpan, CellLayout.MODE_ON_DROP);
}
boolean foundCell = mTargetCell[0] >= 0 && mTargetCell[1] >= 0;
@@ -2297,7 +2295,7 @@
}
}
- private void cleanupFolderCreation() {
+ protected void cleanupFolderCreation() {
if (mFolderCreateBg != null) {
mFolderCreateBg.animateToRest();
}
@@ -2310,7 +2308,7 @@
}
}
- private void cleanupReorder(boolean cancelAlarm) {
+ protected void cleanupReorder(boolean cancelAlarm) {
// Any pending reorders are canceled
if (cancelAlarm) {
mReorderAlarm.cancelAlarm();
@@ -2402,26 +2400,7 @@
mDragViewVisualCenter[0], (int) mDragViewVisualCenter[1], item.spanX,
item.spanY, child, mTargetCell);
- if (!nearestDropOccupied) {
- mDragTargetLayout.visualizeDropLocation(mTargetCell[0], mTargetCell[1],
- item.spanX, item.spanY, d);
- } else if ((mDragMode == DRAG_MODE_NONE || mDragMode == DRAG_MODE_REORDER)
- && !mReorderAlarm.alarmPending()
- && (mLastReorderX != reorderX || mLastReorderY != reorderY)
- && targetCellDistance < mDragTargetLayout.getReorderRadius(mTargetCell)) {
-
- int[] resultSpan = new int[2];
- mDragTargetLayout.performReorder((int) mDragViewVisualCenter[0],
- (int) mDragViewVisualCenter[1], minSpanX, minSpanY, item.spanX, item.spanY,
- child, mTargetCell, resultSpan, CellLayout.MODE_SHOW_REORDER_HINT);
-
- // Otherwise, if we aren't adding to or creating a folder and there's no pending
- // reorder, then we schedule a reorder
- ReorderAlarmListener listener = new ReorderAlarmListener(mDragViewVisualCenter,
- minSpanX, minSpanY, item.spanX, item.spanY, d, child);
- mReorderAlarm.setOnAlarmListener(listener);
- mReorderAlarm.setAlarm(REORDER_TIMEOUT);
- }
+ manageReorderOnDragOver(d, targetCellDistance, nearestDropOccupied, minSpanX, minSpanY);
if (mDragMode == DRAG_MODE_CREATE_FOLDER || mDragMode == DRAG_MODE_ADD_TO_FOLDER ||
!nearestDropOccupied) {
@@ -2432,6 +2411,34 @@
}
}
+ protected void manageReorderOnDragOver(DragObject d, float targetCellDistance,
+ boolean nearestDropOccupied, int minSpanX, int minSpanY) {
+
+ ItemInfo item = d.dragInfo;
+ final View child = (mDragInfo == null) ? null : mDragInfo.cell;
+ int reorderX = mTargetCell[0];
+ int reorderY = mTargetCell[1];
+ if (!nearestDropOccupied) {
+ mDragTargetLayout.visualizeDropLocation(mTargetCell[0], mTargetCell[1],
+ item.spanX, item.spanY, d);
+ } else if ((mDragMode == DRAG_MODE_NONE || mDragMode == DRAG_MODE_REORDER)
+ && !mReorderAlarm.alarmPending()
+ && (mLastReorderX != reorderX || mLastReorderY != reorderY)
+ && targetCellDistance < mDragTargetLayout.getReorderRadius(mTargetCell)) {
+
+ int[] resultSpan = new int[2];
+ mDragTargetLayout.performReorder((int) mDragViewVisualCenter[0],
+ (int) mDragViewVisualCenter[1], minSpanX, minSpanY, item.spanX, item.spanY,
+ child, mTargetCell, resultSpan, CellLayout.MODE_SHOW_REORDER_HINT);
+
+ // Otherwise, if we aren't adding to or creating a folder and there's no pending
+ // reorder, then we schedule a reorder
+ ReorderAlarmListener listener = new ReorderAlarmListener(mDragViewVisualCenter,
+ minSpanX, minSpanY, item.spanX, item.spanY, d, child);
+ mReorderAlarm.setOnAlarmListener(listener);
+ mReorderAlarm.setAlarm(REORDER_TIMEOUT);
+ }
+ }
/**
* Updates {@link #mDragTargetLayout} and {@link #mDragOverlappingLayout}
* based on the DragObject's position.
diff --git a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
index 53a6fd7..e33e44e 100644
--- a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
@@ -16,7 +16,6 @@
package com.android.launcher3.allapps;
import android.content.Context;
-import android.content.Intent;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.MotionEvent;
@@ -32,7 +31,6 @@
import com.android.launcher3.allapps.BaseAllAppsAdapter.AdapterItem;
import com.android.launcher3.allapps.search.SearchAdapterProvider;
import com.android.launcher3.config.FeatureFlags;
-import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.views.AppLauncher;
import java.util.ArrayList;
@@ -77,13 +75,6 @@
/** Updates all apps container with the latest search query. */
public void setLastSearchQuery(String query) {
- Intent marketSearchIntent = PackageManagerHelper.getMarketSearchIntent(
- mActivityContext, query);
- OnClickListener marketSearchClickListener = (v) -> mActivityContext.startActivitySafely(v,
- marketSearchIntent, null);
- for (int i = 0; i < mAH.size(); i++) {
- mAH.get(i).mAdapter.setLastSearchQuery(query, marketSearchClickListener);
- }
mIsSearching = true;
rebindAdapters();
mHeader.setCollapsed(true);
diff --git a/src/com/android/launcher3/allapps/AllAppsBackgroundDrawable.java b/src/com/android/launcher3/allapps/AllAppsBackgroundDrawable.java
deleted file mode 100644
index 3830a93..0000000
--- a/src/com/android/launcher3/allapps/AllAppsBackgroundDrawable.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (C) 2015 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.allapps;
-
-import android.animation.ObjectAnimator;
-import android.content.Context;
-import android.content.res.Resources;
-import android.graphics.Canvas;
-import android.graphics.ColorFilter;
-import android.graphics.PixelFormat;
-import android.graphics.Rect;
-import android.graphics.drawable.Drawable;
-import android.view.ContextThemeWrapper;
-import android.view.Gravity;
-
-import com.android.launcher3.LauncherAnimUtils;
-import com.android.launcher3.R;
-import com.android.launcher3.util.Themes;
-
-/**
- * This is a custom composite drawable that has a fixed virtual size and dynamically lays out its
- * children images relatively within its bounds. This way, we can reduce the memory usage of a
- * single, large sparsely populated image.
- */
-public class AllAppsBackgroundDrawable extends Drawable {
-
- /**
- * A helper class to position and orient a drawable to be drawn.
- */
- protected static class TransformedImageDrawable {
- private Drawable mImage;
- private float mXPercent;
- private float mYPercent;
- private int mGravity;
- private int mAlpha;
-
- /**
- * @param gravity If one of the Gravity center values, the x and y offset will take the width
- * and height of the image into account to center the image to the offset.
- */
- public TransformedImageDrawable(Context context, int resourceId, float xPct, float yPct,
- int gravity) {
- mImage = context.getDrawable(resourceId);
- mXPercent = xPct;
- mYPercent = yPct;
- mGravity = gravity;
- }
-
- public void setAlpha(int alpha) {
- mImage.setAlpha(alpha);
- mAlpha = alpha;
- }
-
- public int getAlpha() {
- return mAlpha;
- }
-
- public void updateBounds(Rect bounds) {
- int width = mImage.getIntrinsicWidth();
- int height = mImage.getIntrinsicHeight();
- int left = bounds.left + (int) (mXPercent * bounds.width());
- int top = bounds.top + (int) (mYPercent * bounds.height());
- if ((mGravity & Gravity.CENTER_HORIZONTAL) == Gravity.CENTER_HORIZONTAL) {
- left -= (width / 2);
- }
- if ((mGravity & Gravity.CENTER_VERTICAL) == Gravity.CENTER_VERTICAL) {
- top -= (height / 2);
- }
- mImage.setBounds(left, top, left + width, top + height);
- }
-
- public void draw(Canvas canvas) {
- mImage.draw(canvas);
- }
-
- public Rect getBounds() {
- return mImage.getBounds();
- }
- }
-
- protected final TransformedImageDrawable mHand;
- protected final TransformedImageDrawable[] mIcons;
- private final int mWidth;
- private final int mHeight;
-
- private ObjectAnimator mBackgroundAnim;
-
- public AllAppsBackgroundDrawable(Context context) {
- Resources res = context.getResources();
- mWidth = res.getDimensionPixelSize(R.dimen.all_apps_background_canvas_width);
- mHeight = res.getDimensionPixelSize(R.dimen.all_apps_background_canvas_height);
-
- context = new ContextThemeWrapper(context,
- Themes.getAttrBoolean(context, R.attr.isMainColorDark)
- ? R.style.AllAppsEmptySearchBackground_Dark
- : R.style.AllAppsEmptySearchBackground);
- mHand = new TransformedImageDrawable(context, R.drawable.ic_all_apps_bg_hand,
- 0.575f, 0.f, Gravity.CENTER_HORIZONTAL);
- mIcons = new TransformedImageDrawable[4];
- mIcons[0] = new TransformedImageDrawable(context, R.drawable.ic_all_apps_bg_icon_1,
- 0.375f, 0, Gravity.CENTER_HORIZONTAL);
- mIcons[1] = new TransformedImageDrawable(context, R.drawable.ic_all_apps_bg_icon_2,
- 0.3125f, 0.2f, Gravity.CENTER_HORIZONTAL);
- mIcons[2] = new TransformedImageDrawable(context, R.drawable.ic_all_apps_bg_icon_3,
- 0.475f, 0.26f, Gravity.CENTER_HORIZONTAL);
- mIcons[3] = new TransformedImageDrawable(context, R.drawable.ic_all_apps_bg_icon_4,
- 0.7f, 0.125f, Gravity.CENTER_HORIZONTAL);
- }
-
- /**
- * Animates the background alpha.
- */
- public void animateBgAlpha(float finalAlpha, int duration) {
- int finalAlphaI = (int) (finalAlpha * 255f);
- if (getAlpha() != finalAlphaI) {
- mBackgroundAnim = cancelAnimator(mBackgroundAnim);
- mBackgroundAnim = ObjectAnimator.ofInt(this, LauncherAnimUtils.DRAWABLE_ALPHA,
- finalAlphaI);
- mBackgroundAnim.setDuration(duration);
- mBackgroundAnim.start();
- }
- }
-
- /**
- * Sets the background alpha immediately.
- */
- public void setBgAlpha(float finalAlpha) {
- int finalAlphaI = (int) (finalAlpha * 255f);
- if (getAlpha() != finalAlphaI) {
- mBackgroundAnim = cancelAnimator(mBackgroundAnim);
- setAlpha(finalAlphaI);
- }
- }
-
- @Override
- public int getIntrinsicWidth() {
- return mWidth;
- }
-
- @Override
- public int getIntrinsicHeight() {
- return mHeight;
- }
-
- @Override
- public void draw(Canvas canvas) {
- mHand.draw(canvas);
- for (int i = 0; i < mIcons.length; i++) {
- mIcons[i].draw(canvas);
- }
- }
-
- @Override
- protected void onBoundsChange(Rect bounds) {
- super.onBoundsChange(bounds);
- mHand.updateBounds(bounds);
- for (int i = 0; i < mIcons.length; i++) {
- mIcons[i].updateBounds(bounds);
- }
- invalidateSelf();
- }
-
- @Override
- public void setAlpha(int alpha) {
- mHand.setAlpha(alpha);
- for (int i = 0; i < mIcons.length; i++) {
- mIcons[i].setAlpha(alpha);
- }
- invalidateSelf();
- }
-
- @Override
- public int getAlpha() {
- return mHand.getAlpha();
- }
-
- @Override
- public void setColorFilter(ColorFilter colorFilter) {
- // Do nothing
- }
-
- @Override
- public int getOpacity() {
- return PixelFormat.TRANSLUCENT;
- }
-
- private ObjectAnimator cancelAnimator(ObjectAnimator animator) {
- if (animator != null) {
- animator.cancel();
- }
- return null;
- }
-}
diff --git a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
index de34416..31e3890 100644
--- a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
@@ -24,13 +24,10 @@
import static com.android.launcher3.util.UiThreadHelper.hideKeyboardAsync;
import android.content.Context;
-import android.content.res.Resources;
import android.graphics.Canvas;
-import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.Log;
import android.util.SparseIntArray;
-import android.view.MotionEvent;
import androidx.recyclerview.widget.RecyclerView;
@@ -39,7 +36,6 @@
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.logging.StatsLogManager;
import com.android.launcher3.views.ActivityContext;
import com.android.launcher3.views.RecyclerViewFastScroller;
@@ -89,10 +85,6 @@
}
};
- // The empty-search result background
- protected AllAppsBackgroundDrawable mEmptySearchBackground;
- protected int mEmptySearchBackgroundTopOffset;
-
public AllAppsRecyclerView(Context context) {
this(context, null);
}
@@ -108,9 +100,6 @@
public AllAppsRecyclerView(Context context, AttributeSet attrs, int defStyleAttr,
int defStyleRes) {
super(context, attrs, defStyleAttr);
- Resources res = getResources();
- mEmptySearchBackgroundTopOffset = res.getDimensionPixelSize(
- R.dimen.all_apps_empty_search_bg_top_offset);
mNumAppsPerRow = LauncherAppState.getIDP(context).numColumns;
mFastScrollHelper = new AllAppsFastScrollHelper(this);
}
@@ -132,7 +121,6 @@
int approxRows = (int) Math.ceil(grid.availableHeightPx / grid.allAppsIconSizePx);
pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_EMPTY_SEARCH, 1);
pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_ALL_APPS_DIVIDER, 1);
- pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_SEARCH_MARKET, 1);
pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_ICON, approxRows
* (mNumAppsPerRow + 1));
@@ -143,10 +131,6 @@
@Override
public void onDraw(Canvas c) {
- // Draw the background
- if (mEmptySearchBackground != null && mEmptySearchBackground.getAlpha() > 0) {
- mEmptySearchBackground.draw(c);
- }
if (DEBUG) {
Log.d(TAG, "onDraw at = " + System.currentTimeMillis());
}
@@ -158,33 +142,13 @@
}
@Override
- protected boolean verifyDrawable(Drawable who) {
- return who == mEmptySearchBackground || super.verifyDrawable(who);
- }
-
- @Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
- updateEmptySearchBackgroundBounds();
updatePoolSize();
}
public void onSearchResultsChanged() {
// Always scroll the view to the top so the user can see the changed results
scrollToTop();
-
- if (mApps.hasNoFilteredResults() && !FeatureFlags.ENABLE_DEVICE_SEARCH.get()) {
- if (mEmptySearchBackground == null) {
- mEmptySearchBackground = new AllAppsBackgroundDrawable(getContext());
- mEmptySearchBackground.setAlpha(0);
- mEmptySearchBackground.setCallback(this);
- updateEmptySearchBackgroundBounds();
- }
- mEmptySearchBackground.animateBgAlpha(1f, 150);
- } else if (mEmptySearchBackground != null) {
- // For the time being, we just immediately hide the background to ensure that it does
- // not overlap with the results
- mEmptySearchBackground.setBgAlpha(0f);
- }
}
@Override
@@ -208,16 +172,6 @@
}
}
- @Override
- public boolean onInterceptTouchEvent(MotionEvent e) {
- boolean result = super.onInterceptTouchEvent(e);
- if (!result && e.getAction() == MotionEvent.ACTION_DOWN
- && mEmptySearchBackground != null && mEmptySearchBackground.getAlpha() > 0) {
- mEmptySearchBackground.setHotspot(e.getX(), e.getY());
- }
- return result;
- }
-
/**
* Maps the touch (from 0..1) to the adapter position that should be visible.
*/
@@ -393,22 +347,6 @@
return mScrollbar;
}
- /**
- * Updates the bounds of the empty search background.
- */
- private void updateEmptySearchBackgroundBounds() {
- if (mEmptySearchBackground == null) {
- return;
- }
-
- // Center the empty search background on this new view bounds
- int x = (getMeasuredWidth() - mEmptySearchBackground.getIntrinsicWidth()) / 2;
- int y = mEmptySearchBackgroundTopOffset;
- mEmptySearchBackground.setBounds(x, y,
- x + mEmptySearchBackground.getIntrinsicWidth(),
- y + mEmptySearchBackground.getIntrinsicHeight());
- }
-
@Override
public boolean hasOverlappingRendering() {
return false;
diff --git a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
index 8bbe216..fc1b830 100644
--- a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
+++ b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
@@ -15,17 +15,12 @@
*/
package com.android.launcher3.allapps;
-import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_ALL_APPS_DIVIDER;
-import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_EMPTY_SEARCH;
-import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_SEARCH_MARKET;
-
import android.content.Context;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.DiffUtil;
import com.android.launcher3.allapps.BaseAllAppsAdapter.AdapterItem;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.util.LabelComparator;
@@ -173,13 +168,6 @@
}
/**
- * Returns whether there are no filtered results.
- */
- public boolean hasNoFilteredResults() {
- return hasSearchResults() && mAccessibilityResultsCount == 0;
- }
-
- /**
* Sets results list for search
*/
public boolean setSearchResults(ArrayList<AdapterItem> results) {
@@ -249,15 +237,6 @@
// ordered set of sections
if (hasSearchResults()) {
mAdapterItems.addAll(mSearchResults);
- if (!FeatureFlags.ENABLE_DEVICE_SEARCH.get()) {
- // Append the search market item
- if (hasNoFilteredResults()) {
- mAdapterItems.add(new AdapterItem(VIEW_TYPE_EMPTY_SEARCH));
- } else {
- mAdapterItems.add(new AdapterItem(VIEW_TYPE_ALL_APPS_DIVIDER));
- }
- mAdapterItems.add(new AdapterItem(VIEW_TYPE_SEARCH_MARKET));
- }
} else {
int position = 0;
if (mWorkProviderManager != null) {
diff --git a/src/com/android/launcher3/allapps/BaseAllAppsAdapter.java b/src/com/android/launcher3/allapps/BaseAllAppsAdapter.java
index 459fa88..6990e57 100644
--- a/src/com/android/launcher3/allapps/BaseAllAppsAdapter.java
+++ b/src/com/android/launcher3/allapps/BaseAllAppsAdapter.java
@@ -19,7 +19,6 @@
import android.content.Context;
import android.content.res.Resources;
-import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
@@ -54,19 +53,13 @@
public static final int VIEW_TYPE_ICON = 1 << 1;
// The message shown when there are no filtered results
public static final int VIEW_TYPE_EMPTY_SEARCH = 1 << 2;
- // The message to continue to a market search when there are no filtered results
- public static final int VIEW_TYPE_SEARCH_MARKET = 1 << 3;
-
- // We use various dividers for various purposes. They share enough attributes to reuse layouts,
- // but differ in enough attributes to require different view types
-
// A divider that separates the apps list and the search market button
- public static final int VIEW_TYPE_ALL_APPS_DIVIDER = 1 << 4;
+ public static final int VIEW_TYPE_ALL_APPS_DIVIDER = 1 << 3;
- public static final int VIEW_TYPE_WORK_EDU_CARD = 1 << 5;
- public static final int VIEW_TYPE_WORK_DISABLED_CARD = 1 << 6;
+ public static final int VIEW_TYPE_WORK_EDU_CARD = 1 << 4;
+ public static final int VIEW_TYPE_WORK_DISABLED_CARD = 1 << 5;
- public static final int NEXT_ID = 7;
+ public static final int NEXT_ID = 6;
// Common view type masks
public static final int VIEW_TYPE_MASK_DIVIDER = VIEW_TYPE_ALL_APPS_DIVIDER;
@@ -117,7 +110,7 @@
}
protected boolean isCountedForAccessibility() {
- return viewType == VIEW_TYPE_ICON || viewType == VIEW_TYPE_SEARCH_MARKET;
+ return viewType == VIEW_TYPE_ICON;
}
/**
@@ -139,15 +132,12 @@
protected final T mActivityContext;
protected final AlphabeticalAppsList<T> mApps;
// The text to show when there are no search results and no market search handler.
- protected String mEmptySearchMessage;
protected int mAppsPerRow;
protected final LayoutInflater mLayoutInflater;
protected final OnClickListener mOnIconClickListener;
protected OnLongClickListener mOnIconLongClickListener = INSTANCE_ALL_APPS;
protected OnFocusChangeListener mIconFocusListener;
- // The click listener to send off to the market app, updated each time the search query changes.
- private OnClickListener mMarketSearchClickListener;
private final int mExtraHeight;
public BaseAllAppsAdapter(T activityContext, LayoutInflater inflater,
@@ -155,7 +145,6 @@
Resources res = activityContext.getResources();
mActivityContext = activityContext;
mApps = apps;
- mEmptySearchMessage = res.getString(R.string.all_apps_loading_message);
mLayoutInflater = inflater;
mOnIconClickListener = mActivityContext.getItemOnClickListener();
@@ -186,16 +175,6 @@
}
/**
- * Sets the last search query that was made, used to show when there are no results and to also
- * seed the intent for searching the market.
- */
- public void setLastSearchQuery(String query, OnClickListener marketSearchClickListener) {
- Resources res = mActivityContext.getResources();
- mEmptySearchMessage = res.getString(R.string.all_apps_no_search_results, query);
- mMarketSearchClickListener = marketSearchClickListener;
- }
-
- /**
* Returns the layout manager.
*/
public abstract RecyclerView.LayoutManager getLayoutManager();
@@ -222,11 +201,6 @@
case VIEW_TYPE_EMPTY_SEARCH:
return new ViewHolder(mLayoutInflater.inflate(R.layout.all_apps_empty_search,
parent, false));
- case VIEW_TYPE_SEARCH_MARKET:
- View searchMarketView = mLayoutInflater.inflate(R.layout.all_apps_search_market,
- parent, false);
- searchMarketView.setOnClickListener(mMarketSearchClickListener);
- return new ViewHolder(searchMarketView);
case VIEW_TYPE_ALL_APPS_DIVIDER:
return new ViewHolder(mLayoutInflater.inflate(
R.layout.all_apps_divider, parent, false));
@@ -248,26 +222,21 @@
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
switch (holder.getItemViewType()) {
- case VIEW_TYPE_ICON:
+ case VIEW_TYPE_ICON: {
AdapterItem adapterItem = mApps.getAdapterItems().get(position);
BubbleTextView icon = (BubbleTextView) holder.itemView;
icon.reset();
icon.applyFromApplicationInfo(adapterItem.itemInfo);
break;
- case VIEW_TYPE_EMPTY_SEARCH:
- TextView emptyViewText = (TextView) holder.itemView;
- emptyViewText.setText(mEmptySearchMessage);
- emptyViewText.setGravity(mApps.hasNoFilteredResults() ? Gravity.CENTER :
- Gravity.START | Gravity.CENTER_VERTICAL);
- break;
- case VIEW_TYPE_SEARCH_MARKET:
- TextView searchView = (TextView) holder.itemView;
- if (mMarketSearchClickListener != null) {
- searchView.setVisibility(View.VISIBLE);
- } else {
- searchView.setVisibility(View.GONE);
+ }
+ case VIEW_TYPE_EMPTY_SEARCH: {
+ AppInfo info = mApps.getAdapterItems().get(position).itemInfo;
+ if (info != null) {
+ ((TextView) holder.itemView).setText(mActivityContext.getString(
+ R.string.all_apps_no_search_results, info.title));
}
break;
+ }
case VIEW_TYPE_ALL_APPS_DIVIDER:
case VIEW_TYPE_WORK_DISABLED_CARD:
// nothing to do
diff --git a/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java b/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
index 6539c05..52d8f63 100644
--- a/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
+++ b/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
@@ -131,7 +131,7 @@
public void initializeSearch(ActivityAllAppsContainerView<?> appsView) {
mAppsView = appsView;
mSearchBarController.initialize(
- new DefaultAppSearchAlgorithm(getContext()),
+ new DefaultAppSearchAlgorithm(getContext(), true),
this, mLauncher, this);
}
diff --git a/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java b/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java
index 4eceb71..d2d7a6c 100644
--- a/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java
+++ b/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java
@@ -15,6 +15,7 @@
*/
package com.android.launcher3.allapps.search;
+import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_EMPTY_SEARCH;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import android.content.Context;
@@ -44,10 +45,16 @@
private final LauncherAppState mAppState;
private final Handler mResultHandler;
+ private final boolean mAddNoResultsMessage;
public DefaultAppSearchAlgorithm(Context context) {
+ this(context, false);
+ }
+
+ public DefaultAppSearchAlgorithm(Context context, boolean addNoResultsMessage) {
mAppState = LauncherAppState.getInstance(context);
mResultHandler = new Handler(MAIN_EXECUTOR.getLooper());
+ mAddNoResultsMessage = addNoResultsMessage;
}
@Override
@@ -63,11 +70,23 @@
@Override
public void execute(LauncherAppState app, BgDataModel dataModel, AllAppsList apps) {
ArrayList<AdapterItem> result = getTitleMatchResult(apps.data, query);
+ if (mAddNoResultsMessage && result.isEmpty()) {
+ result.add(getEmptyMessageAdapterItem(query));
+ }
mResultHandler.post(() -> callback.onSearchResult(query, result));
}
});
}
+ private static AdapterItem getEmptyMessageAdapterItem(String query) {
+ AdapterItem item = new AdapterItem(VIEW_TYPE_EMPTY_SEARCH);
+ // Add a place holder info to propagate the query
+ AppInfo placeHolder = new AppInfo();
+ placeHolder.title = query;
+ item.itemInfo = placeHolder;
+ return item;
+ }
+
/**
* Filters {@link AppInfo}s matching specified query
*/
diff --git a/src/com/android/launcher3/states/RotationHelper.java b/src/com/android/launcher3/states/RotationHelper.java
index 38b62d4..fd8b2e5 100644
--- a/src/com/android/launcher3/states/RotationHelper.java
+++ b/src/com/android/launcher3/states/RotationHelper.java
@@ -23,19 +23,21 @@
import static com.android.launcher3.Utilities.dpiFromPx;
import static com.android.launcher3.util.window.WindowManagerProxy.MIN_TABLET_WIDTH;
+import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import com.android.launcher3.BaseActivity;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Utilities;
+import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.UiThreadHelper;
/**
* Utility class to manage launcher rotation
*/
public class RotationHelper implements OnSharedPreferenceChangeListener,
- DeviceProfile.OnDeviceProfileChangeListener {
+ DisplayController.DisplayInfoChangeListener {
private static final String TAG = "RotationHelper";
@@ -119,8 +121,8 @@
}
@Override
- public void onDeviceProfileChanged(DeviceProfile dp) {
- boolean ignoreAutoRotateSettings = dp.isTablet;
+ public void onDisplayInfoChanged(Context context, DisplayController.Info info, int flags) {
+ boolean ignoreAutoRotateSettings = info.isTablet(info.realBounds);
if (mIgnoreAutoRotateSettings != ignoreAutoRotateSettings) {
setIgnoreAutoRotateSettings(ignoreAutoRotateSettings);
notifyChange();
@@ -157,8 +159,10 @@
public void initialize() {
if (!mInitialized) {
mInitialized = true;
- setIgnoreAutoRotateSettings(mActivity.getDeviceProfile().isTablet);
- mActivity.addOnDeviceProfileChangeListener(this);
+ DisplayController displayController = DisplayController.INSTANCE.get(mActivity);
+ DisplayController.Info info = displayController.getInfo();
+ setIgnoreAutoRotateSettings(info.isTablet(info.realBounds));
+ displayController.addChangeListener(this);
notifyChange();
}
}
@@ -166,7 +170,7 @@
public void destroy() {
if (!mDestroyed) {
mDestroyed = true;
- mActivity.removeOnDeviceProfileChangeListener(this);
+ DisplayController.INSTANCE.get(mActivity).removeChangeListener(this);
mActivity = null;
if (mSharedPrefs != null) {
mSharedPrefs.unregisterOnSharedPreferenceChangeListener(this);
diff --git a/src/com/android/launcher3/states/SpringLoadedState.java b/src/com/android/launcher3/states/SpringLoadedState.java
index a205ab5..3ca8ba2 100644
--- a/src/com/android/launcher3/states/SpringLoadedState.java
+++ b/src/com/android/launcher3/states/SpringLoadedState.java
@@ -52,7 +52,7 @@
}
float shrunkTop = grid.getCellLayoutSpringLoadShrunkTop();
- float scale = grid.getWorkspaceSpringLoadScale();
+ float scale = grid.getWorkspaceSpringLoadScale(launcher);
float halfHeight = ws.getHeight() / 2;
float myCenter = ws.getTop() + halfHeight;
diff --git a/src/com/android/launcher3/states/StateAnimationConfig.java b/src/com/android/launcher3/states/StateAnimationConfig.java
index f99519d..54735f0 100644
--- a/src/com/android/launcher3/states/StateAnimationConfig.java
+++ b/src/com/android/launcher3/states/StateAnimationConfig.java
@@ -64,6 +64,8 @@
ANIM_DEPTH,
ANIM_OVERVIEW_ACTIONS_FADE,
ANIM_WORKSPACE_PAGE_TRANSLATE_X,
+ ANIM_OVERVIEW_SPLIT_SELECT_FLOATING_TASK_TRANSLATE_OFFSCREEN,
+ ANIM_OVERVIEW_SPLIT_SELECT_INSTRUCTIONS_FADE
})
@Retention(RetentionPolicy.SOURCE)
public @interface AnimType {}
@@ -84,8 +86,10 @@
public static final int ANIM_DEPTH = 13;
public static final int ANIM_OVERVIEW_ACTIONS_FADE = 14;
public static final int ANIM_WORKSPACE_PAGE_TRANSLATE_X = 15;
+ public static final int ANIM_OVERVIEW_SPLIT_SELECT_FLOATING_TASK_TRANSLATE_OFFSCREEN = 17;
+ public static final int ANIM_OVERVIEW_SPLIT_SELECT_INSTRUCTIONS_FADE = 18;
- private static final int ANIM_TYPES_COUNT = 17;
+ private static final int ANIM_TYPES_COUNT = 19;
protected final Interpolator[] mInterpolators = new Interpolator[ANIM_TYPES_COUNT];
diff --git a/src/com/android/launcher3/testing/shared/ResourceUtils.java b/src/com/android/launcher3/testing/shared/ResourceUtils.java
index af462cc..551aeaf 100644
--- a/src/com/android/launcher3/testing/shared/ResourceUtils.java
+++ b/src/com/android/launcher3/testing/shared/ResourceUtils.java
@@ -21,6 +21,7 @@
import android.util.TypedValue;
public class ResourceUtils {
+ private static final float EPSILON = 0.0001f;
public static final int DEFAULT_NAVBAR_VALUE = 48;
public static final int INVALID_RESOURCE_HANDLE = -1;
public static final String NAVBAR_LANDSCAPE_LEFT_RIGHT_SIZE = "navigation_bar_width";
@@ -71,7 +72,25 @@
}
public static int pxFromDp(float size, DisplayMetrics metrics, float scale) {
- return size < 0 ? INVALID_RESOURCE_HANDLE : Math.round(scale
- * TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, size, metrics));
+ float value = scale * TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, size, metrics);
+ return size < 0 ? INVALID_RESOURCE_HANDLE : roundPxValueFromFloat(value);
+ }
+
+ /**
+ * Rounds a pixel value, taking into account floating point errors.
+ *
+ * <p>If a dp (or sp) value typically returns a half pixel, such as 20dp at a 2.625 density
+ * returning 52.5px, there is a small chance that due to floating-point errors, the value will
+ * be stored as 52.499999. As we round to the nearest pixel, this could cause a 1px difference
+ * in final values, which we correct for in this method.
+ */
+ public static int roundPxValueFromFloat(float value) {
+ float fraction = (float) (value - Math.floor(value));
+ if (Math.abs(0.5f - fraction) < EPSILON) {
+ // Note: we add for negative values as well, as Math.round brings -.5 to the next
+ // "highest" value, e.g. Math.round(-2.5) == -2 [i.e. (int)Math.floor(a + 0.5d)]
+ value += EPSILON;
+ }
+ return Math.round(value);
}
}
diff --git a/src/com/android/launcher3/testing/shared/TestProtocol.java b/src/com/android/launcher3/testing/shared/TestProtocol.java
index f462b45..67efb58 100644
--- a/src/com/android/launcher3/testing/shared/TestProtocol.java
+++ b/src/com/android/launcher3/testing/shared/TestProtocol.java
@@ -136,7 +136,6 @@
public static final String NO_DROP_TARGET = "b/195031154";
public static final String NULL_INT_SET = "b/200572078";
public static final String MISSING_PROMISE_ICON = "b/202985412";
- public static final String BAD_STATE = "b/223498680";
public static final String TASKBAR_IN_APP_STATE = "b/227657604";
public static final String INCORRECT_INFO_UPDATED = "b/239465630";
diff --git a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
index fa4eb70..9ac1c0e 100644
--- a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
+++ b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
@@ -523,6 +523,7 @@
iconParams.rightMargin = -taskIconHeight - taskIconMargin / 2;
iconParams.leftMargin = 0;
iconParams.topMargin = thumbnailTopMargin / 2;
+ iconParams.bottomMargin = 0;
}
@Override
@@ -580,4 +581,22 @@
FloatProperty secondary, DeviceProfile deviceProfile) {
return new Pair<>(primary, secondary);
}
+
+ @Override
+ public float getFloatingTaskOffscreenTranslationTarget(View floatingTask, RectF onScreenRect,
+ @StagePosition int stagePosition, DeviceProfile dp) {
+ float currentTranslationY = floatingTask.getTranslationY();
+ return currentTranslationY - onScreenRect.height();
+ }
+
+ @Override
+ public void setFloatingTaskPrimaryTranslation(View floatingTask, float translation,
+ DeviceProfile dp) {
+ floatingTask.setTranslationY(translation);
+ }
+
+ @Override
+ public Float getFloatingTaskPrimaryTranslation(View floatingTask, DeviceProfile dp) {
+ return floatingTask.getTranslationY();
+ }
}
diff --git a/src/com/android/launcher3/touch/PagedOrientationHandler.java b/src/com/android/launcher3/touch/PagedOrientationHandler.java
index 6bc021b..1a8d355 100644
--- a/src/com/android/launcher3/touch/PagedOrientationHandler.java
+++ b/src/com/android/launcher3/touch/PagedOrientationHandler.java
@@ -34,9 +34,9 @@
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.util.SplitConfigurationOptions;
+import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds;
import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption;
import com.android.launcher3.util.SplitConfigurationOptions.StagePosition;
-import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds;
import java.util.List;
@@ -242,6 +242,41 @@
*/
void fixBoundsForHomeAnimStartRect(RectF outStartRect, DeviceProfile deviceProfile);
+ /**
+ * Determine the target translation for animating the FloatingTaskView out. This value could
+ * either be an x-coordinate or a y-coordinate, depending on which way the FloatingTaskView was
+ * docked.
+ *
+ * @param floatingTask The FloatingTaskView.
+ * @param onScreenRect The current on-screen dimensions of the FloatingTaskView.
+ * @param stagePosition STAGE_POSITION_TOP_OR_LEFT or STAGE_POSITION_BOTTOM_OR_RIGHT.
+ * @param dp The device profile.
+ * @return A float. When an animation translates the FloatingTaskView to this position, it will
+ * appear to tuck away off the edge of the screen.
+ */
+ float getFloatingTaskOffscreenTranslationTarget(View floatingTask, RectF onScreenRect,
+ @StagePosition int stagePosition, DeviceProfile dp);
+
+ /**
+ * Sets the translation of a FloatingTaskView along its "slide-in/slide-out" axis (could be
+ * either x or y), depending on how the view is oriented.
+ *
+ * @param floatingTask The FloatingTaskView to be translated.
+ * @param translation The target translation value.
+ * @param dp The current device profile.
+ */
+ void setFloatingTaskPrimaryTranslation(View floatingTask, float translation, DeviceProfile dp);
+
+ /**
+ * Gets the translation of a FloatingTaskView along its "slide-in/slide-out" axis (could be
+ * either x or y), depending on how the view is oriented.
+ *
+ * @param floatingTask The FloatingTaskView in question.
+ * @param dp The current device profile.
+ * @return The current translation value.
+ */
+ Float getFloatingTaskPrimaryTranslation(View floatingTask, DeviceProfile dp);
+
class ChildBounds {
public final int primaryDimension;
diff --git a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
index 181dca5..dd9f642 100644
--- a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
+++ b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
@@ -52,9 +52,9 @@
import com.android.launcher3.Utilities;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.SplitConfigurationOptions;
+import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds;
import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption;
import com.android.launcher3.util.SplitConfigurationOptions.StagePosition;
-import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds;
import com.android.launcher3.views.BaseDragLayer;
import java.util.List;
@@ -658,8 +658,9 @@
public void setTaskIconParams(FrameLayout.LayoutParams iconParams, int taskIconMargin,
int taskIconHeight, int thumbnailTopMargin, boolean isRtl) {
iconParams.gravity = TOP | CENTER_HORIZONTAL;
+ // Reset margins, since they may have been set on rotation
iconParams.leftMargin = iconParams.rightMargin = 0;
- iconParams.topMargin = taskIconMargin;
+ iconParams.topMargin = iconParams.bottomMargin = 0;
}
@Override
@@ -756,4 +757,36 @@
return new Pair<>(secondary, primary);
}
}
+
+ @Override
+ public float getFloatingTaskOffscreenTranslationTarget(View floatingTask, RectF onScreenRect,
+ @StagePosition int stagePosition, DeviceProfile dp) {
+ if (dp.isLandscape) {
+ float currentTranslationX = floatingTask.getTranslationX();
+ return stagePosition == STAGE_POSITION_TOP_OR_LEFT
+ ? currentTranslationX - onScreenRect.width()
+ : currentTranslationX + onScreenRect.width();
+ } else {
+ float currentTranslationY = floatingTask.getTranslationY();
+ return currentTranslationY - onScreenRect.height();
+ }
+ }
+
+ @Override
+ public void setFloatingTaskPrimaryTranslation(View floatingTask, float translation,
+ DeviceProfile dp) {
+ if (dp.isLandscape) {
+ floatingTask.setTranslationX(translation);
+ } else {
+ floatingTask.setTranslationY(translation);
+ }
+
+ }
+
+ @Override
+ public Float getFloatingTaskPrimaryTranslation(View floatingTask, DeviceProfile dp) {
+ return dp.isLandscape
+ ? floatingTask.getTranslationX()
+ : floatingTask.getTranslationY();
+ }
}
diff --git a/src/com/android/launcher3/touch/SeascapePagedViewHandler.java b/src/com/android/launcher3/touch/SeascapePagedViewHandler.java
index 339f910..387e980 100644
--- a/src/com/android/launcher3/touch/SeascapePagedViewHandler.java
+++ b/src/com/android/launcher3/touch/SeascapePagedViewHandler.java
@@ -216,6 +216,7 @@
iconParams.leftMargin = -taskIconHeight - taskIconMargin / 2;
iconParams.rightMargin = 0;
iconParams.topMargin = thumbnailTopMargin / 2;
+ iconParams.bottomMargin = 0;
}
@Override
diff --git a/src/com/android/launcher3/util/DisplayController.java b/src/com/android/launcher3/util/DisplayController.java
index 30e7469..94f9f25 100644
--- a/src/com/android/launcher3/util/DisplayController.java
+++ b/src/com/android/launcher3/util/DisplayController.java
@@ -278,11 +278,11 @@
public final float fontScale;
private final int densityDpi;
public final NavigationMode navigationMode;
-
private final PortraitSize mScreenSizeDp;
+ // WindowBounds
+ public final WindowBounds realBounds;
public final Set<WindowBounds> supportedBounds = new ArraySet<>();
-
private final ArrayMap<CachedDisplayInfo, WindowBounds[]> mPerDisplayBounds =
new ArrayMap<>();
@@ -310,7 +310,7 @@
mPerDisplayBounds.putAll(perDisplayBoundsCache);
WindowBounds[] cachedValue = mPerDisplayBounds.get(normalizedDisplayInfo);
- WindowBounds realBounds = wmProxy.getRealBounds(displayInfoContext, displayInfo);
+ realBounds = wmProxy.getRealBounds(displayInfoContext, displayInfo);
if (cachedValue == null) {
// Unexpected normalizedDisplayInfo is found, recreate the cache
Log.e(TAG, "Unexpected normalizedDisplayInfo found, invalidating cache");
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/tests/src/com/android/launcher3/DeviceProfileBaseTest.kt b/tests/src/com/android/launcher3/DeviceProfileBaseTest.kt
index 7465db5..4732fc1 100644
--- a/tests/src/com/android/launcher3/DeviceProfileBaseTest.kt
+++ b/tests/src/com/android/launcher3/DeviceProfileBaseTest.kt
@@ -17,11 +17,13 @@
import android.content.Context
import android.graphics.PointF
+import android.graphics.Rect
import androidx.test.core.app.ApplicationProvider
import com.android.launcher3.util.DisplayController.Info
import com.android.launcher3.util.WindowBounds
import org.junit.Before
import org.mockito.ArgumentMatchers.any
+import org.mockito.ArgumentMatchers.anyInt
import org.mockito.Mockito.mock
import java.io.PrintWriter
import java.io.StringWriter
@@ -37,6 +39,9 @@
protected var transposeLayoutWithOrientation: Boolean = false
protected var useTwoPanels: Boolean = false
protected var isGestureMode: Boolean = true
+ protected var devicePaddingsMock: DevicePaddings = mock(DevicePaddings::class.java)
+ protected var staticdevicePaddingsMock: DevicePaddings.DevicePadding =
+ mock(DevicePaddings.DevicePadding::class.java)
@Before
fun setUp() {
@@ -60,112 +65,287 @@
protected fun initializeVarsForPhone(isGestureMode: Boolean = true,
isVerticalBar: Boolean = false) {
val (x, y) = if (isVerticalBar)
- Pair(3120, 1440)
+ Pair(2400, 1080)
else
- Pair(1440, 3120)
+ Pair(1080, 2400)
- windowBounds = WindowBounds(x, y, x, y - 100, 0)
+ windowBounds = WindowBounds(Rect(0, 0, x, y), Rect(
+ if (isVerticalBar) 118 else 0,
+ if (isVerticalBar) 74 else 118,
+ if (!isGestureMode && isVerticalBar) 126 else 0,
+ if (isGestureMode) 63 else if (isVerticalBar) 0 else 126))
whenever(info.isTablet(any())).thenReturn(false)
- whenever(info.getDensityDpi()).thenReturn(560)
+ whenever(info.getDensityDpi()).thenReturn(420)
whenever(info.smallestSizeDp(any())).thenReturn(411f)
+ whenever(devicePaddingsMock.getDevicePadding(anyInt())).thenReturn(staticdevicePaddingsMock)
+ whenever(staticdevicePaddingsMock.getWorkspaceTopPadding(anyInt())).thenReturn(95)
+ whenever(staticdevicePaddingsMock.getWorkspaceBottomPadding(anyInt())).thenReturn(116)
+ whenever(staticdevicePaddingsMock.maxEmptySpacePx)
+ .thenReturn(if (isVerticalBar) if (isGestureMode) 131 else 184 else 315)
this.isGestureMode = isGestureMode
+ transposeLayoutWithOrientation = true
- inv = newScalableInvariantDeviceProfile().apply {
+ inv = InvariantDeviceProfile().apply {
+ numRows = 5
+ numColumns = 4
+ numSearchContainerColumns = 4
+
+ numFolderRows = 3
+ numFolderColumns = 3
+ iconSize = floatArrayOf(60f, 54f, 60f, 60f)
+ iconTextSize = FloatArray(4) { 14f }
deviceType = InvariantDeviceProfile.TYPE_PHONE
- transposeLayoutWithOrientation = isVerticalBar
+
+ minCellSize = listOf(
+ PointF(80f, 104f),
+ PointF(80f, 104f),
+ PointF(80f, 104f),
+ PointF(80f, 104f)
+ ).toTypedArray()
+
+ borderSpaces = listOf(
+ PointF(16f, 16f),
+ PointF(16f, 16f),
+ PointF(16f, 16f),
+ PointF(16f, 16f)
+ ).toTypedArray()
+ folderBorderSpace = 16f
+ hotseatBorderSpaces = FloatArray(4) { 16f }
+ inlineNavButtonsEndSpacing = R.dimen.taskbar_button_margin_4_5
+
+ horizontalMargin = FloatArray(4) { 22f }
+
+ allAppsCellSize = listOf(
+ PointF(80f, 104f),
+ PointF(80f, 104f),
+ PointF(80f, 104f),
+ PointF(80f, 104f)
+ ).toTypedArray()
+ allAppsIconSize = floatArrayOf(60f, 60f, 60f, 60f)
+ allAppsIconTextSize = FloatArray(4) { 14f }
+ allAppsBorderSpaces = listOf(
+ PointF(16f, 16f),
+ PointF(16f, 16f),
+ PointF(16f, 16f),
+ PointF(16f, 16f)
+ ).toTypedArray()
+
+ numShownHotseatIcons = 4
+
+ numShrunkenHotseatIcons = 4
+
+ numDatabaseHotseatIcons = 4
+
+ hotseatColumnSpan = IntArray(4) { 4 }
+ hotseatBarBottomSpace = FloatArray(4) { 48f }
+ hotseatQsbSpace = FloatArray(4) { 36f }
+
+ numAllAppsColumns = 4
+
+ isScalable = true
+
+ inlineQsb = BooleanArray(4) { false }
+
+ devicePaddings = devicePaddingsMock
}
}
protected fun initializeVarsForTablet(isLandscape: Boolean = false,
- isTwoPanel: Boolean = false,
isGestureMode: Boolean = true) {
val (x, y) = if (isLandscape)
Pair(2560, 1600)
else
Pair(1600, 2560)
- windowBounds = WindowBounds(x, y, x, y - 100, 0)
+ windowBounds =
+ WindowBounds(Rect(0, 0, x, y), Rect(0, 104, 0, 0))
whenever(info.isTablet(any())).thenReturn(true)
whenever(info.getDensityDpi()).thenReturn(320)
whenever(info.smallestSizeDp(any())).thenReturn(800f)
+ whenever(devicePaddingsMock.getDevicePadding(anyInt())).thenReturn(staticdevicePaddingsMock)
+ whenever(staticdevicePaddingsMock.getWorkspaceTopPadding(anyInt()))
+ .thenReturn(if (isLandscape) 32 else 159)
+ whenever(staticdevicePaddingsMock.getWorkspaceBottomPadding(anyInt()))
+ .thenReturn(if (isLandscape) 72 else 203)
+ whenever(staticdevicePaddingsMock.maxEmptySpacePx).thenReturn(if (isLandscape) 200 else 19998)
+
this.isGestureMode = isGestureMode
- useTwoPanels = isTwoPanel
+ useTwoPanels = false
- inv = newScalableInvariantDeviceProfile().apply {
- deviceType = if (isTwoPanel)
- InvariantDeviceProfile.TYPE_MULTI_DISPLAY else InvariantDeviceProfile.TYPE_TABLET
+ inv = InvariantDeviceProfile().apply {
+ numRows = 5
+ numColumns = 6
+ numSearchContainerColumns = 3
+
+ iconSize = FloatArray(4) { 60f }
+ iconTextSize = FloatArray(4) { 14f }
+ deviceType = InvariantDeviceProfile.TYPE_TABLET
+
+ minCellSize = listOf(
+ PointF(102f, 120f),
+ PointF(120f, 104f),
+ PointF(102f, 120f),
+ PointF(102f, 120f)
+ ).toTypedArray()
+
+ borderSpaces = listOf(
+ PointF(16f, 64f),
+ PointF(64f, 16f),
+ PointF(16f, 64f),
+ PointF(16f, 64f)
+ ).toTypedArray()
+ hotseatBorderSpaces = floatArrayOf(58f, 50.4f, 58f, 58f)
+ inlineNavButtonsEndSpacing = R.dimen.taskbar_button_margin_6_5
+
+ horizontalMargin = floatArrayOf(54f, 120f, 54f, 54f)
+
+ allAppsCellSize = listOf(
+ PointF(96f, 142f),
+ PointF(126f, 126f),
+ PointF(96f, 142f),
+ PointF(96f, 142f)
+ ).toTypedArray()
+ allAppsIconSize = FloatArray(4) { 60f }
+ allAppsIconTextSize = FloatArray(4) { 14f }
+ allAppsBorderSpaces = listOf(
+ PointF(8f, 16f),
+ PointF(16f, 16f),
+ PointF(8f, 16f),
+ PointF(8f, 16f)
+ ).toTypedArray()
+
+ numShownHotseatIcons = 6
+
+ numShrunkenHotseatIcons = 5
+
+ numDatabaseHotseatIcons = 6
+
+ hotseatColumnSpan = intArrayOf(6, 4, 6, 6)
+ hotseatBarBottomSpace = floatArrayOf(36f, 40f, 36f, 36f)
+ hotseatQsbSpace = FloatArray(4) { 32f }
+
+ numAllAppsColumns = 6
+
+ isScalable = true
+ devicePaddingId = 2132148242 // "@xml/paddings_6x5"
+
inlineQsb = booleanArrayOf(
false,
- isLandscape,
+ true,
false,
false
)
+
+ devicePaddings = devicePaddingsMock
}
}
- /**
- * A very generic grid, just to make qsb tests work. For real calculations, make sure to use
- * values that better represent a real grid.
- */
- protected fun newScalableInvariantDeviceProfile(): InvariantDeviceProfile =
- InvariantDeviceProfile().apply {
- isScalable = true
- numColumns = 4
- numRows = 4
- numShownHotseatIcons = 4
- numDatabaseHotseatIcons = 6
- numShrunkenHotseatIcons = 5
- horizontalMargin = FloatArray(4) { 22f }
- borderSpaces = listOf(
- PointF(16f, 16f),
- PointF(16f, 16f),
- PointF(16f, 16f),
- PointF(16f, 16f)
- ).toTypedArray()
- allAppsBorderSpaces = listOf(
- PointF(16f, 16f),
- PointF(16f, 16f),
- PointF(16f, 16f),
- PointF(16f, 16f)
- ).toTypedArray()
- 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 }
- iconTextSize = FloatArray(4) { 14f }
- allAppsIconTextSize = FloatArray(4) { 14f }
- minCellSize = listOf(
- PointF(64f, 83f),
- PointF(64f, 83f),
- PointF(64f, 83f),
- PointF(64f, 83f)
- ).toTypedArray()
- allAppsCellSize = listOf(
- PointF(64f, 83f),
- PointF(64f, 83f),
- PointF(64f, 83f),
- PointF(64f, 83f)
- ).toTypedArray()
- inlineQsb = booleanArrayOf(
- false,
- false,
- false,
- false
- )
- }
+ protected fun initializeVarsForTwoPanel(isLandscape: Boolean = false,
+ isGestureMode: Boolean = true) {
+ val (x, y) = if (isLandscape)
+ Pair(2208, 1840)
+ else
+ Pair(1840, 2208)
- fun dump(dp: DeviceProfile): StringWriter {
+ windowBounds = WindowBounds(Rect(0, 0, x, y),
+ Rect(0, 110, 0, 0))
+
+ whenever(info.isTablet(any())).thenReturn(true)
+ whenever(info.getDensityDpi()).thenReturn(420)
+ whenever(info.smallestSizeDp(any())).thenReturn(700f)
+ whenever(devicePaddingsMock.getDevicePadding(anyInt())).thenReturn(staticdevicePaddingsMock)
+
+ val topPadding = if (isLandscape) 18 else 89
+ val bottomPadding = if (isLandscape) 39 else 146
+ val maxEmptySpace = if (isLandscape) 131 else 236
+ whenever(staticdevicePaddingsMock.getWorkspaceTopPadding(anyInt())).thenReturn(topPadding)
+ whenever(staticdevicePaddingsMock.getWorkspaceBottomPadding(anyInt()))
+ .thenReturn(bottomPadding)
+ whenever(staticdevicePaddingsMock.maxEmptySpacePx).thenReturn(maxEmptySpace)
+
+ this.isGestureMode = isGestureMode
+ useTwoPanels = true
+
+ inv = InvariantDeviceProfile().apply {
+ numRows = 4
+ numColumns = 4
+ numSearchContainerColumns = 4
+
+ numFolderRows = 3
+ numFolderColumns = 4
+ iconSize = floatArrayOf(60f, 52f, 52f, 60f)
+ iconTextSize = floatArrayOf(14f, 14f, 12f, 14f)
+ deviceType = InvariantDeviceProfile.TYPE_MULTI_DISPLAY
+
+ minCellSize = listOf(
+ PointF(80f, 104f),
+ PointF(80f, 104f),
+ PointF(68f, 116f),
+ PointF(80f, 102f)
+ ).toTypedArray()
+
+ borderSpaces = listOf(
+ PointF(16f, 16f),
+ PointF(16f, 16f),
+ PointF(16f, 20f),
+ PointF(20f, 20f)
+ ).toTypedArray()
+ folderBorderSpace = 16f
+ hotseatBorderSpaces = floatArrayOf(36f, 36f, 18f, 23.3f)
+ inlineNavButtonsEndSpacing = R.dimen.taskbar_button_margin_4_4
+
+ horizontalMargin = floatArrayOf(21.5f, 21.5f, 22.5f, 30.5f)
+
+ allAppsCellSize = listOf(
+ PointF(0f, 0f),
+ PointF(0f, 0f),
+ PointF(68f, 104f),
+ PointF(80f, 104f)
+ ).toTypedArray()
+ allAppsIconSize = floatArrayOf(60f, 60f, 52f, 60f)
+ allAppsIconTextSize = floatArrayOf(14f, 14f, 12f, 14f)
+ allAppsBorderSpaces = listOf(
+ PointF(16f, 16f),
+ PointF(16f, 16f),
+ PointF(16f, 28f),
+ PointF(20f, 16f)
+ ).toTypedArray()
+
+ numShownHotseatIcons = 6
+
+ numShrunkenHotseatIcons = 6
+
+ numDatabaseHotseatIcons = 6
+
+ hotseatColumnSpan = IntArray(4) { 6 }
+ hotseatBarBottomSpace = floatArrayOf(48f, 48f, 36f, 20f)
+ hotseatQsbSpace = floatArrayOf(36f, 36f, 36f, 28f)
+
+ numAllAppsColumns = 6
+ numDatabaseAllAppsColumns = 6
+
+ isScalable = true
+
+ inlineQsb = booleanArrayOf(
+ false,
+ false,
+ false,
+ false
+ )
+
+ devicePaddings = devicePaddingsMock
+ }
+ }
+
+ fun dump(dp: DeviceProfile): String {
val stringWriter = StringWriter()
val printWriter = PrintWriter(stringWriter)
- dp.dump("", printWriter)
+ dp.dump(context, "", printWriter)
printWriter.flush()
- return stringWriter
+ return stringWriter.toString()
}
}
\ No newline at end of file
diff --git a/tests/src/com/android/launcher3/HotseatShownIconsTest.kt b/tests/src/com/android/launcher3/HotseatShownIconsTest.kt
index 5dabb33..95651ca 100644
--- a/tests/src/com/android/launcher3/HotseatShownIconsTest.kt
+++ b/tests/src/com/android/launcher3/HotseatShownIconsTest.kt
@@ -34,7 +34,7 @@
@Test
fun hotseat_size_is_shrunk_if_needed_when_large_screen() {
initializeVarsForTablet(isLandscape = true)
- inv = newScalableInvariantDeviceProfile().apply {
+ inv = inv!!.apply {
deviceType = TYPE_MULTI_DISPLAY
inlineQsb = booleanArrayOf(
false,
@@ -64,7 +64,7 @@
@Test
fun hotseat_size_is_shrunk_even_in_portrait_when_large_screen() {
initializeVarsForTablet()
- inv = newScalableInvariantDeviceProfile().apply {
+ inv = inv!!.apply {
deviceType = TYPE_MULTI_DISPLAY
inlineQsb = booleanArrayOf(
false,
@@ -90,7 +90,7 @@
@Test
fun hotseat_size_is_default_when_small_screen() {
initializeVarsForPhone()
- inv = newScalableInvariantDeviceProfile().apply {
+ inv = inv!!.apply {
deviceType = TYPE_MULTI_DISPLAY
}
useTwoPanels = true
@@ -103,7 +103,7 @@
@Test
fun hotseat_size_is_not_shrunk_on_gesture_tablet() {
initializeVarsForTablet(isLandscape = true)
- inv = newScalableInvariantDeviceProfile().apply {
+ inv = inv!!.apply {
deviceType = TYPE_TABLET
inlineQsb = booleanArrayOf(
false,
@@ -129,7 +129,7 @@
@Test
fun hotseat_size_is_shrunk_if_needed_on_tablet() {
initializeVarsForTablet(isLandscape = true)
- inv = newScalableInvariantDeviceProfile().apply {
+ inv = inv!!.apply {
deviceType = TYPE_TABLET
inlineQsb = booleanArrayOf(
false,
@@ -159,7 +159,7 @@
@Test
fun hotseat_size_is_shrunk_even_in_portrait_on_tablet() {
initializeVarsForTablet()
- inv = newScalableInvariantDeviceProfile().apply {
+ inv = inv!!.apply {
deviceType = TYPE_TABLET
inlineQsb = booleanArrayOf(
false,