summaryrefslogtreecommitdiffstats
path: root/go
diff options
context:
space:
mode:
authorKevin <kevhan@google.com>2019-05-03 13:14:40 -0700
committerKevin <kevhan@google.com>2019-05-09 16:38:54 -0700
commit5c0ee7ca370dcd2f47f4a557622f23332109a023 (patch)
tree8c799e00098a863978af6018f495aa3c4418558e /go
parent07e12ee573b852487120a818cf271503f84b441e (diff)
downloadandroid_packages_apps_Trebuchet-5c0ee7ca370dcd2f47f4a557622f23332109a023.tar.gz
android_packages_apps_Trebuchet-5c0ee7ca370dcd2f47f4a557622f23332109a023.tar.bz2
android_packages_apps_Trebuchet-5c0ee7ca370dcd2f47f4a557622f23332109a023.zip
Polish app => recents animation (5/5)
Add the part of the animation where task views fade in from bottom to top. For the app animating in, we only fade in the label and the icon as the snapshot needs to be visible as the app window scales down to it. Bug: 132112131 Test: Manual test animation Change-Id: Ia3fb98fde0b14fa4f72b53a1941cc2ee6b9f2294
Diffstat (limited to 'go')
-rw-r--r--go/quickstep/src/com/android/quickstep/views/IconRecentsView.java69
-rw-r--r--go/quickstep/src/com/android/quickstep/views/TaskItemView.java8
2 files changed, 77 insertions, 0 deletions
diff --git a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
index 4c91a5966..4413cc95b 100644
--- a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
+++ b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
@@ -50,6 +50,7 @@ import android.widget.FrameLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import androidx.interpolator.view.animation.LinearOutSlowInInterpolator;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.LinearLayoutManager;
@@ -114,11 +115,16 @@ public final class IconRecentsView extends FrameLayout implements Insettable {
private static final long REMOTE_TO_RECENTS_APP_SCALE_DOWN_DURATION = 300;
private static final long REMOTE_TO_RECENTS_VERTICAL_EASE_IN_DURATION = 400;
+ private static final long REMOTE_TO_RECENTS_ITEM_FADE_START_DELAY = 200;
+ private static final long REMOTE_TO_RECENTS_ITEM_FADE_DURATION = 217;
+ private static final long REMOTE_TO_RECENTS_ITEM_FADE_BETWEEN_DELAY = 33;
private static final PathInterpolator FAST_OUT_SLOW_IN_1 =
new PathInterpolator(.4f, 0f, 0f, 1f);
private static final PathInterpolator FAST_OUT_SLOW_IN_2 =
new PathInterpolator(.5f, 0f, 0f, 1f);
+ private static final LinearOutSlowInInterpolator OUT_SLOW_IN =
+ new LinearOutSlowInInterpolator();
public static final long REMOTE_APP_TO_OVERVIEW_DURATION =
REMOTE_TO_RECENTS_VERTICAL_EASE_IN_DURATION;
@@ -610,6 +616,7 @@ public final class IconRecentsView extends FrameLayout implements Insettable {
playRemoteTransYAnim(anim, appMatrix);
playRemoteAppScaleDownAnim(anim, appMatrix, appTarget, recentsTarget,
bottomView.getThumbnailView());
+ playRemoteTaskListFadeIn(anim, bottomView);
}
/**
@@ -724,6 +731,68 @@ public final class IconRecentsView extends FrameLayout implements Insettable {
anim.play(remoteAppAnim);
}
+ /**
+ * Play task list fade in animation as part of remote app to recents animation. This animation
+ * ensures that the task views in the recents list fade in from bottom to top.
+ *
+ * @param anim animator set to play on
+ * @param appTaskView the task view associated with the remote app closing
+ */
+ private void playRemoteTaskListFadeIn(@NonNull AnimatorSet anim,
+ @NonNull TaskItemView appTaskView) {
+ long delay = REMOTE_TO_RECENTS_ITEM_FADE_START_DELAY;
+ int childCount = mTaskRecyclerView.getChildCount();
+ for (int i = 0; i < childCount; i++) {
+ ValueAnimator fadeAnim = ValueAnimator.ofFloat(0, 1.0f);
+ fadeAnim.setDuration(REMOTE_TO_RECENTS_ITEM_FADE_DURATION).setInterpolator(OUT_SLOW_IN);
+ fadeAnim.setStartDelay(delay);
+ View view = mTaskRecyclerView.getChildAt(i);
+ if (Objects.equals(view, appTaskView)) {
+ // Only animate icon and text for the view with snapshot animating in
+ final View icon = appTaskView.getIconView();
+ final View label = appTaskView.getLabelView();
+
+ icon.setAlpha(0.0f);
+ label.setAlpha(0.0f);
+
+ fadeAnim.addUpdateListener(alphaVal -> {
+ float val = alphaVal.getAnimatedFraction();
+
+ icon.setAlpha(val);
+ label.setAlpha(val);
+ });
+ fadeAnim.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ icon.setAlpha(1.0f);
+ label.setAlpha(1.0f);
+ }
+ });
+ } else {
+ // Otherwise, fade in the entire view.
+ view.setAlpha(0.0f);
+ fadeAnim.addUpdateListener(alphaVal -> {
+ float val = alphaVal.getAnimatedFraction();
+ view.setAlpha(val);
+ });
+ fadeAnim.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ view.setAlpha(1.0f);
+ }
+ });
+ }
+ anim.play(fadeAnim);
+
+ int itemType = mTaskRecyclerView.getChildViewHolder(view).getItemViewType();
+ if (itemType == ITEM_TYPE_CLEAR_ALL) {
+ // Don't add delay. Clear all should animate at same time as next view.
+ continue;
+ }
+ delay += REMOTE_TO_RECENTS_ITEM_FADE_BETWEEN_DELAY;
+ }
+ }
+
@Override
public void setInsets(Rect insets) {
mInsets = insets;
diff --git a/go/quickstep/src/com/android/quickstep/views/TaskItemView.java b/go/quickstep/src/com/android/quickstep/views/TaskItemView.java
index 6db801322..f184ad06a 100644
--- a/go/quickstep/src/com/android/quickstep/views/TaskItemView.java
+++ b/go/quickstep/src/com/android/quickstep/views/TaskItemView.java
@@ -137,6 +137,14 @@ public final class TaskItemView extends LinearLayout {
return mThumbnailView;
}
+ public View getIconView() {
+ return mIconView;
+ }
+
+ public View getLabelView() {
+ return mLabelView;
+ }
+
/**
* Start a new animation from the current task content to the specified new content. The caller
* is responsible for the actual animation control via the property