I've tried to show an indeterminate activity circle like this one:
Here's the layout code:
<ProgressBar
android:id="@+id/progress"
style="@style/GenericProgressIndicator"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="center_vertical|center_horizontal"
android:visibility="gone" />
Here's the styling code:
<style name="GenericProgressIndicator" parent="@android:style/Widget.ProgressBar.Large">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:indeterminate">true</item>
</style>
My circle doesn't look anything like the Holo themed circle that you see in the Gmail App or the Play app. What am I doing wrong? How can I get the nice Holo animated activity circle?
This really wasn't documented anywhere and I found it through some random article. Adding this styling attribute does the trick:
style="?android:attr/progressBarStyleLarge"
The only reference to this on the developer documentation is here.
Your first layout was right but you chose the wrong style. The right one is:
style="@android:style/Widget.Holo.Light.ProgressBar.Large"
What version of Android are you using? If you're not using a version with Holo, you won't be able to display things using the Holo style. A solution to that is to use a library like ActionBarSherlock, which backports the Holo theme to previous Android versions.
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