vsvydenko
vsvydenko

Reputation: 727

ProgressBar: indeterminate + show progress (like google play store)

want to use progressbar like google play store.

Firstly it (progressbar) is indeterminate -- it displayed as a constantly moving loading. And then it shows progress - from 0 to 100

In my case bar shows only indeterminate or progress - depends of xml-config. Any suggestion?

My progressbar: here bar shows moving loading for short time period. When downloading starts progressbar is gone by themself. Without android:indeterminate="true" no indeterminate and bar shows only progress. Progress I change by progress.setProgress((int) _self.currentProgress);

<ProgressBar
                android:id="@+id/progress"
                android:indeterminate="true"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginTop="5dip"
                style="@style/ProgressBarHoloHorizontal"/>

Style:

<style name="ProgressBarHoloHorizontal">
    <item name="android:indeterminateOnly">false</item>
    <item name="android:indeterminateDrawable">@drawable/progress_indeterminate_horizontal_holo</item>
    <item name="android:minHeight">16dip</item>
    <item name="android:maxHeight">16dip</item>
    <item name="android:progressDrawable">@drawable/progress_horizontal_holo_light</item>
</style>

Upvotes: 3

Views: 3599

Answers (1)

Alex Bettadapur
Alex Bettadapur

Reputation: 118

Use this

progress.setIndeterminate(false);

to change from indeterminate to a determinate progress bar

Upvotes: 2

Related Questions