diff options
author | Winson Chung <winsonc@google.com> | 2019-01-10 15:16:13 -0800 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2019-01-10 15:31:21 -0800 |
commit | 469864e49e0d3e4d1104966edee86d8088e04b01 (patch) | |
tree | 6efe61c4c10965b790294e4a5e07b4201f4a6cdb /quickstep | |
parent | 5e35040c75f95672670b57db84052ca0a46e803e (diff) | |
download | android_packages_apps_Trebuchet-469864e49e0d3e4d1104966edee86d8088e04b01.tar.gz android_packages_apps_Trebuchet-469864e49e0d3e4d1104966edee86d8088e04b01.tar.bz2 android_packages_apps_Trebuchet-469864e49e0d3e4d1104966edee86d8088e04b01.zip |
Fix issue with black flash when swiping up
- Ensure we update the background paint whenever the thumbnail is
bound to the task view (we still draw with the background paint when the
thumbnail has not yet loaded)
- Ensure that the dim is applied to the background paint even before
the thumbnail has loaded
Bug: 122612839
Test: Kill launcher, launch overview
Change-Id: Ia09ff49e4641b6a02a37cec3f94f74c2b0b8fd24
Diffstat (limited to 'quickstep')
-rw-r--r-- | quickstep/src/com/android/quickstep/views/TaskThumbnailView.java | 15 | ||||
-rw-r--r-- | quickstep/src/com/android/quickstep/views/TaskView.java | 2 |
2 files changed, 8 insertions, 9 deletions
diff --git a/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java b/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java index e5bed543a..0194b0b7e 100644 --- a/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java +++ b/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java @@ -116,8 +116,12 @@ public class TaskThumbnailView extends View { mIsDarkTextTheme = Themes.getAttrBoolean(mActivity, R.attr.isWorkspaceDarkText); } - public void bind() { + public void bind(Task task) { mOverlay.reset(); + mTask = task; + int color = task == null ? Color.BLACK : task.colorBackground | 0xFF000000; + mPaint.setColor(color); + mBackgroundPaint.setColor(color); } /** @@ -125,10 +129,6 @@ public class TaskThumbnailView extends View { */ public void setThumbnail(Task task, ThumbnailData thumbnailData) { mTask = task; - int color = task == null ? Color.BLACK : task.colorBackground | 0xFF000000; - mPaint.setColor(color); - mBackgroundPaint.setColor(color); - if (thumbnailData != null && thumbnailData.thumbnail != null) { Bitmap bm = thumbnailData.thumbnail; bm.prepareToDraw(); @@ -255,15 +255,14 @@ public class TaskThumbnailView extends View { private void updateThumbnailPaintFilter() { int mul = (int) ((1 - mDimAlpha * mDimAlphaMultiplier) * 255); + ColorFilter filter = getColorFilter(mul, mIsDarkTextTheme, mSaturation); + mBackgroundPaint.setColorFilter(filter); mDimmingPaintAfterClearing.setAlpha(255 - mul); if (mBitmapShader != null) { - ColorFilter filter = getColorFilter(mul, mIsDarkTextTheme, mSaturation); mPaint.setColorFilter(filter); - mBackgroundPaint.setColorFilter(filter); } else { mPaint.setColorFilter(null); mPaint.setColor(Color.argb(255, mul, mul, mul)); - mBackgroundPaint.setColorFilter(null); } invalidate(); } diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java index 456a02264..2946dfd73 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/src/com/android/quickstep/views/TaskView.java @@ -214,7 +214,7 @@ public class TaskView extends FrameLayout implements PageCallbacks { */ public void bind(Task task) { mTask = task; - mSnapshotView.bind(); + mSnapshotView.bind(task); } public Task getTask() { |