From 93f98eaf1800024cb2f28379bdd997f3debae63a Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Tue, 10 Mar 2015 16:28:47 -0700 Subject: Adding app grid layout with fastscroller. - Adding filtering and using alphabetic index for app grouping. Change-Id: I745b644fa8f90f5ff24a8642ac377ef1c65d8aff --- src/com/android/launcher3/BubbleTextView.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/com/android/launcher3/BubbleTextView.java') diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index 5ea84aeb2..fabae5702 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -63,6 +63,7 @@ public class BubbleTextView extends TextView { private float mSlop; + private final boolean mDeferShadowGenerationOnTouch; private final boolean mCustomShadowsEnabled; private final boolean mLayoutHorizontal; private final int mIconSize; @@ -96,6 +97,8 @@ public class BubbleTextView extends TextView { grid.iconDrawablePaddingPx); mTextSize = a.getDimensionPixelSize(R.styleable.BubbleTextView_textSizeOverride, grid.allAppsIconTextSizePx); + mDeferShadowGenerationOnTouch = + a.getBoolean(R.styleable.BubbleTextView_deferShadowGeneration, false); a.recycle(); if (mCustomShadowsEnabled) { @@ -218,7 +221,7 @@ public class BubbleTextView extends TextView { // So that the pressed outline is visible immediately on setStayPressed(), // we pre-create it on ACTION_DOWN (it takes a small but perceptible amount of time // to create it) - if (mPressedBackground == null) { + if (!mDeferShadowGenerationOnTouch && mPressedBackground == null) { mPressedBackground = mOutlineHelper.createMediumDropShadow(this); } @@ -247,6 +250,10 @@ public class BubbleTextView extends TextView { mStayPressed = stayPressed; if (!stayPressed) { mPressedBackground = null; + } else { + if (mPressedBackground == null) { + mPressedBackground = mOutlineHelper.createMediumDropShadow(this); + } } // Only show the shadow effect when persistent pressed state is set. -- cgit v1.2.3