Loading packages/SystemUI/src/com/android/systemui/recents/views/TaskViewThumbnail.java +19 −4 Original line number Diff line number Diff line Loading @@ -77,10 +77,11 @@ public class TaskViewThumbnail extends View { @ViewDebug.ExportedProperty(category="recents") private float mDimAlpha; private Matrix mMatrix = new Matrix(); protected Paint mDrawPaint = new Paint(); private Paint mLockedPaint = new Paint(); private Paint mDrawPaint = new Paint(); protected Paint mLockedPaint = new Paint(); protected Paint mBgFillPaint = new Paint(); protected BitmapShader mBitmapShader; protected boolean mUserLocked = false; private LightingColorFilter mLightingColorFilter = new LightingColorFilter(0xffffffff, 0); // Clip the top of the thumbnail against the opaque header bar that overlaps this view Loading Loading @@ -152,7 +153,7 @@ public class TaskViewThumbnail extends View { int thumbnailHeight = Math.min(viewHeight, (int) (mThumbnailRect.height() * mThumbnailScale)); if (mTask != null && mTask.isLocked) { if (mUserLocked) { canvas.drawRoundRect(0, 0, viewWidth, viewHeight, mCornerRadius, mCornerRadius, mLockedPaint); } else if (mBitmapShader != null && thumbnailWidth > 0 && thumbnailHeight > 0) { Loading Loading @@ -343,6 +344,17 @@ public class TaskViewThumbnail extends View { updateThumbnailPaintFilter(); } /** * Returns the {@link Paint} used to draw a task screenshot, or {@link #mLockedPaint} if the * thumbnail shouldn't be drawn because it belongs to a locked user. */ protected Paint getDrawPaint() { if (mUserLocked) { return mLockedPaint; } return mDrawPaint; } /** * Binds the thumbnail view to the task. */ Loading @@ -354,7 +366,10 @@ public class TaskViewThumbnail extends View { if (t.colorBackground != 0) { mBgFillPaint.setColor(t.colorBackground); } if (t.colorPrimary != 0) { mLockedPaint.setColor(t.colorPrimary); } mUserLocked = t.isLocked; EventBus.getDefault().register(this); } Loading packages/SystemUI/src/com/android/systemui/recents/views/grid/GridTaskViewThumbnail.java +6 −7 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ public class GridTaskViewThumbnail extends TaskViewThumbnail { private Path mThumbnailOutline; private Path mRestBackgroundOutline; private Path mFullBackgroundOutline; // True if either this view's size or thumbnail scale has changed and mThumbnailOutline should // be updated. private boolean mUpdateThumbnailOutline = true; Loading Loading @@ -145,10 +144,7 @@ public class GridTaskViewThumbnail extends TaskViewThumbnail { 90, 90, false); // F mRestBackgroundOutline.lineTo(l, t); // A mRestBackgroundOutline.close(); } } else { mFullBackgroundOutline = mThumbnailOutline; } } Loading @@ -167,7 +163,10 @@ public class GridTaskViewThumbnail extends TaskViewThumbnail { updateThumbnailOutline(); mUpdateThumbnailOutline = false; } if (mBitmapShader != null && thumbnailWidth > 0 && thumbnailHeight > 0) { if (mUserLocked) { canvas.drawPath(mThumbnailOutline, mLockedPaint); } else if (mBitmapShader != null && thumbnailWidth > 0 && thumbnailHeight > 0) { // Draw the background, there will be some small overdraw with the thumbnail if (thumbnailWidth < viewWidth) { // Portrait thumbnail on a landscape task view Loading @@ -177,9 +176,9 @@ public class GridTaskViewThumbnail extends TaskViewThumbnail { // Landscape thumbnail on a portrait task view canvas.drawPath(mRestBackgroundOutline, mBgFillPaint); } canvas.drawPath(mThumbnailOutline, mDrawPaint); canvas.drawPath(mThumbnailOutline, getDrawPaint()); } else { canvas.drawPath(mFullBackgroundOutline, mBgFillPaint); canvas.drawPath(mThumbnailOutline, mBgFillPaint); } } } Loading
packages/SystemUI/src/com/android/systemui/recents/views/TaskViewThumbnail.java +19 −4 Original line number Diff line number Diff line Loading @@ -77,10 +77,11 @@ public class TaskViewThumbnail extends View { @ViewDebug.ExportedProperty(category="recents") private float mDimAlpha; private Matrix mMatrix = new Matrix(); protected Paint mDrawPaint = new Paint(); private Paint mLockedPaint = new Paint(); private Paint mDrawPaint = new Paint(); protected Paint mLockedPaint = new Paint(); protected Paint mBgFillPaint = new Paint(); protected BitmapShader mBitmapShader; protected boolean mUserLocked = false; private LightingColorFilter mLightingColorFilter = new LightingColorFilter(0xffffffff, 0); // Clip the top of the thumbnail against the opaque header bar that overlaps this view Loading Loading @@ -152,7 +153,7 @@ public class TaskViewThumbnail extends View { int thumbnailHeight = Math.min(viewHeight, (int) (mThumbnailRect.height() * mThumbnailScale)); if (mTask != null && mTask.isLocked) { if (mUserLocked) { canvas.drawRoundRect(0, 0, viewWidth, viewHeight, mCornerRadius, mCornerRadius, mLockedPaint); } else if (mBitmapShader != null && thumbnailWidth > 0 && thumbnailHeight > 0) { Loading Loading @@ -343,6 +344,17 @@ public class TaskViewThumbnail extends View { updateThumbnailPaintFilter(); } /** * Returns the {@link Paint} used to draw a task screenshot, or {@link #mLockedPaint} if the * thumbnail shouldn't be drawn because it belongs to a locked user. */ protected Paint getDrawPaint() { if (mUserLocked) { return mLockedPaint; } return mDrawPaint; } /** * Binds the thumbnail view to the task. */ Loading @@ -354,7 +366,10 @@ public class TaskViewThumbnail extends View { if (t.colorBackground != 0) { mBgFillPaint.setColor(t.colorBackground); } if (t.colorPrimary != 0) { mLockedPaint.setColor(t.colorPrimary); } mUserLocked = t.isLocked; EventBus.getDefault().register(this); } Loading
packages/SystemUI/src/com/android/systemui/recents/views/grid/GridTaskViewThumbnail.java +6 −7 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ public class GridTaskViewThumbnail extends TaskViewThumbnail { private Path mThumbnailOutline; private Path mRestBackgroundOutline; private Path mFullBackgroundOutline; // True if either this view's size or thumbnail scale has changed and mThumbnailOutline should // be updated. private boolean mUpdateThumbnailOutline = true; Loading Loading @@ -145,10 +144,7 @@ public class GridTaskViewThumbnail extends TaskViewThumbnail { 90, 90, false); // F mRestBackgroundOutline.lineTo(l, t); // A mRestBackgroundOutline.close(); } } else { mFullBackgroundOutline = mThumbnailOutline; } } Loading @@ -167,7 +163,10 @@ public class GridTaskViewThumbnail extends TaskViewThumbnail { updateThumbnailOutline(); mUpdateThumbnailOutline = false; } if (mBitmapShader != null && thumbnailWidth > 0 && thumbnailHeight > 0) { if (mUserLocked) { canvas.drawPath(mThumbnailOutline, mLockedPaint); } else if (mBitmapShader != null && thumbnailWidth > 0 && thumbnailHeight > 0) { // Draw the background, there will be some small overdraw with the thumbnail if (thumbnailWidth < viewWidth) { // Portrait thumbnail on a landscape task view Loading @@ -177,9 +176,9 @@ public class GridTaskViewThumbnail extends TaskViewThumbnail { // Landscape thumbnail on a portrait task view canvas.drawPath(mRestBackgroundOutline, mBgFillPaint); } canvas.drawPath(mThumbnailOutline, mDrawPaint); canvas.drawPath(mThumbnailOutline, getDrawPaint()); } else { canvas.drawPath(mFullBackgroundOutline, mBgFillPaint); canvas.drawPath(mThumbnailOutline, mBgFillPaint); } } }