summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/views
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2017-06-26 22:01:07 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-06-26 22:01:08 +0000
commitf729eb529142b78aa03732a71f39e3a8c10d6188 (patch)
treee79264065705338a8ab2c080ef5cd5e822a6169f /src/com/android/launcher3/views
parentbbe504d24d5e0757d1a7772af822b7a6e274c9b4 (diff)
parent1d9cc3247554d5b52534515af1a081716476097c (diff)
downloadandroid_packages_apps_Trebuchet-f729eb529142b78aa03732a71f39e3a8c10d6188.tar.gz
android_packages_apps_Trebuchet-f729eb529142b78aa03732a71f39e3a8c10d6188.tar.bz2
android_packages_apps_Trebuchet-f729eb529142b78aa03732a71f39e3a8c10d6188.zip
Merge "Fix Folder text animation bugs." into ub-launcher3-dorval-polish
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();