Merge "Fix bug #7158772 ProgressBar / SeekBar / RatingBar drawables should be reversed when in RTL mode" into jb-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e8e98704f3
@@ -354,7 +354,7 @@ public class ProgressBar extends View {
|
||||
Shader.TileMode.REPEAT, Shader.TileMode.CLAMP);
|
||||
shapeDrawable.getPaint().setShader(bitmapShader);
|
||||
|
||||
return (clip) ? new ClipDrawable(shapeDrawable, Gravity.START,
|
||||
return (clip) ? new ClipDrawable(shapeDrawable, Gravity.LEFT,
|
||||
ClipDrawable.HORIZONTAL) : shapeDrawable;
|
||||
}
|
||||
|
||||
@@ -1040,6 +1040,11 @@ public class ProgressBar extends View {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isLayoutRtl()) {
|
||||
int tempLeft = left;
|
||||
left = w - right;
|
||||
right = w - tempLeft;
|
||||
}
|
||||
mIndeterminateDrawable.setBounds(left, top, right, bottom);
|
||||
}
|
||||
|
||||
@@ -1057,7 +1062,12 @@ public class ProgressBar extends View {
|
||||
// Translate canvas so a indeterminate circular progress bar with padding
|
||||
// rotates properly in its animation
|
||||
canvas.save();
|
||||
canvas.translate(mPaddingLeft, mPaddingTop);
|
||||
if(isLayoutRtl()) {
|
||||
canvas.translate(getWidth() - mPaddingRight, mPaddingTop);
|
||||
canvas.scale(-1.0f, 1.0f);
|
||||
} else {
|
||||
canvas.translate(mPaddingLeft, mPaddingTop);
|
||||
}
|
||||
long time = getDrawingTime();
|
||||
if (mHasAnimation) {
|
||||
mAnimation.getTransformation(time, mTransformation);
|
||||
|
||||
@@ -21,13 +21,11 @@
|
||||
|
||||
<item android:id="@android:id/secondaryProgress">
|
||||
<scale android:scaleWidth="100%"
|
||||
android:scaleGravity="start"
|
||||
android:drawable="@android:drawable/progress_secondary_holo_dark" />
|
||||
</item>
|
||||
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%"
|
||||
android:scaleGravity="start"
|
||||
android:drawable="@android:drawable/progress_primary_holo_dark" />
|
||||
</item>
|
||||
|
||||
|
||||
@@ -21,13 +21,11 @@
|
||||
|
||||
<item android:id="@android:id/secondaryProgress">
|
||||
<scale android:scaleWidth="100%"
|
||||
android:scaleGravity="start"
|
||||
android:drawable="@android:drawable/progress_secondary_holo_light" />
|
||||
</item>
|
||||
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%"
|
||||
android:scaleGravity="start"
|
||||
android:drawable="@android:drawable/progress_primary_holo_light" />
|
||||
</item>
|
||||
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
android:drawable="@android:drawable/scrubber_track_holo_dark" />
|
||||
<item android:id="@android:id/secondaryProgress">
|
||||
<scale android:scaleWidth="100%"
|
||||
android:scaleGravity="start"
|
||||
android:drawable="@android:drawable/scrubber_secondary_holo" />
|
||||
</item>
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%"
|
||||
android:scaleGravity="start"
|
||||
android:drawable="@android:drawable/scrubber_primary_holo" />
|
||||
</item>
|
||||
</layer-list>
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
android:drawable="@android:drawable/scrubber_track_holo_light" />
|
||||
<item android:id="@android:id/secondaryProgress">
|
||||
<scale android:scaleWidth="100%"
|
||||
android:scaleGravity="start"
|
||||
android:drawable="@android:drawable/scrubber_secondary_holo" />
|
||||
</item>
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%"
|
||||
android:scaleGravity="start"
|
||||
android:drawable="@android:drawable/scrubber_primary_holo" />
|
||||
</item>
|
||||
</layer-list>
|
||||
|
||||
Reference in New Issue
Block a user