I am adding progress bar to my application AppBarLayout:
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="?attr/appBarLayoutTheme">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="?attr/toolbarPopupTheme"/>
<ProgressBar
style="?android:progressBarStyleHorizontal"
android:id="@+id/progress_loader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="-8dp"
android:indeterminateTint="@color/greyishWhite"
android:layout_marginTop="-9dp"
android:maxWidth="2000dp"
android:indeterminateOnly="true"/>
</android.support.design.widget.AppBarLayout>
Everything looks ok in portrait mode:
But on landscape mode it doesn't take full parent width:
How can I force ProgressBar take full with at all times.
ANSWER:
Thanks @Mahavir Jain for guiding to the right path:
at the end all needed to do was change
android:indeterminateOnly="true"
to
android:indeterminate="true"
Remove below line.
android:indeterminateOnly="true"
android:indeterminateOnly Restricts to ONLY indeterminate mode (state-keeping progress mode will not work).
<ProgressBar
android:id="@+id/progress_loader"
style="?android:progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="-8dp"
android:layout_marginTop="-9dp"
android:indeterminateTint="@color/red"
android:max="100"
android:progress="100"
tools:ignore="UnusedAttribute" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With