2

I am using the Widget.Holo.Light.ProgressBar.Horizontal ProgressBar and I want to keep it like that, but right-to-left.

so at 0% it's on the right and goes to the left as it progresses.

any help?

gustavohenke
  • 39,785
  • 13
  • 117
  • 123
Saman Miran
  • 394
  • 1
  • 4
  • 14

2 Answers2

3

Use android:layoutDirection="rtl" in progress bar:

<ProgressBar
    style="?android:attr/progressBarStyleHorizontal"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:max="100"
    android:layout_margin="8dp"
    android:layoutDirection="rtl"
    android:progress="80" />
LarsH
  • 26,606
  • 8
  • 88
  • 145
Krishna
  • 1,386
  • 12
  • 19
  • While this code may answer the question, providing additional context regarding how and/or why it solves the problem would improve the answer's long-term value. – Donald Duck Jan 11 '17 at 12:40
1

Start the progress at 100% and simply decrement instead of incrementing.

x.setProgress(100);
x.setProgress(85);
etc
Broak
  • 4,106
  • 4
  • 29
  • 54