From 9a54ac4a463190ef8b94eb45abbb2c27eb7395ea Mon Sep 17 00:00:00 2001 From: Winson Date: Fri, 1 Apr 2016 12:17:02 -0700 Subject: [PATCH] Fixing regression in drawing thumbnail background. - Between the time that the task view is bound and the thumbnail is loaded, we should still draw the background color instead of nothing. Bug: 27971061 Change-Id: I5b7a607b86a0da20fc6ca183b1d7bc4e9db9e377 --- .../systemui/recents/views/TaskViewThumbnail.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewThumbnail.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewThumbnail.java index 3eeabc74801db..e5ac0d31ca8fb 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewThumbnail.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewThumbnail.java @@ -141,9 +141,9 @@ public class TaskViewThumbnail extends View { return; } + int viewWidth = mTaskViewRect.width(); + int viewHeight = mTaskViewRect.height(); if (mBitmapShader != null) { - int viewWidth = mTaskViewRect.width(); - int viewHeight = mTaskViewRect.height(); // We are drawing the thumbnail in the same orientation, so just fit the width int thumbnailWidth = (int) (mThumbnailRect.width() * mThumbnailScale); @@ -180,6 +180,9 @@ public class TaskViewThumbnail extends View { canvas.restoreToCount(count); } + } else { + canvas.drawRoundRect(0, 0, viewWidth, viewHeight, mCornerRadius, mCornerRadius, + mBgFillPaint); } } @@ -319,12 +322,12 @@ public class TaskViewThumbnail extends View { mDisabledInSafeMode = disabledInSafeMode; if (t.thumbnail != null) { setThumbnail(t.thumbnail, thumbnailInfo); - if (t.colorBackground != 0) { - mBgFillPaint.setColor(t.colorBackground); - } } else { setThumbnail(null, null); } + if (t.colorBackground != 0) { + mBgFillPaint.setColor(t.colorBackground); + } } /** Unbinds the thumbnail view from the task */