diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2015-05-19 21:07:40 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-19 21:07:40 +0000 |
commit | bc0998670bca9995cca98e07004855dd28f29a10 (patch) | |
tree | 12e8fce983a30e368ae08c5373360b1610220324 /src/com/android/launcher3/BubbleTextView.java | |
parent | 0b493c86c5d0803f11095b71396ffac0097d26ef (diff) | |
parent | 4b6eb269502d05edabf883535a7099da5862de42 (diff) | |
download | android_packages_apps_Trebuchet-bc0998670bca9995cca98e07004855dd28f29a10.tar.gz android_packages_apps_Trebuchet-bc0998670bca9995cca98e07004855dd28f29a10.tar.bz2 android_packages_apps_Trebuchet-bc0998670bca9995cca98e07004855dd28f29a10.zip |
Merge "Adding drop shadow effect in allapps" into ub-launcher3-burnaby
Diffstat (limited to 'src/com/android/launcher3/BubbleTextView.java')
-rw-r--r-- | src/com/android/launcher3/BubbleTextView.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index d39e13976..3b3b9bf9f 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -34,6 +34,7 @@ import android.util.TypedValue; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.ViewConfiguration; +import android.view.ViewParent; import android.widget.TextView; import com.android.launcher3.IconCache.IconLoadRequest; @@ -276,9 +277,10 @@ public class BubbleTextView extends TextView { } // Only show the shadow effect when persistent pressed state is set. - if (getParent() instanceof ShortcutAndWidgetContainer) { - CellLayout layout = (CellLayout) getParent().getParent(); - layout.setPressedIcon(this, mPressedBackground); + ViewParent parent = getParent(); + if (parent != null && parent.getParent() instanceof BubbleTextShadowHandler) { + ((BubbleTextShadowHandler) parent.getParent()).setPressedIcon( + this, mPressedBackground); } updateIconState(); @@ -520,4 +522,11 @@ public class BubbleTextView extends TextView { } } } + + /** + * Interface to be implemented by the grand parent to allow click shadow effect. + */ + public static interface BubbleTextShadowHandler { + void setPressedIcon(BubbleTextView icon, Bitmap background); + } } |