summaryrefslogtreecommitdiffstats
path: root/graphics/java
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-08-13 19:39:53 -0700
committerRomain Guy <romainguy@google.com>2010-08-13 19:41:14 -0700
commit1e45aae5de003657e5d18f74d34998f5de5db5b7 (patch)
tree355320038d0de8ed9b39c0cd3d3865b7fbbae1fd /graphics/java
parent029a74a38b56b97cbfe02b3d8e23536cea71609d (diff)
downloadframeworks_base-1e45aae5de003657e5d18f74d34998f5de5db5b7.zip
frameworks_base-1e45aae5de003657e5d18f74d34998f5de5db5b7.tar.gz
frameworks_base-1e45aae5de003657e5d18f74d34998f5de5db5b7.tar.bz2
Add drop shadows.
Change-Id: Ic6a72409d4785968d1fbdff229f17ee5c00b240b
Diffstat (limited to 'graphics/java')
-rw-r--r--graphics/java/android/graphics/Paint.java36
1 files changed, 34 insertions, 2 deletions
diff --git a/graphics/java/android/graphics/Paint.java b/graphics/java/android/graphics/Paint.java
index 6349cb3..62fbfb4 100644
--- a/graphics/java/android/graphics/Paint.java
+++ b/graphics/java/android/graphics/Paint.java
@@ -43,6 +43,28 @@ public class Paint {
private boolean mHasCompatScaling;
private float mCompatScaling;
private float mInvCompatScaling;
+
+ /**
+ * @hide
+ */
+ public boolean hasShadow;
+ /**
+ * @hide
+ */
+ public float shadowDx;
+ /**
+ * @hide
+ */
+ public float shadowDy;
+ /**
+ * @hide
+ */
+ public float shadowRadius;
+ /**
+ * @hide
+ */
+ public int shadowColor;
+
/**
* @hide
*/
@@ -935,13 +957,23 @@ public class Paint {
* offset and color, and blur radius. If radius is 0, then the shadow
* layer is removed.
*/
- public native void setShadowLayer(float radius, float dx, float dy, int color);
+ public void setShadowLayer(float radius, float dx, float dy, int color) {
+ hasShadow = radius > 0.0f;
+ shadowRadius = radius;
+ shadowDx = dx;
+ shadowDy = dy;
+ shadowColor = color;
+ nSetShadowLayer(radius, dx, dy, color);
+ }
+
+ private native void nSetShadowLayer(float radius, float dx, float dy, int color);
/**
* Clear the shadow layer.
*/
public void clearShadowLayer() {
- setShadowLayer(0, 0, 0, 0);
+ hasShadow = false;
+ nSetShadowLayer(0, 0, 0, 0);
}
/**