Skip to content

Commit 0e3984b

Browse files
Romain GuyAndroid (Google) Code Review
authored andcommitted
Merge "Bring back Netflix progress bar Bug #7274157" into jb-mr1-dev
2 parents 4253abb + 41c769d commit 0e3984b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

graphics/java/android/graphics/drawable/GradientDrawable.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,9 @@ of the fill (if any) without worrying about blending artifacts.
478478
mFillPaint.setAlpha(currFillAlpha);
479479
mFillPaint.setDither(mDither);
480480
mFillPaint.setColorFilter(mColorFilter);
481+
if (mColorFilter != null && !mGradientState.mHasSolidColor) {
482+
mFillPaint.setColor(0xff000000);
483+
}
481484
if (haveStroke) {
482485
mStrokePaint.setAlpha(currStrokeAlpha);
483486
mStrokePaint.setDither(mDither);
@@ -739,6 +742,9 @@ private boolean ensureValidRect() {
739742

740743
mFillPaint.setShader(new LinearGradient(x0, y0, x1, y1,
741744
colors, st.mPositions, Shader.TileMode.CLAMP));
745+
if (!mGradientState.mHasSolidColor) {
746+
mFillPaint.setColor(0xff000000);
747+
}
742748
} else if (st.mGradient == RADIAL_GRADIENT) {
743749
x0 = r.left + (r.right - r.left) * st.mCenterX;
744750
y0 = r.top + (r.bottom - r.top) * st.mCenterY;
@@ -748,6 +754,9 @@ private boolean ensureValidRect() {
748754
mFillPaint.setShader(new RadialGradient(x0, y0,
749755
level * st.mGradientRadius, colors, null,
750756
Shader.TileMode.CLAMP));
757+
if (!mGradientState.mHasSolidColor) {
758+
mFillPaint.setColor(0xff000000);
759+
}
751760
} else if (st.mGradient == SWEEP_GRADIENT) {
752761
x0 = r.left + (r.right - r.left) * st.mCenterX;
753762
y0 = r.top + (r.bottom - r.top) * st.mCenterY;
@@ -778,6 +787,9 @@ private boolean ensureValidRect() {
778787

779788
}
780789
mFillPaint.setShader(new SweepGradient(x0, y0, tempColors, tempPositions));
790+
if (!mGradientState.mHasSolidColor) {
791+
mFillPaint.setColor(0xff000000);
792+
}
781793
}
782794
}
783795
}

0 commit comments

Comments
 (0)