Note: This only works from Android 5.0 (Lollipop) and up, as per the original request. For older Android versions you’ll have to replace the ProgressBar’s progressDrawable.
Expanding upon Liam’s answer, I managed to get this working on XML using the indeterminateTint flag.
Apparently to get it to work, you need to set the indeterminate and indeterminateTintMode flags.
The mode is a bit of mystery for me. I tried all of them but only got the expected results with src_in and src_atop. I don’t know what those modes actually do, so if anyone can expand on this I’d be grateful.
In any case this should work:
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true"
android:indeterminateTint="#F00"
android:indeterminateTintMode="src_in" />