Does anyone know how to make a View reversed, I have a horizontal ProgressBar and I want it to right to left instead of left to right
You don't need to rotate the entire View.
Just use a single xml attribute in your my_progress_drawable.xml:
-
The documentation tells us that gravity="right" does this:
Put the object at the right edge of its container, not changing its size. When clipOrientation is "horizontal", clipping occurs at the left side of the drawable.
Don't override onDraw(). This implementation is more stable across different versions of Android.
Unfortunately, it's impossible to set the gravity of a ClipDrawable programmatically without invoking its constructor.