Merge "Allow restore across form factors" into sc-v2-dev
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
index 593bfd8..e2ba459 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
@@ -375,12 +375,12 @@
// Update the resumed state immediately to ensure a seamless handoff
boolean launcherResumed = !finishedToApp;
- mIconAlignmentForResumedState.updateValue(launcherResumed ? 1 : 0);
-
updateStateForFlag(FLAG_RECENTS_ANIMATION_RUNNING, false);
updateStateForFlag(FLAG_RESUMED, launcherResumed);
applyState();
-
+ // Set this last because applyState() might also animate it.
+ mIconAlignmentForResumedState.cancelAnimation();
+ mIconAlignmentForResumedState.updateValue(launcherResumed ? 1 : 0);
TaskbarStashController controller = mControllers.taskbarStashController;
controller.updateStateForFlag(FLAG_IN_APP, finishedToApp);
diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java
index 27cf134..dc3ee43 100644
--- a/src/com/android/launcher3/views/FloatingIconView.java
+++ b/src/com/android/launcher3/views/FloatingIconView.java
@@ -88,7 +88,6 @@
private IconLoadResult mIconLoadResult;
- // Draw the drawable of the BubbleTextView behind ClipIconView to reveal the built in shadow.
private View mBtvDrawable;
private ClipIconView mClipIconView;
@@ -349,10 +348,23 @@
}
}
- if (!mIsOpening && btvIcon != null) {
+ setOriginalDrawableBackground(btvIcon);
+ invalidate();
+ }
+
+ /**
+ * Draws the drawable of the BubbleTextView behind ClipIconView
+ *
+ * This is used to:
+ * - Have icon displayed while Adaptive Icon is loading
+ * - Displays the built in shadow to ensure a clean handoff
+ *
+ * Allows nullable as this may be cleared when drawing is deferred to ClipIconView.
+ */
+ private void setOriginalDrawableBackground(@Nullable Drawable btvIcon) {
+ if (!mIsOpening) {
mBtvDrawable.setBackground(btvIcon);
}
- invalidate();
}
/**
@@ -457,7 +469,9 @@
@Override
public void onAnimationStart(Animator animator) {
- if (mIconLoadResult != null && mIconLoadResult.isIconLoaded) {
+ if ((mIconLoadResult != null && mIconLoadResult.isIconLoaded)
+ || (!mIsOpening && mBtvDrawable.getBackground() != null)) {
+ // No need to wait for icon load since we can display the BubbleTextView drawable.
setVisibility(View.VISIBLE);
}
if (!mIsOpening && mOriginalIcon != null) {
@@ -520,6 +534,7 @@
IconLoadResult result = new IconLoadResult(info,
btvIcon == null ? false : btvIcon.isThemed());
+ result.btvDrawable = btvIcon;
final long fetchIconId = sFetchIconId++;
MODEL_EXECUTOR.getHandler().postAtFrontOfQueue(() -> {
@@ -558,6 +573,7 @@
view.mIconLoadResult = fetchIcon(launcher, originalView,
(ItemInfo) originalView.getTag(), isOpening);
}
+ view.setOriginalDrawableBackground(view.mIconLoadResult.btvDrawable);
}
sIconLoadResult = null;