Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32ceee97 authored by Fabrice Di Meglio's avatar Fabrice Di Meglio Committed by Android Git Automerger
Browse files

am f8ce2b94: Merge "Fix progress bar and spinner in RTL mode"

# Via Android (Google) Code Review (1) and Fabrice Di Meglio (1)
* commit 'f8ce2b94':
  Fix progress bar and spinner in RTL mode
parents c6e97f55 f8ce2b94
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -728,6 +728,7 @@ package android {
    field public static final int minSdkVersion = 16843276; // 0x101020c
    field public static final int minWidth = 16843071; // 0x101013f
    field public static final int mipMap = 16843725; // 0x10103cd
    field public static final int mirrorForRtl = 16843726; // 0x10103ce
    field public static final int mode = 16843134; // 0x101017e
    field public static final int moreIcon = 16843061; // 0x1010135
    field public static final int multiprocess = 16842771; // 0x1010013
+2 −2
Original line number Diff line number Diff line
@@ -305,7 +305,7 @@ public abstract class AbsSeekBar extends ProgressBar {
        }
        
        // Canvas will be translated, so 0,0 is where we start drawing
        final int left = isLayoutRtl() ? available - thumbPos : thumbPos;
        final int left = (isLayoutRtl() && mMirrorForRtl) ? available - thumbPos : thumbPos;
        thumb.setBounds(left, topBound, left + thumbWidth, bottomBound);
    }

@@ -426,7 +426,7 @@ public abstract class AbsSeekBar extends ProgressBar {
        int x = (int)event.getX();
        float scale;
        float progress = 0;
        if (isLayoutRtl()) {
        if (isLayoutRtl() && mMirrorForRtl) {
            if (x > width - mPaddingRight) {
                scale = 0.0f;
            } else if (x < mPaddingLeft) {
+6 −2
Original line number Diff line number Diff line
@@ -223,6 +223,8 @@ public class ProgressBar extends View {
    private boolean mAttached;
    private boolean mRefreshIsPosted;

    boolean mMirrorForRtl = false;

    private final ArrayList<RefreshData> mRefreshData = new ArrayList<RefreshData>();

    private AccessibilityEventSender mAccessibilityEventSender;
@@ -302,6 +304,8 @@ public class ProgressBar extends View {
        setIndeterminate(mOnlyIndeterminate || a.getBoolean(
                R.styleable.ProgressBar_indeterminate, mIndeterminate));

        mMirrorForRtl = a.getBoolean(R.styleable.ProgressBar_mirrorForRtl, mMirrorForRtl);

        a.recycle();
    }

@@ -1004,7 +1008,7 @@ public class ProgressBar extends View {
                    }
                }
            }
            if (isLayoutRtl()) {
            if (isLayoutRtl() && mMirrorForRtl) {
                int tempLeft = left;
                left = w - right;
                right = w - tempLeft;
@@ -1026,7 +1030,7 @@ public class ProgressBar extends View {
            // Translate canvas so a indeterminate circular progress bar with padding
            // rotates properly in its animation
            canvas.save();
            if(isLayoutRtl()) {
            if(isLayoutRtl() && mMirrorForRtl) {
                canvas.translate(getWidth() - mPaddingRight, mPaddingTop);
                canvas.scale(-1.0f, 1.0f);
            } else {
+3 −0
Original line number Diff line number Diff line
@@ -2962,6 +2962,9 @@
        <!-- Timeout between frames of animation in milliseconds
             {@deprecated Not used by the framework.} -->
        <attr name="animationResolution" format="integer" />
        <!-- Defines if the associated drawables need to be mirrored when in RTL mode.
             Default is false -->
        <attr name="mirrorForRtl" format="boolean" />
    </declare-styleable>

    <declare-styleable name="SeekBar">
+1 −0
Original line number Diff line number Diff line
@@ -2034,5 +2034,6 @@
  <eat-comment />

  <public type="attr" name="mipMap" id="0x010103cd" />
  <public type="attr" name="mirrorForRtl" id="0x010103ce" />

</resources>
Loading