summaryrefslogtreecommitdiffstats
path: root/quickstep
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2017-12-12 17:18:32 -0800
committerTony Wickham <twickham@google.com>2017-12-12 17:23:26 -0800
commit0349b6c01c360c77a475a309b7c946ba2c779170 (patch)
tree65a8454ffe13f8253421db26a976f869ad738b25 /quickstep
parent4aa4c5a9117d92a2735497a13dd2214591b99da6 (diff)
downloadandroid_packages_apps_Trebuchet-0349b6c01c360c77a475a309b7c946ba2c779170.tar.gz
android_packages_apps_Trebuchet-0349b6c01c360c77a475a309b7c946ba2c779170.tar.bz2
android_packages_apps_Trebuchet-0349b6c01c360c77a475a309b7c946ba2c779170.zip
Animate recent app icon in after activity transition
This prevents the icon from being eclipsed by the drag view as it scales down. Change-Id: I6d06414bf58ddbc95e51827358e8845897ee554d
Diffstat (limited to 'quickstep')
-rw-r--r--quickstep/src/com/android/quickstep/NavBarSwipeInteractionHandler.java4
-rw-r--r--quickstep/src/com/android/quickstep/RecentsView.java3
-rw-r--r--quickstep/src/com/android/quickstep/TaskView.java29
3 files changed, 36 insertions, 0 deletions
diff --git a/quickstep/src/com/android/quickstep/NavBarSwipeInteractionHandler.java b/quickstep/src/com/android/quickstep/NavBarSwipeInteractionHandler.java
index 75db45b83..965696fe3 100644
--- a/quickstep/src/com/android/quickstep/NavBarSwipeInteractionHandler.java
+++ b/quickstep/src/com/android/quickstep/NavBarSwipeInteractionHandler.java
@@ -320,5 +320,9 @@ public class NavBarSwipeInteractionHandler extends InternalStateHandler {
private void onAnimationToLauncherComplete() {
mDragView.close(false);
+ View currentRecentsPage = mRecentsView.getPageAt(mRecentsView.getCurrentPage());
+ if (currentRecentsPage instanceof TaskView) {
+ ((TaskView) currentRecentsPage).animateIconToScale(1f);
+ }
}
}
diff --git a/quickstep/src/com/android/quickstep/RecentsView.java b/quickstep/src/com/android/quickstep/RecentsView.java
index a107343d1..fd9010dff 100644
--- a/quickstep/src/com/android/quickstep/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/RecentsView.java
@@ -146,6 +146,9 @@ public class RecentsView extends PagedView {
public void update(RecentsTaskLoadPlan loadPlan) {
final RecentsTaskLoader loader = TouchInteractionService.getRecentsTaskLoader();
setCurrentPage(0);
+ if (getPageAt(mCurrentPage) instanceof TaskView) {
+ ((TaskView) getPageAt(mCurrentPage)).setIconScale(0);
+ }
TaskStack stack = loadPlan != null ? loadPlan.getTaskStack() : null;
if (stack == null) {
removeAllViews();
diff --git a/quickstep/src/com/android/quickstep/TaskView.java b/quickstep/src/com/android/quickstep/TaskView.java
index a0ad61869..d834881f6 100644
--- a/quickstep/src/com/android/quickstep/TaskView.java
+++ b/quickstep/src/com/android/quickstep/TaskView.java
@@ -59,6 +59,8 @@ public class TaskView extends FrameLayout implements TaskCallbacks, SwipeDetecto
*/
private static final float SWIPE_DISTANCE_HEIGHT_PERCENTAGE = 0.38f;
+ private static final long SCALE_ICON_DURATION = 120;
+
private static final Property<TaskView, Float> PROPERTY_SWIPE_PROGRESS =
new Property<TaskView, Float>(Float.class, "swipe_progress") {
@@ -73,6 +75,19 @@ public class TaskView extends FrameLayout implements TaskCallbacks, SwipeDetecto
}
};
+ private static final Property<TaskView, Float> SCALE_ICON_PROPERTY =
+ new Property<TaskView, Float>(Float.TYPE, "scale_icon") {
+ @Override
+ public Float get(TaskView taskView) {
+ return taskView.mIconScale;
+ }
+
+ @Override
+ public void set(TaskView taskView, Float iconScale) {
+ taskView.setIconScale(iconScale);
+ }
+ };
+
private Task mTask;
private TaskThumbnailView mSnapshotView;
private ImageView mIconView;
@@ -81,6 +96,7 @@ public class TaskView extends FrameLayout implements TaskCallbacks, SwipeDetecto
private float mSwipeProgress;
private Interpolator mAlphaInterpolator;
private Interpolator mSwipeAnimInterpolator;
+ private float mIconScale = 1f;
public TaskView(Context context) {
this(context, null);
@@ -259,4 +275,17 @@ public class TaskView extends FrameLayout implements TaskCallbacks, SwipeDetecto
swipeAnimator.setInterpolator(mSwipeAnimInterpolator);
swipeAnimator.start();
}
+
+ public void animateIconToScale(float scale) {
+ ObjectAnimator.ofFloat(this, SCALE_ICON_PROPERTY, scale)
+ .setDuration(SCALE_ICON_DURATION).start();
+ }
+
+ protected void setIconScale(float iconScale) {
+ mIconScale = iconScale;
+ if (mIconView != null) {
+ mIconView.setScaleX(mIconScale);
+ mIconView.setScaleY(mIconScale);
+ }
+ }
}