How to create loading dialogs in Android?
Those dark spinning progr开发者_StackOverflow社区ess dialogs in the Amazon and Engadget apps - are those standard in Android?
It's a ProgressDialog, with setIndeterminate(true).
From http://developer.android.com/guide/topics/ui/dialogs.html#ProgressDialog
ProgressDialog dialog = ProgressDialog.show(MyActivity.this, "",
"Loading. Please wait...", true);
An indeterminate progress bar doesn't actually show a bar, it shows a spinning activity circle thing. I'm sure you know what I mean :)
Today things have changed a little.
Now we avoid use ProgressDialog to show spinning progress:
If you want to put in your app a spinning progress you should use an Activity indicators:
http://developer.android.com/design/building-blocks/progress.html#activity
Update
Thay have renamed the component to Progress Indicators now.
The new link for reference is: https://material.io/components/progress-indicators/android
精彩评论