summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/graphics/ShadowDrawable.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2017-05-17 21:10:34 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-05-17 21:10:34 +0000
commit233fbd70595b83cf254224866cc75c92dc545e92 (patch)
tree5810ed834e8ac866b708151455f3cbaab3ca0b38 /src/com/android/launcher3/graphics/ShadowDrawable.java
parent3148d486e45f1a27caa8a091e51e9ae7095baeb9 (diff)
parent8b6ac00a1bd9ba5080e1fd5d3b5021d98711db88 (diff)
downloadandroid_packages_apps_Trebuchet-233fbd70595b83cf254224866cc75c92dc545e92.tar.gz
android_packages_apps_Trebuchet-233fbd70595b83cf254224866cc75c92dc545e92.tar.bz2
android_packages_apps_Trebuchet-233fbd70595b83cf254224866cc75c92dc545e92.zip
Adding an option to change the shadow size
am: 8b6ac00a1b Change-Id: I6ebafb3b81f486adeb510bc021638dd266ca1234
Diffstat (limited to 'src/com/android/launcher3/graphics/ShadowDrawable.java')
-rw-r--r--src/com/android/launcher3/graphics/ShadowDrawable.java15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/com/android/launcher3/graphics/ShadowDrawable.java b/src/com/android/launcher3/graphics/ShadowDrawable.java
index 5e76649ca..5f4fc6cc7 100644
--- a/src/com/android/launcher3/graphics/ShadowDrawable.java
+++ b/src/com/android/launcher3/graphics/ShadowDrawable.java
@@ -46,6 +46,7 @@ public class ShadowDrawable extends Drawable {
private final ShadowDrawableState mState;
+ @SuppressWarnings("unused")
public ShadowDrawable() {
this(new ShadowDrawableState());
}
@@ -98,17 +99,6 @@ public class ShadowDrawable extends Drawable {
return mState.mIntrinsicWidth;
}
- /**
- * Sets the color for the generated shadow
- */
- public void setShadowColor(int color) {
- if (mState.mShadowColor != color) {
- mState.mShadowColor = color;
- mState.mLastDrawnBitmap = null;
- invalidateSelf();
- }
- }
-
private void regenerateBitmapCache() {
Bitmap bitmap = Bitmap.createBitmap(mState.mIntrinsicWidth, mState.mIntrinsicHeight,
Bitmap.Config.ARGB_8888);
@@ -154,7 +144,8 @@ public class ShadowDrawable extends Drawable {
}
mState.mShadowColor = a.getColor(
R.styleable.ShadowDrawable_android_shadowColor, Color.BLACK);
- mState.mShadowSize = r.getDimensionPixelSize(R.dimen.drawable_shadow_size);
+ mState.mShadowSize = a.getDimensionPixelSize(
+ R.styleable.ShadowDrawable_android_elevation, 0);
mState.mIntrinsicHeight = d.getIntrinsicHeight() + 2 * mState.mShadowSize;
mState.mIntrinsicWidth = d.getIntrinsicWidth() + 2 * mState.mShadowSize;