diff options
author | 2021-04-26 18:40:03 -0400 | |
---|---|---|
committer | 2021-04-26 18:40:03 -0400 | |
commit | 72ec557ee7400b874ea056e3facd5da73a0c9921 (patch) | |
tree | 1bcc43892763bce404d5753298b9240ef7078cd5 | |
parent | 60a4a0b33d051bf73e7785b60c5a05b579adaff7 (diff) |
Remove shadow on folder icon.
Bug: 175329686
Test: manual, verify no shadow on folder icon background
Change-Id: I8ec9ac55ca4fd48155f017376c5bcd6043771d2a
-rw-r--r-- | src/com/android/launcher3/folder/PreviewBackground.java | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/com/android/launcher3/folder/PreviewBackground.java b/src/com/android/launcher3/folder/PreviewBackground.java index 767fffe35b..5ddf84f99f 100644 --- a/src/com/android/launcher3/folder/PreviewBackground.java +++ b/src/com/android/launcher3/folder/PreviewBackground.java @@ -50,6 +50,8 @@ import com.android.launcher3.views.ActivityContext; */ public class PreviewBackground extends CellLayout.DelegatedCellDrawing { + private static final boolean DRAW_SHADOW = false; + private static final int CONSUMPTION_ANIMATION_DURATION = 100; private final PorterDuffXfermode mShadowPorterDuffXfermode @@ -163,13 +165,15 @@ public class PreviewBackground extends CellLayout.DelegatedCellDrawing { // Stroke width is 1dp mStrokeWidth = context.getResources().getDisplayMetrics().density; - float radius = getScaledRadius(); - float shadowRadius = radius + mStrokeWidth; - int shadowColor = Color.argb(SHADOW_OPACITY, 0, 0, 0); - mShadowShader = new RadialGradient(0, 0, 1, - new int[] {shadowColor, Color.TRANSPARENT}, - new float[] {radius / shadowRadius, 1}, - Shader.TileMode.CLAMP); + if (DRAW_SHADOW) { + float radius = getScaledRadius(); + float shadowRadius = radius + mStrokeWidth; + int shadowColor = Color.argb(SHADOW_OPACITY, 0, 0, 0); + mShadowShader = new RadialGradient(0, 0, 1, + new int[]{shadowColor, Color.TRANSPARENT}, + new float[]{radius / shadowRadius, 1}, + Shader.TileMode.CLAMP); + } invalidate(); } @@ -239,6 +243,9 @@ public class PreviewBackground extends CellLayout.DelegatedCellDrawing { } public void drawShadow(Canvas canvas) { + if (!DRAW_SHADOW) { + return; + } if (mShadowShader == null) { return; } @@ -277,6 +284,9 @@ public class PreviewBackground extends CellLayout.DelegatedCellDrawing { } public void fadeInBackgroundShadow() { + if (!DRAW_SHADOW) { + return; + } if (mShadowAnimator != null) { mShadowAnimator.cancel(); } |