From 833a0b9fa980001c585abc9ee46c3a8cf2d99000 Mon Sep 17 00:00:00 2001 From: Steven Ng Date: Thu, 8 Apr 2021 22:32:57 +0100 Subject: [PATCH 1/6] Add a widget conversations category for grouping widgets in the picker Bug: 184878454 Test: Open the full widget picker and observe the conversation widget from SystemUi is listed under conversations. Change-Id: I53cd74d80ce3c4ff77a92cd660ca9283416e9fd3 --- res/values/strings.xml | 3 + .../android/launcher3/icons/IconCache.java | 6 ++ .../launcher3/model/data/PackageItemInfo.java | 22 +++++++- .../android/launcher3/model/WidgetsModel.java | 55 +++++++++++++++++-- 4 files changed, 81 insertions(+), 5 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 1371e91d0f..c929fcbabe 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -91,6 +91,9 @@ [CHAR_LIMIT=none] --> No search results + + Conversations + Search apps diff --git a/src/com/android/launcher3/icons/IconCache.java b/src/com/android/launcher3/icons/IconCache.java index 988794ccb6..a2c0f5cdf4 100644 --- a/src/com/android/launcher3/icons/IconCache.java +++ b/src/com/android/launcher3/icons/IconCache.java @@ -39,6 +39,7 @@ import androidx.annotation.NonNull; import com.android.launcher3.InvariantDeviceProfile; import com.android.launcher3.LauncherFiles; +import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.icons.ComponentWithLabel.ComponentCachingLogic; @@ -304,6 +305,11 @@ public class IconCache extends BaseIconCache { CacheEntry entry = getEntryForPackageLocked( infoInOut.packageName, infoInOut.user, useLowResIcon); applyCacheEntry(entry, infoInOut); + if (infoInOut.category == PackageItemInfo.CONVERSATIONS) { + infoInOut.title = mContext.getString(R.string.widget_category_conversations); + infoInOut.contentDescription = mPackageManager.getUserBadgedLabel( + infoInOut.title, infoInOut.user); + } } protected void applyCacheEntry(CacheEntry entry, ItemInfoWithIcon info) { diff --git a/src/com/android/launcher3/model/data/PackageItemInfo.java b/src/com/android/launcher3/model/data/PackageItemInfo.java index 7617d7efd9..a81fe6a9d1 100644 --- a/src/com/android/launcher3/model/data/PackageItemInfo.java +++ b/src/com/android/launcher3/model/data/PackageItemInfo.java @@ -16,27 +16,47 @@ package com.android.launcher3.model.data; +import androidx.annotation.IntDef; + import com.android.launcher3.LauncherSettings; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; import java.util.Objects; /** * Represents a {@link Package} in the widget tray section. */ public class PackageItemInfo extends ItemInfoWithIcon { + @Retention(RetentionPolicy.SOURCE) + @IntDef({NO_CATEGORY, CONVERSATIONS}) + public @interface Category{} + /** The package is not categorized in the widget tray. */ + public static final int NO_CATEGORY = 0; + /** The package is categorized to conversations widget in the widget tray. */ + public static final int CONVERSATIONS = 1; /** * Package name of the {@link PackageItemInfo}. */ - public String packageName; + public final String packageName; + + /** Represents a widget category shown in the widget tray section. */ + @Category public final int category; public PackageItemInfo(String packageName) { + this(packageName, NO_CATEGORY); + } + + public PackageItemInfo(String packageName, @Category int category) { this.packageName = packageName; + this.category = category; this.itemType = LauncherSettings.Favorites.ITEM_TYPE_NON_ACTIONABLE; } public PackageItemInfo(PackageItemInfo copy) { this.packageName = copy.packageName; + this.category = copy.category; this.itemType = LauncherSettings.Favorites.ITEM_TYPE_NON_ACTIONABLE; } diff --git a/src_shortcuts_overrides/com/android/launcher3/model/WidgetsModel.java b/src_shortcuts_overrides/com/android/launcher3/model/WidgetsModel.java index f82f2cc47a..be18e546d2 100644 --- a/src_shortcuts_overrides/com/android/launcher3/model/WidgetsModel.java +++ b/src_shortcuts_overrides/com/android/launcher3/model/WidgetsModel.java @@ -36,6 +36,7 @@ import com.android.launcher3.widget.model.WidgetsListHeaderEntry; import com.android.launcher3.widget.picker.WidgetsDiffReporter; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -58,6 +59,9 @@ public class WidgetsModel { private static final String TAG = "WidgetsModel"; private static final boolean DEBUG = false; + private static final ComponentName CONVERSATION_WIDGET = ComponentName.createRelative( + "com.android.systemui", ".people.widget.PeopleSpaceWidgetProvider"); + /* Map of widgets and shortcuts that are tracked per package. */ private final Map> mWidgetsList = new HashMap<>(); @@ -156,7 +160,7 @@ public class WidgetsModel { // Temporary list for {@link PackageItemInfos} to avoid having to go through // {@link mPackageItemInfos} to locate the key to be used for {@link #mWidgetsList} - HashMap tmpPackageItemInfos = new HashMap<>(); + HashMap tmpPackageItemInfos = new HashMap<>(); // Clear the lists only if this is an update on all widgets and shortcuts. If packageUser // isn't null, only updates the shortcuts and widgets for the app represented in @@ -168,11 +172,11 @@ public class WidgetsModel { mWidgetsList.putAll(rawWidgetsShortcuts.stream() .filter(new WidgetValidityCheck(app)) .collect(Collectors.groupingBy(item -> { - PackageUserKey packageUserKey = new PackageUserKey( - item.componentName.getPackageName(), item.user); + WidgetPackageOrCategoryKey packageUserKey = getWidgetPackageOrCategoryKey(item); PackageItemInfo pInfo = tmpPackageItemInfos.get(packageUserKey); if (pInfo == null) { - pInfo = new PackageItemInfo(packageUserKey.mPackageName); + pInfo = new PackageItemInfo(item.componentName.getPackageName(), + packageUserKey.mCategory); pInfo.user = item.user; tmpPackageItemInfos.put(packageUserKey, pInfo); } @@ -224,6 +228,13 @@ public class WidgetsModel { return null; } + private WidgetPackageOrCategoryKey getWidgetPackageOrCategoryKey(WidgetItem item) { + if (CONVERSATION_WIDGET.equals(item.componentName)) { + return new WidgetPackageOrCategoryKey(PackageItemInfo.CONVERSATIONS, item.user); + } + return new WidgetPackageOrCategoryKey(item.componentName.getPackageName(), item.user); + } + private static class WidgetValidityCheck implements Predicate { private final InvariantDeviceProfile mIdp; @@ -265,4 +276,40 @@ public class WidgetsModel { return true; } } + + /** A hash key for grouping widgets by package name or category. */ + private static class WidgetPackageOrCategoryKey { + /** + * The package name of the widget provider. + * + *

This shouldn't be empty if {@link #mCategory} has a value, + * {@link PackageItemInfo#NO_CATEGORY}. + */ + public final String mPackage; + /** A widget category. */ + @PackageItemInfo.Category public final int mCategory; + public final UserHandle mUser; + private final int mHashCode; + + WidgetPackageOrCategoryKey(String packageName, UserHandle user) { + this(packageName, PackageItemInfo.NO_CATEGORY, user); + } + + WidgetPackageOrCategoryKey(@PackageItemInfo.Category int category, UserHandle user) { + this("", category, user); + } + + private WidgetPackageOrCategoryKey(String packageName, + @PackageItemInfo.Category int category, UserHandle user) { + mPackage = packageName; + mCategory = category; + mUser = user; + mHashCode = Arrays.hashCode(new Object[]{mPackage, mCategory, mUser}); + } + + @Override + public int hashCode() { + return mHashCode; + } + } } \ No newline at end of file From 7a1ca0b299f4711b6511aafe2d6bc24ee7bcc526 Mon Sep 17 00:00:00 2001 From: Andras Kloczl Date: Thu, 8 Apr 2021 16:08:16 +0200 Subject: [PATCH 2/6] Launcher home currentpage refactoring Calling cancelLongPress on all the visible pages when needed and enabling hardware acceleration on them when a folder animation is in progress. Test: manual Bug: 174464691 Change-Id: Ib11265abfd184fed41acc9a6347a32aec12895f2 --- src/com/android/launcher3/PagedView.java | 3 +-- src/com/android/launcher3/folder/Folder.java | 27 ++++++++++++++------ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index 01f7c71daf..7496703f88 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -926,8 +926,7 @@ public abstract class PagedView extends ViewGrou if (disallowIntercept) { // We need to make sure to cancel our long press if // a scrollable widget takes over touch events - final View currentPage = getPageAt(mCurrentPage); - currentPage.cancelLongPress(); + cancelCurrentPageLongPress(); } super.requestDisallowInterceptTouchEvent(disallowIntercept); } diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java index a1b79970d8..cf1cb45440 100644 --- a/src/com/android/launcher3/folder/Folder.java +++ b/src/com/android/launcher3/folder/Folder.java @@ -78,7 +78,6 @@ import com.android.launcher3.PagedView; import com.android.launcher3.R; import com.android.launcher3.ShortcutAndWidgetContainer; import com.android.launcher3.Utilities; -import com.android.launcher3.Workspace; import com.android.launcher3.Workspace.ItemOperator; import com.android.launcher3.accessibility.AccessibleDragListenerAdapter; import com.android.launcher3.accessibility.FolderAccessibilityHelper; @@ -534,9 +533,25 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo } private void startAnimation(final AnimatorSet a) { - final Workspace workspace = mLauncher.getWorkspace(); - final CellLayout currentCellLayout = - (CellLayout) workspace.getChildAt(workspace.getCurrentPage()); + mLauncher.getWorkspace().getVisiblePages() + .forEach(visiblePage -> addAnimatorListenerForPage(a, (CellLayout) visiblePage)); + + a.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationStart(Animator animation) { + mState = STATE_ANIMATING; + mCurrentAnimator = a; + } + + @Override + public void onAnimationEnd(Animator animation) { + mCurrentAnimator = null; + } + }); + a.start(); + } + + private void addAnimatorListenerForPage(AnimatorSet a, CellLayout currentCellLayout) { final boolean useHardware = shouldUseHardwareLayerForAnimation(currentCellLayout); final boolean wasHardwareAccelerated = currentCellLayout.isHardwareLayerEnabled(); @@ -546,8 +561,6 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo if (useHardware) { currentCellLayout.enableHardwareLayer(true); } - mState = STATE_ANIMATING; - mCurrentAnimator = a; } @Override @@ -555,10 +568,8 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo if (useHardware) { currentCellLayout.enableHardwareLayer(wasHardwareAccelerated); } - mCurrentAnimator = null; } }); - a.start(); } private boolean shouldUseHardwareLayerForAnimation(CellLayout currentCellLayout) { From 369117904157a361abc13ddfa2a1d69de1e8696e Mon Sep 17 00:00:00 2001 From: Steven Ng Date: Fri, 9 Apr 2021 11:15:50 +0100 Subject: [PATCH 3/6] Set width & height of app icons in all widgets tray to 48dp Bug: 184877669 Test: Change the grid size and observe app icons in all widgets tray stay the same. Change-Id: I856d5fada579474fffb6296d641fb686623ca2cc --- res/layout/widgets_list_row_header.xml | 4 +++- .../android/launcher3/widget/picker/WidgetsListHeader.java | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/res/layout/widgets_list_row_header.xml b/res/layout/widgets_list_row_header.xml index 598041cd3f..8259c16612 100644 --- a/res/layout/widgets_list_row_header.xml +++ b/res/layout/widgets_list_row_header.xml @@ -15,6 +15,7 @@ --> + android:orientation="horizontal" + launcher:appIconSize="48dp"> Date: Mon, 22 Feb 2021 14:49:27 -0800 Subject: [PATCH 4/6] Changes to use new startTasks API When shell transitions is enabled, this will use the newer multi-task-launch api and control the animation. There is no actual animation yet, this just adds the infrastructure. Bug: 182002789 Test: enable developer option and enter split via recents Change-Id: If5be104a86e7b5f743f85efed20b0d2bf1b8bfd1 --- .../launcher3/BaseQuickstepLauncher.java | 2 +- .../android/quickstep/RecentsActivity.java | 3 +- .../com/android/quickstep/SystemUiProxy.java | 15 ++++++ .../com/android/quickstep/TaskViewUtils.java | 47 +++++++++++++++- .../util/SplitSelectStateController.java | 53 ++++++++++++++++++- 5 files changed, 114 insertions(+), 6 deletions(-) diff --git a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java index e9ded8a07c..4415b516f1 100644 --- a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java @@ -219,7 +219,7 @@ public abstract class BaseQuickstepLauncher extends Launcher mSplitPlaceholderView = findViewById(R.id.split_placeholder); RecentsView overviewPanel = (RecentsView) getOverviewPanel(); mSplitPlaceholderView.init( - new SplitSelectStateController(SystemUiProxy.INSTANCE.get(this)) + new SplitSelectStateController(mHandler, SystemUiProxy.INSTANCE.get(this)) ); overviewPanel.init(mActionsView, mSplitPlaceholderView); mActionsView.updateVerticalMargin(SysUINavigationMode.getMode(this)); diff --git a/quickstep/src/com/android/quickstep/RecentsActivity.java b/quickstep/src/com/android/quickstep/RecentsActivity.java index 06137f22b0..7c453e7e9d 100644 --- a/quickstep/src/com/android/quickstep/RecentsActivity.java +++ b/quickstep/src/com/android/quickstep/RecentsActivity.java @@ -108,8 +108,7 @@ public final class RecentsActivity extends StatefulActivity { SplitPlaceholderView splitPlaceholderView = findViewById(R.id.split_placeholder); splitPlaceholderView.init( - new SplitSelectStateController( - SystemUiProxy.INSTANCE.get(this)) + new SplitSelectStateController(mUiHandler, SystemUiProxy.INSTANCE.get(this)) ); mDragLayer.recreateControllers(); diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java index 1f332c4dda..0ee28bc63d 100644 --- a/quickstep/src/com/android/quickstep/SystemUiProxy.java +++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java @@ -35,6 +35,7 @@ import android.util.Log; import android.view.MotionEvent; import com.android.launcher3.util.MainThreadInitializedObject; +import com.android.launcher3.util.SplitConfigurationOptions; import com.android.systemui.shared.recents.ISystemUiProxy; import com.android.systemui.shared.recents.model.Task; import com.android.systemui.shared.system.RemoteTransitionCompat; @@ -491,6 +492,20 @@ public class SystemUiProxy implements ISystemUiProxy, } } + /** Start multiple tasks in split-screen simultaneously. */ + public void startTasks(int mainTaskId, Bundle mainOptions, int sideTaskId, Bundle sideOptions, + @SplitConfigurationOptions.StagePosition int sidePosition, + RemoteTransitionCompat remoteTransition) { + if (mSystemUiProxy != null) { + try { + mSplitScreen.startTasks(mainTaskId, mainOptions, sideTaskId, sideOptions, + sidePosition, remoteTransition.getTransition()); + } catch (RemoteException e) { + Log.w(TAG, "Failed call startTask"); + } + } + } + public void startShortcut(String packageName, String shortcutId, int stage, int position, Bundle options, UserHandle user) { if (mSplitScreen != null) { diff --git a/quickstep/src/com/android/quickstep/TaskViewUtils.java b/quickstep/src/com/android/quickstep/TaskViewUtils.java index bea1250091..cbb2a66214 100644 --- a/quickstep/src/com/android/quickstep/TaskViewUtils.java +++ b/quickstep/src/com/android/quickstep/TaskViewUtils.java @@ -15,6 +15,9 @@ */ package com.android.quickstep; +import static android.view.WindowManager.TRANSIT_OPEN; +import static android.view.WindowManager.TRANSIT_TO_FRONT; + import static com.android.launcher3.LauncherAnimUtils.VIEW_ALPHA; import static com.android.launcher3.LauncherState.BACKGROUND_APP; import static com.android.launcher3.LauncherState.NORMAL; @@ -47,7 +50,9 @@ import android.graphics.Matrix.ScaleToFit; import android.graphics.Rect; import android.graphics.RectF; import android.os.Build; +import android.view.SurfaceControl; import android.view.View; +import android.window.TransitionInfo; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -352,7 +357,47 @@ public final class TaskViewUtils { * device is considered in multiWindowMode and things like insets and stuff change * and calculations have to be adjusted in the animations for that */ - public static void composeRecentsSplitLaunchAnimator(@NonNull AnimatorSet anim, + public static void composeRecentsSplitLaunchAnimator(@NonNull TaskView initialView, + @NonNull TaskView v, @NonNull TransitionInfo transitionInfo, + SurfaceControl.Transaction t, @NonNull Runnable finishCallback) { + + final TransitionInfo.Change[] splitRoots = new TransitionInfo.Change[2]; + for (int i = 0; i < transitionInfo.getChanges().size(); ++i) { + final TransitionInfo.Change change = transitionInfo.getChanges().get(i); + final int taskId = change.getTaskInfo() != null ? change.getTaskInfo().taskId : -1; + final int mode = change.getMode(); + // Find the target tasks' root tasks since those are the split stages that need to + // be animated (the tasks themselves are children and thus inherit animation). + if (taskId == initialView.getTask().key.id || taskId == v.getTask().key.id) { + if (!(mode == TRANSIT_OPEN || mode == TRANSIT_TO_FRONT)) { + throw new IllegalStateException( + "Expected task to be showing, but it is " + mode); + } + if (change.getParent() == null) { + throw new IllegalStateException("Initiating multi-split launch but the split" + + "root of " + taskId + " is already visible or has broken hierarchy."); + } + splitRoots[taskId == initialView.getTask().key.id ? 0 : 1] = + transitionInfo.getChange(change.getParent()); + } + } + + // This is where we should animate the split roots. For now, though, just make them visible. + for (int i = 0; i < 2; ++i) { + t.show(splitRoots[i].getLeash()); + t.setAlpha(splitRoots[i].getLeash(), 1.f); + } + + // This contains the initial state (before animation), so apply this at the beginning of + // the animation. + t.apply(); + + // Once there is an animation, this should be called AFTER the animation completes. + finishCallback.run(); + } + + /** Legacy version (until shell transitions are enabled) */ + public static void composeRecentsSplitLaunchAnimatorLegacy(@NonNull AnimatorSet anim, @NonNull TaskView v, @NonNull RemoteAnimationTargetCompat[] appTargets, @NonNull RemoteAnimationTargetCompat[] wallpaperTargets, @NonNull RemoteAnimationTargetCompat[] nonAppTargets, boolean launcherClosing, diff --git a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java index e3f29257c5..9576eac809 100644 --- a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java +++ b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java @@ -16,11 +16,17 @@ package com.android.quickstep.util; +import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; +import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT; +import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT; + import android.animation.AnimatorSet; import android.app.ActivityOptions; import android.os.Handler; import android.os.Looper; import android.util.Pair; +import android.view.SurfaceControl; +import android.window.TransitionInfo; import androidx.annotation.Nullable; @@ -31,12 +37,15 @@ import com.android.launcher3.WrappedAnimationRunnerImpl; import com.android.launcher3.WrappedLauncherAnimationRunner; import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption; import com.android.quickstep.SystemUiProxy; +import com.android.quickstep.TaskAnimationManager; import com.android.quickstep.TaskViewUtils; import com.android.quickstep.views.TaskView; import com.android.systemui.shared.system.ActivityOptionsCompat; import com.android.systemui.shared.system.RemoteAnimationAdapterCompat; import com.android.systemui.shared.system.RemoteAnimationRunnerCompat; import com.android.systemui.shared.system.RemoteAnimationTargetCompat; +import com.android.systemui.shared.system.RemoteTransitionCompat; +import com.android.systemui.shared.system.RemoteTransitionRunner; /** * Represent data needed for the transient state when user has selected one app for split screen @@ -47,9 +56,11 @@ public class SplitSelectStateController { private final SystemUiProxy mSystemUiProxy; private TaskView mInitialTaskView; private SplitPositionOption mInitialPosition; + private final Handler mHandler; - public SplitSelectStateController(SystemUiProxy systemUiProxy) { + public SplitSelectStateController(Handler handler, SystemUiProxy systemUiProxy) { mSystemUiProxy = systemUiProxy; + mHandler = handler; } /** @@ -64,6 +75,19 @@ public class SplitSelectStateController { * To be called after second task selected */ public void setSecondTaskId(TaskView taskView) { + if (TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) { + // Assume initial task is for top/left part of screen + final int[] taskIds = mInitialPosition.mStagePosition == STAGE_POSITION_TOP_OR_LEFT + ? new int[]{mInitialTaskView.getTask().key.id, taskView.getTask().key.id} + : new int[]{taskView.getTask().key.id, mInitialTaskView.getTask().key.id}; + + RemoteSplitLaunchAnimationRunner animationRunner = + new RemoteSplitLaunchAnimationRunner(mInitialTaskView, taskView); + mSystemUiProxy.startTasks(taskIds[0], null /* mainOptions */, taskIds[1], + null /* sideOptions */, STAGE_POSITION_BOTTOM_OR_RIGHT, + new RemoteTransitionCompat(animationRunner, MAIN_EXECUTOR)); + return; + } // Assume initial mInitialTaskId is for top/left part of screen WrappedAnimationRunnerImpl initialSplitRunnerWrapped = new SplitLaunchAnimationRunner( mInitialTaskView, 0); @@ -96,6 +120,30 @@ public class SplitSelectStateController { } /** + * Requires Shell Transitions + */ + private class RemoteSplitLaunchAnimationRunner implements RemoteTransitionRunner { + + private final TaskView mInitialTaskView; + private final TaskView mTaskView; + + RemoteSplitLaunchAnimationRunner(TaskView initialTaskView, TaskView taskView) { + mInitialTaskView = initialTaskView; + mTaskView = taskView; + } + + @Override + public void startAnimation(TransitionInfo info, SurfaceControl.Transaction t, + Runnable finishCallback) { + TaskViewUtils.composeRecentsSplitLaunchAnimator(mInitialTaskView, mTaskView, + info, t, finishCallback); + // After successful launch, call resetState + resetState(); + } + } + + /** + * LEGACY * @return the opposite stage and position from the {@param position} provided as first and * second object, respectively * Ex. If position is has stage = Main and position = Top/Left, this will return @@ -109,6 +157,7 @@ public class SplitSelectStateController { } /** + * LEGACY * Remote animation runner for animation to launch an app. */ private class SplitLaunchAnimationRunner implements WrappedAnimationRunnerImpl { @@ -129,7 +178,7 @@ public class SplitSelectStateController { LauncherAnimationRunner.AnimationResult result) { AnimatorSet anim = new AnimatorSet(); BaseQuickstepLauncher activity = BaseActivity.fromContext(mV.getContext()); - TaskViewUtils.composeRecentsSplitLaunchAnimator(anim, mV, + TaskViewUtils.composeRecentsSplitLaunchAnimatorLegacy(anim, mV, appTargets, wallpaperTargets, nonAppTargets, true, activity.getStateManager(), activity.getDepthController(), mTargetState); result.setAnimation(anim, activity); From ad16a7b1df6a0a40c9e4731a226b2fe62355a57f Mon Sep 17 00:00:00 2001 From: Pierre Barbier de Reuille Date: Fri, 9 Apr 2021 15:07:27 +0100 Subject: [PATCH 5/6] Restore drag&drop from WidgetsBottomSheet Fix: 184917820 Test: By hand with various widgets Change-Id: I488b960daaa83c38aa1bd3cac5b94767ff656103 --- src/com/android/launcher3/widget/WidgetsBottomSheet.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/widget/WidgetsBottomSheet.java b/src/com/android/launcher3/widget/WidgetsBottomSheet.java index bbb0d92eac..0670928159 100644 --- a/src/com/android/launcher3/widget/WidgetsBottomSheet.java +++ b/src/com/android/launcher3/widget/WidgetsBottomSheet.java @@ -170,9 +170,9 @@ public class WidgetsBottomSheet extends BaseWidgetSheet implements Insettable { WidgetCell widget = (WidgetCell) LayoutInflater.from(getContext()) .inflate(R.layout.widget_cell, parent, false); - WidgetImageView preview = widget.findViewById(R.id.widget_preview); - preview.setOnClickListener(this); - preview.setOnLongClickListener(this); + View preview_container = widget.findViewById(R.id.widget_preview_container); + preview_container.setOnClickListener(this); + preview_container.setOnLongClickListener(this); widget.setAnimatePreview(false); parent.addView(widget); From 58dfd4d2095c1c5ce44f7f7cce3a355823259c41 Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Fri, 9 Apr 2021 16:54:56 -0700 Subject: [PATCH 6/6] Handle transitining out of overview more gracefully for 3P launchers Bug: 183897242 Test: Tested with Pixel Custom Launcher, as suggested on the bug Change-Id: I46ceddb9f5eed6b16b7e66406dd68d94e7a30aee --- .../quickstep/FallbackActivityInterface.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/quickstep/FallbackActivityInterface.java b/quickstep/src/com/android/quickstep/FallbackActivityInterface.java index e13d1a4511..8168e88e57 100644 --- a/quickstep/src/com/android/quickstep/FallbackActivityInterface.java +++ b/quickstep/src/com/android/quickstep/FallbackActivityInterface.java @@ -27,6 +27,7 @@ import android.view.MotionEvent; import androidx.annotation.Nullable; import com.android.launcher3.DeviceProfile; +import com.android.launcher3.statemanager.StateManager; import com.android.launcher3.touch.PagedOrientationHandler; import com.android.quickstep.fallback.RecentsState; import com.android.quickstep.util.ActivityInitListener; @@ -139,7 +140,25 @@ public final class FallbackActivityInterface extends @Override public void onExitOverview(RotationTouchHelper deviceState, Runnable exitRunnable) { - // no-op, fake landscape not supported for 3P + final StateManager stateManager = getCreatedActivity().getStateManager(); + if (stateManager.getState() == HOME) { + exitRunnable.run(); + notifyRecentsOfOrientation(deviceState); + return; + } + + stateManager.addStateListener( + new StateManager.StateListener() { + @Override + public void onStateTransitionComplete(RecentsState toState) { + // Are we going from Recents to Workspace? + if (toState == HOME) { + exitRunnable.run(); + notifyRecentsOfOrientation(deviceState); + stateManager.removeStateListener(this); + } + } + }); } @Override