diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2015-05-14 19:24:40 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2015-05-15 15:47:10 -0700 |
commit | 4b6eb269502d05edabf883535a7099da5862de42 (patch) | |
tree | f0506a3cdc17c325920d25a94159b43bb8112db3 /src/com/android/launcher3/BubbleTextView.java | |
parent | 312011094f0a00ba53fb5cc6e8d01d8ac90addf1 (diff) | |
download | android_packages_apps_Trebuchet-4b6eb269502d05edabf883535a7099da5862de42.tar.gz android_packages_apps_Trebuchet-4b6eb269502d05edabf883535a7099da5862de42.tar.bz2 android_packages_apps_Trebuchet-4b6eb269502d05edabf883535a7099da5862de42.zip |
Adding drop shadow effect in allapps
Change-Id: Ic7a9b6e23d925d27a8dcbd418d2609e43917ac45
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 5dc3b1239..8f2892118 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -33,6 +33,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; @@ -274,9 +275,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(); @@ -509,4 +511,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); + } } |