summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/views
diff options
context:
space:
mode:
authorJon Miranda <jonmiranda@google.com>2017-06-26 11:43:58 -0700
committerJon Miranda <jonmiranda@google.com>2017-06-26 11:43:58 -0700
commit1d9cc3247554d5b52534515af1a081716476097c (patch)
treeb6bad64ae5f7d2ec9ad3ace5bfc9dca35954e5b8 /src/com/android/launcher3/views
parentcb73920b231ab4e26dcf3500e65daeedda88c912 (diff)
downloadandroid_packages_apps_Trebuchet-1d9cc3247554d5b52534515af1a081716476097c.tar.gz
android_packages_apps_Trebuchet-1d9cc3247554d5b52534515af1a081716476097c.tar.bz2
android_packages_apps_Trebuchet-1d9cc3247554d5b52534515af1a081716476097c.zip
Fix Folder text animation bugs.
* The Folder text was not getting reset back to visible on close. * DoubleShadowBubbleTextView now draws the shadow using the alpha of the current text. Bug: 62967568 Bug: 35064148 Change-Id: Iea3e5275b6878fc362150e99a225ff700b946f44
Diffstat (limited to 'src/com/android/launcher3/views')
-rw-r--r--src/com/android/launcher3/views/DoubleShadowBubbleTextView.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/com/android/launcher3/views/DoubleShadowBubbleTextView.java b/src/com/android/launcher3/views/DoubleShadowBubbleTextView.java
index 9c8457afc..c0b5fe156 100644
--- a/src/com/android/launcher3/views/DoubleShadowBubbleTextView.java
+++ b/src/com/android/launcher3/views/DoubleShadowBubbleTextView.java
@@ -19,7 +19,9 @@ package com.android.launcher3.views;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
+import android.graphics.Color;
import android.graphics.Region;
+import android.support.v4.graphics.ColorUtils;
import android.util.AttributeSet;
import com.android.launcher3.BubbleTextView;
@@ -45,18 +47,20 @@ public class DoubleShadowBubbleTextView extends BubbleTextView {
mShadowInfo = new ShadowInfo(context, attrs, defStyle);
setShadowLayer(mShadowInfo.ambientShadowBlur, 0, 0, mShadowInfo.ambientShadowColor);
}
+
@Override
public void onDraw(Canvas canvas) {
// If text is transparent, don't draw any shadow
- if ((getCurrentTextColor() >> 24) == 0) {
+ int alpha = Color.alpha(getCurrentTextColor());
+ if (alpha == 0) {
getPaint().clearShadowLayer();
super.onDraw(canvas);
return;
}
// We enhance the shadow by drawing the shadow twice
- getPaint().setShadowLayer(
- mShadowInfo.ambientShadowBlur, 0, 0, mShadowInfo.ambientShadowColor);
+ getPaint().setShadowLayer(mShadowInfo.ambientShadowBlur, 0, 0,
+ ColorUtils.setAlphaComponent(mShadowInfo.ambientShadowColor, alpha));
drawWithoutBadge(canvas);
canvas.save(Canvas.CLIP_SAVE_FLAG);
@@ -64,8 +68,8 @@ public class DoubleShadowBubbleTextView extends BubbleTextView {
getScrollX() + getWidth(),
getScrollY() + getHeight(), Region.Op.INTERSECT);
- getPaint().setShadowLayer(mShadowInfo.keyShadowBlur, 0.0f,
- mShadowInfo.keyShadowOffset, mShadowInfo.keyShadowColor);
+ getPaint().setShadowLayer(mShadowInfo.keyShadowBlur, 0.0f, mShadowInfo.keyShadowOffset,
+ ColorUtils.setAlphaComponent(mShadowInfo.keyShadowColor, alpha));
drawWithoutBadge(canvas);
canvas.restore();