diff options
author | Winson Chung <winsonc@google.com> | 2014-09-05 13:17:22 +0200 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2014-09-07 20:08:40 +0000 |
commit | 2e7f3bdcc9ec0b3e95b565b943ecee2210f4b937 (patch) | |
tree | 26dd0d99d4bd6f4e8ce8b0b718c14646ff3c604f /packages/SystemUI/src/com/android/systemui/recents | |
parent | d78d4f3acd83d111a0d64d400694ed51a67f488e (diff) | |
download | frameworks_base-2e7f3bdcc9ec0b3e95b565b943ecee2210f4b937.zip frameworks_base-2e7f3bdcc9ec0b3e95b565b943ecee2210f4b937.tar.gz frameworks_base-2e7f3bdcc9ec0b3e95b565b943ecee2210f4b937.tar.bz2 |
Removing unnecessary delays, ensuring transition thumbnail is the size of the header. (Bug. 16987565)
Change-Id: Ic104876c5fe16997eca00e0a2b3d8644c927120c
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/recents')
3 files changed, 33 insertions, 26 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java b/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java index 2d114c0..64617bf 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java +++ b/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java @@ -385,9 +385,9 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta toTask); if (toTransform != null && toTask.key != null) { Rect toTaskRect = toTransform.rect; - - // XXX: Reduce the memory usage the to the task bar height - Bitmap thumbnail = Bitmap.createBitmap(toTaskRect.width(), toTaskRect.height(), + int toHeaderWidth = (int) (mHeaderBar.getMeasuredWidth() * toTransform.scale); + int toHeaderHeight = (int) (mHeaderBar.getMeasuredHeight() * toTransform.scale); + Bitmap thumbnail = Bitmap.createBitmap(toHeaderWidth, toHeaderHeight, Bitmap.Config.ARGB_8888); if (Constants.DebugFlags.App.EnableTransitionThumbnailDebugMode) { thumbnail.eraseColor(0xFFff0000); @@ -401,7 +401,8 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta mStartAnimationTriggered = false; return ActivityOptions.makeThumbnailAspectScaleDownAnimation(mStatusBarView, - thumbnail, toTaskRect.left, toTaskRect.top, this); + thumbnail, toTaskRect.left, toTaskRect.top, toTaskRect.width(), + toTaskRect.height(), this); } // If both the screenshot and thumbnail fails, then just fall back to the default transition diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java index 0c6e7b6..1bfb41f 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java @@ -413,10 +413,8 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV final SystemServicesProxy ssp = RecentsTaskLoader.getInstance().getSystemServicesProxy(); ActivityOptions opts = null; - int thumbnailWidth = transform.rect.width(); - int thumbnailHeight = transform.rect.height(); - if (task.thumbnail != null && thumbnailWidth > 0 && thumbnailHeight > 0 && - task.thumbnail.getWidth() > 0 && task.thumbnail.getHeight() > 0) { + if (task.thumbnail != null && task.thumbnail.getWidth() > 0 && + task.thumbnail.getHeight() > 0) { Bitmap b; if (tv != null) { // Disable any focused state before we draw the header @@ -424,7 +422,11 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV tv.unsetFocusedTask(); } - b = Bitmap.createBitmap(thumbnailWidth, thumbnailHeight, Bitmap.Config.ARGB_8888); + float scale = tv.getScaleX(); + int fromHeaderWidth = (int) (tv.mHeaderView.getMeasuredWidth() * scale); + int fromHeaderHeight = (int) (tv.mHeaderView.getMeasuredHeight() * scale); + b = Bitmap.createBitmap(fromHeaderWidth, fromHeaderHeight, + Bitmap.Config.ARGB_8888); if (Constants.DebugFlags.App.EnableTransitionThumbnailDebugMode) { b.eraseColor(0xFFff0000); } else { @@ -435,7 +437,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV } } else { // Notify the system to skip the thumbnail layer by using an ALPHA_8 bitmap - b = Bitmap.createBitmap(thumbnailWidth, thumbnailHeight, Bitmap.Config.ALPHA_8); + b = Bitmap.createBitmap(1, 1, Bitmap.Config.ALPHA_8); } ActivityOptions.OnAnimationStartedListener animStartedListener = null; if (lockToTask) { @@ -456,7 +458,8 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV }; } opts = ActivityOptions.makeThumbnailAspectScaleUpAnimation(sourceView, - b, offsetX, offsetY, animStartedListener); + b, offsetX, offsetY, transform.rect.width(), transform.rect.height(), + animStartedListener); } final ActivityOptions launchOpts = opts; diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java index eecc170..49aa52b 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java @@ -839,25 +839,28 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, @Override public void onClick(final View v) { - // We purposely post the handler delayed to allow for the touch feedback to draw final TaskView tv = this; - postDelayed(new Runnable() { - @Override - public void run() { - if (Constants.DebugFlags.App.EnableTaskFiltering && v == mHeaderView.mApplicationIcon) { - mCb.onTaskViewAppIconClicked(tv); - } else if (v == mHeaderView.mDismissButton) { - dismissTask(); - } else { - if (v == mActionButtonView) { - // Reset the translation of the action button before we animate it out - mActionButtonView.setTranslationZ(0f); + final boolean delayViewClick = (v != this); + if (delayViewClick) { + // We purposely post the handler delayed to allow for the touch feedback to draw + postDelayed(new Runnable() { + @Override + public void run() { + if (Constants.DebugFlags.App.EnableTaskFiltering && v == mHeaderView.mApplicationIcon) { + mCb.onTaskViewAppIconClicked(tv); + } else if (v == mHeaderView.mDismissButton) { + dismissTask(); } - mCb.onTaskViewClicked(tv, tv.getTask(), - (v == mFooterView || v == mActionButtonView)); } + }, 125); + } else { + if (v == mActionButtonView) { + // Reset the translation of the action button before we animate it out + mActionButtonView.setTranslationZ(0f); } - }, 125); + mCb.onTaskViewClicked(tv, tv.getTask(), + (v == mFooterView || v == mActionButtonView)); + } } /**** View.OnLongClickListener Implementation ****/ |