summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2014-07-10 19:03:47 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-07-10 17:35:05 +0000
commit3e787142a84058ead25856471d934e591d560223 (patch)
tree006aa4e9ac4fe62f5390f7ddf0531e8206170380 /src
parente639d6b67c4ec16dbce8a8e0099a50c98e34c858 (diff)
parent15872dad931963a763598ba3fd3b3480efc56f75 (diff)
downloadandroid_packages_apps_Trebuchet-3e787142a84058ead25856471d934e591d560223.tar.gz
android_packages_apps_Trebuchet-3e787142a84058ead25856471d934e591d560223.tar.bz2
android_packages_apps_Trebuchet-3e787142a84058ead25856471d934e591d560223.zip
Merge "Fixing background being drawn multiple times for BubbleTextView" into ub-now-master
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/BubbleTextView.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index 54d7e506e..57dcea044 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -66,11 +66,11 @@ public class BubbleTextView extends TextView {
private float mSlop;
private int mTextColor;
- private boolean mCustomShadowsEnabled = true;
+ private final boolean mCustomShadowsEnabled;
private boolean mIsTextVisible;
private boolean mBackgroundSizeChanged;
- private Drawable mBackground;
+ private final Drawable mBackground;
private boolean mStayPressed;
private CheckLongPressHelper mLongPressHelper;
@@ -96,6 +96,13 @@ public class BubbleTextView extends TextView {
mCustomShadowsEnabled = a.getBoolean(R.styleable.BubbleTextView_customShadows, true);
a.recycle();
+ if (mCustomShadowsEnabled) {
+ // Draw the background itself as the parent is drawn twice.
+ mBackground = getBackground();
+ setBackground(null);
+ } else {
+ mBackground = null;
+ }
init();
}
@@ -110,7 +117,6 @@ public class BubbleTextView extends TextView {
private void init() {
mLongPressHelper = new CheckLongPressHelper(this);
- mBackground = getBackground();
mOutlineHelper = HolographicOutlineHelper.obtain(getContext());
if (mCustomShadowsEnabled) {