summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2012-10-02 16:04:05 -0700
committerRomain Guy <romainguy@google.com>2012-10-02 16:04:05 -0700
commit41c769d9a8858ad20b0a6ed942a1cea19ba59d2d (patch)
tree90ec94f1ef92f67bf5b60d08c557816f62e0d1c1 /graphics
parentcf8675ee176a375f873792684d38a47f78348dff (diff)
downloadframeworks_base-41c769d9a8858ad20b0a6ed942a1cea19ba59d2d.zip
frameworks_base-41c769d9a8858ad20b0a6ed942a1cea19ba59d2d.tar.gz
frameworks_base-41c769d9a8858ad20b0a6ed942a1cea19ba59d2d.tar.bz2
Bring back Netflix progress bar
Bug #7274157 Gradients and color filters are multiplied by the paint's color so it needs to be set to opaque black to have an effect. Change-Id: Ib5dd1e6185f758f55b57a0f4496dfae98f1a096b
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/graphics/drawable/GradientDrawable.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/drawable/GradientDrawable.java b/graphics/java/android/graphics/drawable/GradientDrawable.java
index 22aa29c..8374b10 100644
--- a/graphics/java/android/graphics/drawable/GradientDrawable.java
+++ b/graphics/java/android/graphics/drawable/GradientDrawable.java
@@ -478,6 +478,9 @@ public class GradientDrawable extends Drawable {
mFillPaint.setAlpha(currFillAlpha);
mFillPaint.setDither(mDither);
mFillPaint.setColorFilter(mColorFilter);
+ if (mColorFilter != null && !mGradientState.mHasSolidColor) {
+ mFillPaint.setColor(0xff000000);
+ }
if (haveStroke) {
mStrokePaint.setAlpha(currStrokeAlpha);
mStrokePaint.setDither(mDither);
@@ -739,6 +742,9 @@ public class GradientDrawable extends Drawable {
mFillPaint.setShader(new LinearGradient(x0, y0, x1, y1,
colors, st.mPositions, Shader.TileMode.CLAMP));
+ if (!mGradientState.mHasSolidColor) {
+ mFillPaint.setColor(0xff000000);
+ }
} else if (st.mGradient == RADIAL_GRADIENT) {
x0 = r.left + (r.right - r.left) * st.mCenterX;
y0 = r.top + (r.bottom - r.top) * st.mCenterY;
@@ -748,6 +754,9 @@ public class GradientDrawable extends Drawable {
mFillPaint.setShader(new RadialGradient(x0, y0,
level * st.mGradientRadius, colors, null,
Shader.TileMode.CLAMP));
+ if (!mGradientState.mHasSolidColor) {
+ mFillPaint.setColor(0xff000000);
+ }
} else if (st.mGradient == SWEEP_GRADIENT) {
x0 = r.left + (r.right - r.left) * st.mCenterX;
y0 = r.top + (r.bottom - r.top) * st.mCenterY;
@@ -778,6 +787,9 @@ public class GradientDrawable extends Drawable {
}
mFillPaint.setShader(new SweepGradient(x0, y0, tempColors, tempPositions));
+ if (!mGradientState.mHasSolidColor) {
+ mFillPaint.setColor(0xff000000);
+ }
}
}
}