summaryrefslogtreecommitdiffstats
path: root/graphics/java
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2013-11-14 17:21:47 -0800
committerAlan Viverette <alanv@google.com>2013-11-14 17:21:47 -0800
commit616dd4780fb515c596f2764f7e35a30401f7b063 (patch)
treebf9a4f32cae994050ef8448354322cbb1cb8637a /graphics/java
parente5d2af6be21a5b9b09667be2597cf1bc4b7a4a1e (diff)
downloadframeworks_base-616dd4780fb515c596f2764f7e35a30401f7b063.zip
frameworks_base-616dd4780fb515c596f2764f7e35a30401f7b063.tar.gz
frameworks_base-616dd4780fb515c596f2764f7e35a30401f7b063.tar.bz2
Use correct state list for obtaining stroke color
BUG: 11696411 Change-Id: Ia9ad70cbceae18923fc79db8f07223fb0d41ae81
Diffstat (limited to 'graphics/java')
-rw-r--r--graphics/java/android/graphics/drawable/GradientDrawable.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/graphics/java/android/graphics/drawable/GradientDrawable.java b/graphics/java/android/graphics/drawable/GradientDrawable.java
index e51dfbc..ba4698c 100644
--- a/graphics/java/android/graphics/drawable/GradientDrawable.java
+++ b/graphics/java/android/graphics/drawable/GradientDrawable.java
@@ -702,17 +702,20 @@ public class GradientDrawable extends Drawable {
final int oldColor = mFillPaint.getColor();
if (oldColor != newColor) {
mFillPaint.setColor(newColor);
- invalidateSelf |= true;
+ invalidateSelf = true;
}
}
- final ColorStateList strokeStateList = s.mStrokeColorStateList;
- if (strokeStateList != null) {
- final int newColor = stateList.getColorForState(stateSet, 0);
- final int oldColor = mStrokePaint.getColor();
- if (oldColor != newColor) {
- mStrokePaint.setColor(newColor);
- invalidateSelf |= true;
+ final Paint strokePaint = mStrokePaint;
+ if (strokePaint != null) {
+ final ColorStateList strokeStateList = s.mStrokeColorStateList;
+ if (strokeStateList != null) {
+ final int newStrokeColor = strokeStateList.getColorForState(stateSet, 0);
+ final int oldStrokeColor = strokePaint.getColor();
+ if (oldStrokeColor != newStrokeColor) {
+ strokePaint.setColor(newStrokeColor);
+ invalidateSelf = true;
+ }
}
}