Jasper
Jasper

Reputation: 8705

Android: Spinning ProgressDialog - How?

Using following code:

ProgressDialog pd = new ProgressDialog(activity);
pd.setProgressStyle(ProgressDialog.STYLE_SPINNER);
pd.show();

This shows spinning progress wheel, but it has a rectangle with white spaces on both sides.

I only need the spinning wheel, nothing else. And also possibly style it better.

Upvotes: 0

Views: 1291

Answers (1)

Grender
Grender

Reputation: 1619

Change ProgressDialog to ProgressBar and put it in the layout where you want to have it:

<ProgressBar
    android:id="@+id/spinningProgressBar"
    style="?android:attr/progressBarStyleLarge"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:visibility="gone" >
</ProgressBar>

Set the visibility as you wish in your activity / fragment.

Upvotes: 1

Related Questions