Loading core/java/android/view/View.java +1 −0 Original line number Diff line number Diff line Loading @@ -11364,6 +11364,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, resolveLayoutParams(); resolveTextDirection(); resolveTextAlignment(); resolveDrawables(); } /** Loading core/java/android/widget/AbsSeekBar.java +30 −8 Original line number Diff line number Diff line Loading @@ -107,6 +107,9 @@ public abstract class AbsSeekBar extends ProgressBar { } if (thumb != null) { thumb.setCallback(this); if (canResolveLayoutDirection()) { thumb.setLayoutDirection(getResolvedLayoutDirection()); } // Assuming the thumb drawable is symmetric, set the thumb offset // such that the thumb will hang halfway off either edge of the Loading Loading @@ -304,6 +307,15 @@ public abstract class AbsSeekBar extends ProgressBar { thumb.setBounds(thumbPos, topBound, thumbPos + thumbWidth, bottomBound); } @Override public void onResolveDrawables(int layoutDirection) { super.onResolveDrawables(layoutDirection); if (mThumb != null) { mThumb.setLayoutDirection(layoutDirection); } } @Override protected synchronized void onDraw(Canvas canvas) { super.onDraw(canvas); Loading Loading @@ -409,6 +421,16 @@ public abstract class AbsSeekBar extends ProgressBar { int x = (int)event.getX(); float scale; float progress = 0; if (isLayoutRtl()) { if (x > width - mPaddingRight) { scale = 0.0f; } else if (x < mPaddingLeft) { scale = 1.0f; } else { scale = (float)(available - x + mPaddingLeft) / (float)available; progress = mTouchProgressOffset; } } else { if (x < mPaddingLeft) { scale = 0.0f; } else if (x > width - mPaddingRight) { Loading @@ -417,7 +439,7 @@ public abstract class AbsSeekBar extends ProgressBar { scale = (float)(x - mPaddingLeft) / (float)available; progress = mTouchProgressOffset; } } final int max = getMax(); progress += scale * max; Loading core/java/android/widget/ProgressBar.java +22 −3 Original line number Diff line number Diff line Loading @@ -478,8 +478,8 @@ public class ProgressBar extends View { d.setCallback(this); } mIndeterminateDrawable = d; if (mIndeterminateDrawable != null) { mIndeterminateDrawable.setLayoutDirection(getLayoutDirection()); if (mIndeterminateDrawable != null && canResolveLayoutDirection()) { mIndeterminateDrawable.setLayoutDirection(getResolvedLayoutDirection()); } if (mIndeterminate) { mCurrentDrawable = d; Loading Loading @@ -520,7 +520,9 @@ public class ProgressBar extends View { if (d != null) { d.setCallback(this); d.setLayoutDirection(getLayoutDirection()); if (canResolveLayoutDirection()) { d.setLayoutDirection(getResolvedLayoutDirection()); } // Make sure the ProgressBar is always tall enough int drawableHeight = d.getMinimumHeight(); Loading Loading @@ -563,6 +565,20 @@ public class ProgressBar extends View { if (mIndeterminateDrawable != null) mIndeterminateDrawable.jumpToCurrentState(); } @Override public void onResolveDrawables(int layoutDirection) { final Drawable d = mCurrentDrawable; if (d != null) { d.setLayoutDirection(layoutDirection); } if (mIndeterminateDrawable != null) { mIndeterminateDrawable.setLayoutDirection(layoutDirection); } if (mProgressDrawable != null) { mProgressDrawable.setLayoutDirection(layoutDirection); } } @Override public void postInvalidate() { if (!mNoInvalidate) { Loading Loading @@ -652,6 +668,9 @@ public class ProgressBar extends View { if (d instanceof LayerDrawable) { progressDrawable = ((LayerDrawable) d).findDrawableByLayerId(id); if (progressDrawable != null && canResolveLayoutDirection()) { progressDrawable.setLayoutDirection(getResolvedLayoutDirection()); } } final int level = (int) (scale * MAX_LEVEL); Loading core/java/android/widget/TextView.java +0 −3 Original line number Diff line number Diff line Loading @@ -4463,9 +4463,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener mTemporaryDetach = false; // Resolve drawables as the layout direction has been resolved resolveDrawables(); if (mEditor != null) mEditor.onAttachedToWindow(); } Loading core/res/res/drawable/progress_horizontal_holo_dark.xml +2 −0 Original line number Diff line number Diff line Loading @@ -21,11 +21,13 @@ <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> Loading Loading
core/java/android/view/View.java +1 −0 Original line number Diff line number Diff line Loading @@ -11364,6 +11364,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, resolveLayoutParams(); resolveTextDirection(); resolveTextAlignment(); resolveDrawables(); } /** Loading
core/java/android/widget/AbsSeekBar.java +30 −8 Original line number Diff line number Diff line Loading @@ -107,6 +107,9 @@ public abstract class AbsSeekBar extends ProgressBar { } if (thumb != null) { thumb.setCallback(this); if (canResolveLayoutDirection()) { thumb.setLayoutDirection(getResolvedLayoutDirection()); } // Assuming the thumb drawable is symmetric, set the thumb offset // such that the thumb will hang halfway off either edge of the Loading Loading @@ -304,6 +307,15 @@ public abstract class AbsSeekBar extends ProgressBar { thumb.setBounds(thumbPos, topBound, thumbPos + thumbWidth, bottomBound); } @Override public void onResolveDrawables(int layoutDirection) { super.onResolveDrawables(layoutDirection); if (mThumb != null) { mThumb.setLayoutDirection(layoutDirection); } } @Override protected synchronized void onDraw(Canvas canvas) { super.onDraw(canvas); Loading Loading @@ -409,6 +421,16 @@ public abstract class AbsSeekBar extends ProgressBar { int x = (int)event.getX(); float scale; float progress = 0; if (isLayoutRtl()) { if (x > width - mPaddingRight) { scale = 0.0f; } else if (x < mPaddingLeft) { scale = 1.0f; } else { scale = (float)(available - x + mPaddingLeft) / (float)available; progress = mTouchProgressOffset; } } else { if (x < mPaddingLeft) { scale = 0.0f; } else if (x > width - mPaddingRight) { Loading @@ -417,7 +439,7 @@ public abstract class AbsSeekBar extends ProgressBar { scale = (float)(x - mPaddingLeft) / (float)available; progress = mTouchProgressOffset; } } final int max = getMax(); progress += scale * max; Loading
core/java/android/widget/ProgressBar.java +22 −3 Original line number Diff line number Diff line Loading @@ -478,8 +478,8 @@ public class ProgressBar extends View { d.setCallback(this); } mIndeterminateDrawable = d; if (mIndeterminateDrawable != null) { mIndeterminateDrawable.setLayoutDirection(getLayoutDirection()); if (mIndeterminateDrawable != null && canResolveLayoutDirection()) { mIndeterminateDrawable.setLayoutDirection(getResolvedLayoutDirection()); } if (mIndeterminate) { mCurrentDrawable = d; Loading Loading @@ -520,7 +520,9 @@ public class ProgressBar extends View { if (d != null) { d.setCallback(this); d.setLayoutDirection(getLayoutDirection()); if (canResolveLayoutDirection()) { d.setLayoutDirection(getResolvedLayoutDirection()); } // Make sure the ProgressBar is always tall enough int drawableHeight = d.getMinimumHeight(); Loading Loading @@ -563,6 +565,20 @@ public class ProgressBar extends View { if (mIndeterminateDrawable != null) mIndeterminateDrawable.jumpToCurrentState(); } @Override public void onResolveDrawables(int layoutDirection) { final Drawable d = mCurrentDrawable; if (d != null) { d.setLayoutDirection(layoutDirection); } if (mIndeterminateDrawable != null) { mIndeterminateDrawable.setLayoutDirection(layoutDirection); } if (mProgressDrawable != null) { mProgressDrawable.setLayoutDirection(layoutDirection); } } @Override public void postInvalidate() { if (!mNoInvalidate) { Loading Loading @@ -652,6 +668,9 @@ public class ProgressBar extends View { if (d instanceof LayerDrawable) { progressDrawable = ((LayerDrawable) d).findDrawableByLayerId(id); if (progressDrawable != null && canResolveLayoutDirection()) { progressDrawable.setLayoutDirection(getResolvedLayoutDirection()); } } final int level = (int) (scale * MAX_LEVEL); Loading
core/java/android/widget/TextView.java +0 −3 Original line number Diff line number Diff line Loading @@ -4463,9 +4463,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener mTemporaryDetach = false; // Resolve drawables as the layout direction has been resolved resolveDrawables(); if (mEditor != null) mEditor.onAttachedToWindow(); } Loading
core/res/res/drawable/progress_horizontal_holo_dark.xml +2 −0 Original line number Diff line number Diff line Loading @@ -21,11 +21,13 @@ <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> Loading