summaryrefslogtreecommitdiffstats
path: root/graphics/java
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2011-04-26 11:50:17 -0700
committerRomain Guy <romainguy@google.com>2011-04-26 11:50:17 -0700
commite1c6ff4b91072a4071589938c74dd65d66f88fb5 (patch)
treee2b743c63224a4038bbb1d598728680fffba8a0d /graphics/java
parentee6d5cfdff475f6c1119f060b139bdc1b621fa8b (diff)
downloadframeworks_base-e1c6ff4b91072a4071589938c74dd65d66f88fb5.zip
frameworks_base-e1c6ff4b91072a4071589938c74dd65d66f88fb5.tar.gz
frameworks_base-e1c6ff4b91072a4071589938c74dd65d66f88fb5.tar.bz2
Make setGradientCenter/Radius work.
The previous implementation would not rebuild the gradient shader when programmatically changing the shader's properties. Also fixes the documentation since the gradient center does affect linear gradients. Change-Id: I5387188484b862f6835b0da9042b25032e55e792
Diffstat (limited to 'graphics/java')
-rw-r--r--graphics/java/android/graphics/drawable/GradientDrawable.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/drawable/GradientDrawable.java b/graphics/java/android/graphics/drawable/GradientDrawable.java
index 7adea06..de0fabc 100644
--- a/graphics/java/android/graphics/drawable/GradientDrawable.java
+++ b/graphics/java/android/graphics/drawable/GradientDrawable.java
@@ -240,16 +240,19 @@ public class GradientDrawable extends Drawable {
public void setGradientCenter(float x, float y) {
mGradientState.setGradientCenter(x, y);
+ mRectIsDirty = true;
invalidateSelf();
}
public void setGradientRadius(float gradientRadius) {
mGradientState.setGradientRadius(gradientRadius);
+ mRectIsDirty = true;
invalidateSelf();
}
public void setUseLevel(boolean useLevel) {
mGradientState.mUseLevel = useLevel;
+ mRectIsDirty = true;
invalidateSelf();
}