Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Horizontal progress bar width in actionbar

I'm displaying an horizontal progress bar in my action bar. My problem is the progress bar width is not the action bar width, but smaller (but centered). Is that a normal behavior? How can I give it the screen width?

I'm using this in onCreate

    requestWindowFeature(Window.FEATURE_PROGRESS);

and this in my methods

public void setShowIndeterminateProgress(boolean val) {
    setProgressBarIndeterminate(true);
    setProgressBarVisibility(val);
}

Thanks in advance.

like image 448
riot Avatar asked Apr 11 '13 15:04

riot


1 Answers

There is an attribute android:progressBarPadding in the action bar style. Set it to 0dip.

<style name="MyActionBar" parent="@android:style/Widget.Holo.ActionBar">
    <item name="android:progressBarPadding">0dip</item>
</style>
like image 167
Matthias Robbers Avatar answered Oct 22 '22 23:10

Matthias Robbers