By default the ProgressBar has a certain padding above and below the bar itself. Is there a way to remove this padding so as to only have the bar in the end?
I ended up using a custom library to solve this issue. Most of the other solutions work but the results are not consistent across various devices.
MaterialProgressBar
- Consistent appearance on Android 4.0+.
- Correct tinting across platforms.
- Able to remove the intrinsic padding of framework ProgressBar.
- Able to hide the track of framework horizontal ProgressBar.
- Used as a drop-in replacement for framework ProgressBar.
To add as a gradle dependency:
compile 'me.zhanghai.android.materialprogressbar:library:1.1.7'
To add a ProgressBar with no intrinsic padding to your layout:
app:mpb_useIntrinsicPadding="false" does the trick. For more details see the GitHub page.