diff options
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/recent/Choreographer.java | 21 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java | 44 |
2 files changed, 50 insertions, 15 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recent/Choreographer.java b/packages/SystemUI/src/com/android/systemui/recent/Choreographer.java index dc2f0be..a8c2020 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/Choreographer.java +++ b/packages/SystemUI/src/com/android/systemui/recent/Choreographer.java @@ -21,21 +21,21 @@ import android.animation.AnimatorSet; import android.animation.AnimatorSet.Builder; import android.animation.ObjectAnimator; import android.graphics.drawable.Drawable; -import android.util.Log; import android.util.Slog; import android.view.View; +import android.view.ViewRootImpl; /* package */ class Choreographer implements Animator.AnimatorListener { // should group this into a multi-property animation private static final int OPEN_DURATION = 136; - private static final int CLOSE_DURATION = 250; + private static final int CLOSE_DURATION = 130; private static final int SCRIM_DURATION = 400; private static final String TAG = RecentsPanelView.TAG; private static final boolean DEBUG = RecentsPanelView.DEBUG; boolean mVisible; int mPanelHeight; - View mRootView; + RecentsPanelView mRootView; View mScrimView; View mContentView; View mNoRecentAppsView; @@ -45,7 +45,7 @@ import android.view.View; // the panel will start to appear this many px from the end final int HYPERSPACE_OFFRAMP = 200; - public Choreographer(View root, View scrim, View content, + public Choreographer(RecentsPanelView root, View scrim, View content, View noRecentApps, Animator.AnimatorListener listener) { mRootView = root; mScrimView = scrim; @@ -67,7 +67,7 @@ import android.view.View; end = 0; } else { start = y; - end = y + HYPERSPACE_OFFRAMP; + end = y; } Animator posAnim = ObjectAnimator.ofFloat(mContentView, "translationY", @@ -77,12 +77,12 @@ import android.view.View; : new android.view.animation.AccelerateInterpolator(2.5f)); posAnim.setDuration(appearing ? OPEN_DURATION : CLOSE_DURATION); - Animator glowAnim = ObjectAnimator.ofFloat(mContentView, "alpha", + Animator fadeAnim = ObjectAnimator.ofFloat(mContentView, "alpha", mContentView.getAlpha(), appearing ? 1.0f : 0.0f); - glowAnim.setInterpolator(appearing + fadeAnim.setInterpolator(appearing ? new android.view.animation.AccelerateInterpolator(1.0f) : new android.view.animation.DecelerateInterpolator(1.0f)); - glowAnim.setDuration(appearing ? OPEN_DURATION : CLOSE_DURATION); + fadeAnim.setDuration(appearing ? OPEN_DURATION : CLOSE_DURATION); Animator noRecentAppsFadeAnim = null; if (mNoRecentAppsView != null && // doesn't exist on large devices @@ -96,7 +96,7 @@ import android.view.View; } mContentAnim = new AnimatorSet(); - final Builder builder = mContentAnim.play(glowAnim).with(posAnim); + final Builder builder = mContentAnim.play(fadeAnim).with(posAnim); if (noRecentAppsFadeAnim != null) { builder.with(noRecentAppsFadeAnim); @@ -153,9 +153,10 @@ import android.view.View; public void onAnimationEnd(Animator animation) { if (DEBUG) Slog.d(TAG, "onAnimationEnd"); if (!mVisible) { - mRootView.setVisibility(View.GONE); + mRootView.hideWindow(); } mContentView.setLayerType(View.LAYER_TYPE_NONE, null); + mContentView.setAlpha(1f); mContentAnim = null; } diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java index 995ee43..feb1ac8 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java @@ -26,7 +26,9 @@ import android.content.res.Configuration; import android.content.res.Resources; import android.content.res.TypedArray; import android.graphics.Bitmap; +import android.graphics.Canvas; import android.graphics.Matrix; +import android.graphics.Rect; import android.graphics.Shader.TileMode; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; @@ -48,11 +50,9 @@ import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.BaseAdapter; import android.widget.FrameLayout; -import android.widget.HorizontalScrollView; import android.widget.ImageView; import android.widget.ImageView.ScaleType; import android.widget.PopupMenu; -import android.widget.ScrollView; import android.widget.TextView; import com.android.systemui.R; @@ -83,6 +83,9 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener private Choreographer mChoreo; OnRecentsPanelVisibilityChangedListener mVisibilityChangedListener; + ImageView mPlaceholderThumbnail; + boolean mHideWindowAfterPlaceholderThumbnailIsHidden; + private RecentTasksLoader mRecentTasksLoader; private ArrayList<TaskDescription> mRecentTaskDescriptions; private Runnable mPreloadTasksRunnable; @@ -283,7 +286,9 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener public void show(boolean show, boolean animate, ArrayList<TaskDescription> recentTaskDescriptions, boolean firstScreenful) { // For now, disable animations. We may want to re-enable in the future - animate = false; + if (show) { + animate = false; + } if (show) { // Need to update list of recent apps before we set visibility so this view's // content description is updated before it gets focus for TalkBack mode @@ -687,11 +692,31 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener context.getSystemService(Context.ACTIVITY_SERVICE); holder.thumbnailViewImage.setDrawingCacheEnabled(true); Bitmap bm = holder.thumbnailViewImage.getDrawingCache(); - ActivityOptions opts = ActivityOptions.makeThumbnailScaleUpAnimation( + mPlaceholderThumbnail = (ImageView) findViewById(R.id.recents_transition_placeholder_icon); + + final ImageView placeholderThumbnail = mPlaceholderThumbnail; + mHideWindowAfterPlaceholderThumbnailIsHidden = false; + placeholderThumbnail.setVisibility(VISIBLE); + Bitmap b2 = bm.copy(bm.getConfig(), true); + placeholderThumbnail.setImageBitmap(b2); + + Rect r = new Rect(); + holder.thumbnailViewImage.getGlobalVisibleRect(r); + + placeholderThumbnail.setTranslationX(r.left); + placeholderThumbnail.setTranslationY(r.top); + + show(false, true); + + ActivityOptions opts = ActivityOptions.makeDelayedThumbnailScaleUpAnimation( holder.thumbnailViewImage, bm, 0, 0, new ActivityOptions.OnAnimationStartedListener() { @Override public void onAnimationStarted() { - hide(true); + mPlaceholderThumbnail = null; + placeholderThumbnail.setVisibility(INVISIBLE); + if (mHideWindowAfterPlaceholderThumbnailIsHidden) { + hideWindow(); + } } }); if (ad.taskId >= 0) { @@ -709,6 +734,15 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener holder.thumbnailViewImage.setDrawingCacheEnabled(false); } + public void hideWindow() { + if (mPlaceholderThumbnail != null) { + mHideWindowAfterPlaceholderThumbnailIsHidden = true; + } else { + setVisibility(GONE); + mHideWindowAfterPlaceholderThumbnailIsHidden = false; + } + } + public void onItemClick(AdapterView<?> parent, View view, int position, long id) { handleOnClick(view); } |