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
  • 40,997
  • 14
  • 121
  • 129
Saman Miran
  • 424
  • 1
  • 6
  • 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
  • 27,481
  • 8
  • 94
  • 152
Krishna
  • 1,556
  • 13
  • 21
  • 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,161
  • 4
  • 31
  • 54