gosr
gosr

Reputation: 4708

Creating a loading circle/wheel (similar to the one in ProgressDialog, but without the dialog)

As you know, when using a ProgressDialog a "popup"/dialog appears in which a circle/wheel shows the progress.

I am interested in drawing this wheel out from the dialog box, and only displaying this wheel, still indicating progress.

Main reason to want this, is the fact that I have some sort of "intro screen" which will show a logo and this progress wheel just below, which indicates that the application is loading various content.

This is (or could be) the wheel in question:

wheel

It wouldn't hurt if the wheel could be smaller than it appears in a regular ProgressDialog.

(I'm using AsyncTask to load the content while this wheel is displayed.)

Any suggestions?

Upvotes: 0

Views: 939

Answers (2)

Gallal
Gallal

Reputation: 4262

Have you considered using a ProgressBar and setting setIndeterminate(true);

Upvotes: 0

Jason Knight
Jason Knight

Reputation: 5834

You can use the pre-defined style Android provides for an indeterminate ProgressBar, like this:

<ProgressBar
    style="?android:attr/progressBarStyle"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
/>

If you want it to be smaller, use the progressBarStyleSmall style instead.

From here you can set the visibility of the ProgressBar to make it appear/disappear whenever you want.

Upvotes: 2

Related Questions