Merge "Update TAPL object hierarchy in preparation for Taskbar TAPL tests"
diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java
index 4aa69d1..d28796c 100644
--- a/quickstep/src/com/android/quickstep/SystemUiProxy.java
+++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java
@@ -609,14 +609,13 @@
}
public void startIntentAndTaskWithLegacyTransition(PendingIntent pendingIntent,
- Intent fillInIntent, int taskId, boolean intentFirst, Bundle mainOptions,
- Bundle sideOptions, @SplitConfigurationOptions.StagePosition int sidePosition,
- float splitRatio, RemoteAnimationAdapter adapter) {
+ Intent fillInIntent, int taskId, Bundle mainOptions, Bundle sideOptions,
+ @SplitConfigurationOptions.StagePosition int sidePosition, float splitRatio,
+ RemoteAnimationAdapter adapter) {
if (mSystemUiProxy != null) {
try {
mSplitScreen.startIntentAndTaskWithLegacyTransition(pendingIntent, fillInIntent,
- taskId, intentFirst, mainOptions, sideOptions, sidePosition, splitRatio,
- adapter);
+ taskId, mainOptions, sideOptions, sidePosition, splitRatio, adapter);
} catch (RemoteException e) {
Log.w(TAG, "Failed call startTasksWithLegacyTransition");
}
diff --git a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java
index e856d8a..fff55a1 100644
--- a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java
+++ b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java
@@ -156,9 +156,8 @@
splitRatio, adapter);
} else {
mSystemUiProxy.startIntentAndTaskWithLegacyTransition(taskPendingIntent,
- new Intent(), taskId2, stagePosition == STAGE_POSITION_TOP_OR_LEFT,
- mainOpts.toBundle(), null /* sideOptions */, STAGE_POSITION_BOTTOM_OR_RIGHT,
- splitRatio, adapter);
+ new Intent(), taskId2, mainOpts.toBundle(), null /* sideOptions */,
+ stagePosition, splitRatio, adapter);
}
}
}
diff --git a/quickstep/src/com/android/quickstep/util/SwipePipToHomeAnimator.java b/quickstep/src/com/android/quickstep/util/SwipePipToHomeAnimator.java
index a534450..ee35adc 100644
--- a/quickstep/src/com/android/quickstep/util/SwipePipToHomeAnimator.java
+++ b/quickstep/src/com/android/quickstep/util/SwipePipToHomeAnimator.java
@@ -278,7 +278,7 @@
private RotatedPosition getRotatedPosition(float progress) {
final float degree, positionX, positionY;
- if (TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) {
+ if (TaskAnimationManager.SHELL_TRANSITIONS_ROTATION) {
if (mFromRotation == Surface.ROTATION_90) {
degree = -90 * (1 - progress);
positionX = progress * (mDestinationBoundsTransformed.left - mStartBounds.left)
diff --git a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
index 9ae5d25..49e4bd3 100644
--- a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
+++ b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
@@ -30,9 +30,11 @@
import com.android.launcher3.views.BaseDragLayer;
import com.android.quickstep.util.MultiValueUpdateListener;
+import java.util.function.Consumer;
+
/**
* Create an instance via
- * {@link #getFloatingTaskView(StatefulActivity, View, Bitmap, Drawable, RectF)} to
+ * {@link #getFloatingTaskView(StatefulActivity, View, Bitmap, Drawable, RectF, Consumer)} to
* which will have the thumbnail from the provided existing TaskView overlaying the taskview itself.
*
* Can then animate the taskview using
@@ -46,6 +48,8 @@
private SplitPlaceholderView mSplitPlaceholderView;
private RectF mStartingPosition;
+ @Nullable
+ private Consumer<RectF> mAdditionalOffsetter;
private final StatefulActivity mActivity;
private final boolean mIsRtl;
private final Rect mOutline = new Rect();
@@ -77,8 +81,9 @@
}
private void init(StatefulActivity launcher, View originalView, @Nullable Bitmap thumbnail,
- Drawable icon, RectF positionOut) {
+ Drawable icon, RectF positionOut, Consumer<RectF> additionalOffsetter) {
mStartingPosition = positionOut;
+ mAdditionalOffsetter = additionalOffsetter;
updateInitialPositionForView(originalView);
final InsettableFrameLayout.LayoutParams lp =
(InsettableFrameLayout.LayoutParams) getLayoutParams();
@@ -102,15 +107,21 @@
/**
* Configures and returns a an instance of {@link FloatingTaskView} initially matching the
* appearance of {@code originalView}.
+ *
+ * @param additionalOffsetter optional, to set additional offsets to the FloatingTaskView
+ * to account for translations. If {@code null} then the
+ * translation values from originalView will be used
*/
public static FloatingTaskView getFloatingTaskView(StatefulActivity launcher,
- View originalView, @Nullable Bitmap thumbnail, Drawable icon, RectF positionOut) {
+ View originalView, @Nullable Bitmap thumbnail, Drawable icon, RectF positionOut,
+ @Nullable Consumer<RectF> additionalOffsetter) {
final BaseDragLayer dragLayer = launcher.getDragLayer();
ViewGroup parent = (ViewGroup) dragLayer.getParent();
final FloatingTaskView floatingView = (FloatingTaskView) launcher.getLayoutInflater()
.inflate(R.layout.floating_split_select_view, parent, false);
- floatingView.init(launcher, originalView, thumbnail, icon, positionOut);
+ floatingView.init(launcher, originalView, thumbnail, icon, positionOut,
+ additionalOffsetter);
parent.addView(floatingView);
return floatingView;
}
@@ -120,7 +131,12 @@
Utilities.getBoundsForViewInDragLayer(mActivity.getDragLayer(), originalView, viewBounds,
true /* ignoreTransform */, null /* recycle */,
mStartingPosition);
- mStartingPosition.offset(originalView.getTranslationX(), originalView.getTranslationY());
+ if (mAdditionalOffsetter != null) {
+ mAdditionalOffsetter.accept(mStartingPosition);
+ } else {
+ mStartingPosition.offset(originalView.getTranslationX(),
+ originalView.getTranslationY());
+ }
final InsettableFrameLayout.LayoutParams lp = new InsettableFrameLayout.LayoutParams(
Math.round(mStartingPosition.width()),
Math.round(mStartingPosition.height()));
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 2a2d1dd..b9ca6ca 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -992,13 +992,17 @@
*/
public void launchSideTaskInLiveTileModeForRestartedApp(int taskId) {
int runningTaskViewId = getTaskViewIdFromTaskId(taskId);
- if (mRunningTaskViewId != -1 && mRunningTaskViewId == runningTaskViewId) {
- TransformParams params = mRemoteTargetHandles[0].getTransformParams();
- RemoteAnimationTargets targets = params.getTargetSet();
- if (targets != null && targets.findTask(taskId) != null) {
- launchSideTaskInLiveTileMode(taskId, targets.apps, targets.wallpapers,
- targets.nonApps);
- }
+ if (mRunningTaskViewId == -1 ||
+ mRunningTaskViewId != runningTaskViewId ||
+ mRemoteTargetHandles == null) {
+ return;
+ }
+
+ TransformParams params = mRemoteTargetHandles[0].getTransformParams();
+ RemoteAnimationTargets targets = params.getTargetSet();
+ if (targets != null && targets.findTask(taskId) != null) {
+ launchSideTaskInLiveTileMode(taskId, targets.apps, targets.wallpapers,
+ targets.nonApps);
}
}
@@ -2723,8 +2727,13 @@
if (mSplitHiddenTaskView != null) {
mSplitHiddenTaskView.setVisibility(INVISIBLE);
mFirstFloatingTaskView = FloatingTaskView.getFloatingTaskView(mActivity,
- mSplitHiddenTaskView, mSplitHiddenTaskView.getThumbnail().getThumbnail(),
- mSplitHiddenTaskView.getIconView().getDrawable(), startingTaskRect);
+ mSplitHiddenTaskView.getThumbnail(),
+ mSplitHiddenTaskView.getThumbnail().getThumbnail(),
+ mSplitHiddenTaskView.getIconView().getDrawable(), startingTaskRect,
+ floatingTaskViewStartingPosition -> floatingTaskViewStartingPosition.offset(
+ mSplitHiddenTaskView.getTranslationX(),
+ mSplitHiddenTaskView.getTranslationY()
+ ));
mFirstFloatingTaskView.setAlpha(1);
mFirstFloatingTaskView.addAnimation(anim, startingTaskRect,
mTempRect, mSplitHiddenTaskView, true /*fadeWithThumbnail*/);
@@ -2732,7 +2741,7 @@
mSplitSelectSource.view.setVisibility(INVISIBLE);
mFirstFloatingTaskView = FloatingTaskView.getFloatingTaskView(mActivity,
mSplitSelectSource.view, null,
- mSplitSelectSource.drawable, startingTaskRect);
+ mSplitSelectSource.drawable, startingTaskRect, null /*additionalOffsetter*/);
mFirstFloatingTaskView.setAlpha(1);
mFirstFloatingTaskView.addAnimation(anim, startingTaskRect,
mTempRect, mSplitSelectSource.view, true /*fadeWithThumbnail*/);
@@ -4023,8 +4032,12 @@
false /*fadeWithThumbnail*/);
mSecondFloatingTaskView = FloatingTaskView.getFloatingTaskView(mActivity,
- taskView, taskView.getThumbnail().getThumbnail(),
- taskView.getIconView().getDrawable(), secondTaskStartingBounds);
+ taskView.getThumbnail(), taskView.getThumbnail().getThumbnail(),
+ taskView.getIconView().getDrawable(), secondTaskStartingBounds,
+ floatingTaskViewStartingPosition -> floatingTaskViewStartingPosition.offset(
+ taskView.getTranslationX(),
+ taskView.getTranslationY()
+ ));
mSecondFloatingTaskView.setAlpha(1);
mSecondFloatingTaskView.addAnimation(pendingAnimation, secondTaskStartingBounds,
secondTaskEndingBounds, taskView.getThumbnail(),
diff --git a/res/values-v31/styles.xml b/res/values-v31/styles.xml
index 0d2fce0..e42d0a3 100644
--- a/res/values-v31/styles.xml
+++ b/res/values-v31/styles.xml
@@ -87,6 +87,7 @@
<style name="HomeSettings.CollapsedToolbarTitle"
parent="@android:style/TextAppearance.DeviceDefault.Widget.ActionBar.Title">
<item name="android:fontFamily">google-sans</item>
+ <item name="android:textSize">20sp</item>
</style>
<style name="HomeSettings.ExpandedToolbarTitle" parent="HomeSettings.CollapsedToolbarTitle">
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java
index cbc21eb..9bc3d15 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -671,14 +671,15 @@
/**
* Returns the full drawable for info without any flattening or pre-processing.
*
- * @param outObj this is set to the internal data associated with {@param info},
+ * @param shouldThemeIcon If true, will theme icons when applicable
+ * @param outObj this is set to the internal data associated with {@code info},
* eg {@link LauncherActivityInfo} or {@link ShortcutInfo}.
*/
@TargetApi(Build.VERSION_CODES.TIRAMISU)
public static Drawable getFullDrawable(Context context, ItemInfo info, int width, int height,
- Object[] outObj) {
+ boolean shouldThemeIcon, Object[] outObj) {
Drawable icon = loadFullDrawableWithoutTheme(context, info, width, height, outObj);
- if (ATLEAST_T && icon instanceof AdaptiveIconDrawable) {
+ if (ATLEAST_T && icon instanceof AdaptiveIconDrawable && shouldThemeIcon) {
AdaptiveIconDrawable aid = (AdaptiveIconDrawable) icon.mutate();
Drawable mono = aid.getMonochrome();
if (mono != null && Themes.isThemedIconEnabled(context)) {
diff --git a/src/com/android/launcher3/dragndrop/DragView.java b/src/com/android/launcher3/dragndrop/DragView.java
index 4588a04..8bfd774 100644
--- a/src/com/android/launcher3/dragndrop/DragView.java
+++ b/src/com/android/launcher3/dragndrop/DragView.java
@@ -216,7 +216,8 @@
Object[] outObj = new Object[1];
int w = mWidth;
int h = mHeight;
- Drawable dr = Utilities.getFullDrawable(mActivity, info, w, h, outObj);
+ Drawable dr = Utilities.getFullDrawable(mActivity, info, w, h,
+ true /* shouldThemeIcon */, outObj);
if (dr instanceof AdaptiveIconDrawable) {
int blurMargin = (int) mActivity.getResources()
diff --git a/src/com/android/launcher3/popup/PopupContainerWithArrow.java b/src/com/android/launcher3/popup/PopupContainerWithArrow.java
index 198397a..05d6fc6 100644
--- a/src/com/android/launcher3/popup/PopupContainerWithArrow.java
+++ b/src/com/android/launcher3/popup/PopupContainerWithArrow.java
@@ -508,6 +508,7 @@
@Override
protected void closeComplete() {
super.closeComplete();
+ mActivityContext.getDragController().removeDragListener(this);
PopupContainerWithArrow openPopup = getOpen(mActivityContext);
if (openPopup == null || openPopup.mOriginalIcon != mOriginalIcon) {
mOriginalIcon.setTextVisibility(mOriginalIcon.shouldTextBeVisible());
diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java
index 106bb92..0f69530 100644
--- a/src/com/android/launcher3/views/FloatingIconView.java
+++ b/src/com/android/launcher3/views/FloatingIconView.java
@@ -247,11 +247,13 @@
* @param originalView The View that the FloatingIconView will replace.
* @param info ItemInfo of the originalView
* @param pos The position of the view.
+ * @param btvIcon The drawable of the BubbleTextView. May be null if original view is not a BTV
+ * @param outIconLoadResult We store the icon results into this object.
*/
@WorkerThread
@SuppressWarnings("WrongThread")
private static void getIconResult(Launcher l, View originalView, ItemInfo info, RectF pos,
- Drawable btvIcon, IconLoadResult iconLoadResult) {
+ @Nullable Drawable btvIcon, IconLoadResult outIconLoadResult) {
Drawable drawable;
boolean supportsAdaptiveIcons = !info.isDisabled(); // Use original icon for disabled icons.
@@ -271,7 +273,9 @@
int width = (int) pos.width();
int height = (int) pos.height();
if (supportsAdaptiveIcons) {
- drawable = getFullDrawable(l, info, width, height, sTmpObjArray);
+ boolean shouldThemeIcon = btvIcon instanceof FastBitmapDrawable
+ && ((FastBitmapDrawable) btvIcon).isThemed();
+ drawable = getFullDrawable(l, info, width, height, shouldThemeIcon, sTmpObjArray);
if (drawable instanceof AdaptiveIconDrawable) {
badge = getBadge(l, info, sTmpObjArray[0]);
} else {
@@ -284,24 +288,25 @@
// Similar to DragView, we simply use the BubbleTextView icon here.
drawable = btvIcon;
} else {
- drawable = getFullDrawable(l, info, width, height, sTmpObjArray);
+ drawable = getFullDrawable(l, info, width, height, true /* shouldThemeIcon */,
+ sTmpObjArray);
}
}
}
drawable = drawable == null ? null : drawable.getConstantState().newDrawable();
int iconOffset = getOffsetForIconBounds(l, drawable, pos);
- synchronized (iconLoadResult) {
- iconLoadResult.btvDrawable = btvIcon == null || drawable == btvIcon
+ synchronized (outIconLoadResult) {
+ outIconLoadResult.btvDrawable = btvIcon == null || drawable == btvIcon
? null : btvIcon.getConstantState().newDrawable();
- iconLoadResult.drawable = drawable;
- iconLoadResult.badge = badge;
- iconLoadResult.iconOffset = iconOffset;
- if (iconLoadResult.onIconLoaded != null) {
- l.getMainExecutor().execute(iconLoadResult.onIconLoaded);
- iconLoadResult.onIconLoaded = null;
+ outIconLoadResult.drawable = drawable;
+ outIconLoadResult.badge = badge;
+ outIconLoadResult.iconOffset = iconOffset;
+ if (outIconLoadResult.onIconLoaded != null) {
+ l.getMainExecutor().execute(outIconLoadResult.onIconLoaded);
+ outIconLoadResult.onIconLoaded = null;
}
- iconLoadResult.isIconLoaded = true;
+ outIconLoadResult.isIconLoaded = true;
}
}
@@ -528,8 +533,7 @@
btvIcon = null;
}
- IconLoadResult result = new IconLoadResult(info,
- btvIcon == null ? false : btvIcon.isThemed());
+ IconLoadResult result = new IconLoadResult(info, btvIcon != null && btvIcon.isThemed());
result.btvDrawable = btvIcon;
final long fetchIconId = sFetchIconId++;
diff --git a/src/com/android/launcher3/views/OptionsPopupView.java b/src/com/android/launcher3/views/OptionsPopupView.java
index 95bce31..867e488 100644
--- a/src/com/android/launcher3/views/OptionsPopupView.java
+++ b/src/com/android/launcher3/views/OptionsPopupView.java
@@ -180,18 +180,6 @@
*/
public static ArrayList<OptionItem> getOptions(Launcher launcher) {
ArrayList<OptionItem> options = new ArrayList<>();
- options.add(new OptionItem(launcher,
- R.string.settings_button_text,
- R.drawable.ic_setting,
- LAUNCHER_SETTINGS_BUTTON_TAP_OR_LONGPRESS,
- OptionsPopupView::startSettings));
- if (!WidgetsModel.GO_DISABLE_WIDGETS) {
- options.add(new OptionItem(launcher,
- R.string.widget_button_text,
- R.drawable.ic_widget,
- LAUNCHER_WIDGETSTRAY_BUTTON_TAP_OR_LONGPRESS,
- OptionsPopupView::onWidgetsClicked));
- }
int resString = Utilities.existsStyleWallpapers(launcher) ?
R.string.styles_wallpaper_button_text : R.string.wallpaper_button_text;
int resDrawable = Utilities.existsStyleWallpapers(launcher) ?
@@ -201,6 +189,18 @@
resDrawable,
IGNORE,
OptionsPopupView::startWallpaperPicker));
+ if (!WidgetsModel.GO_DISABLE_WIDGETS) {
+ options.add(new OptionItem(launcher,
+ R.string.widget_button_text,
+ R.drawable.ic_widget,
+ LAUNCHER_WIDGETSTRAY_BUTTON_TAP_OR_LONGPRESS,
+ OptionsPopupView::onWidgetsClicked));
+ }
+ options.add(new OptionItem(launcher,
+ R.string.settings_button_text,
+ R.drawable.ic_setting,
+ LAUNCHER_SETTINGS_BUTTON_TAP_OR_LONGPRESS,
+ OptionsPopupView::startSettings));
return options;
}