Seven styles of Android progress bar
When an application is executed in the background, there will be no information on the foreground interface. At this time, the user does not know whether the program is executing, how the execution progress is, whether the application encounters error termination, etc. at this time, the progress bar needs to be used to prompt the user about the execution progress of the background program. Android system provides two types of progress bar styles: progress bar style horizontal and progress bar style large. Progress bars are useful. For example, when an application loads resources and network connections, you can prompt the user to wait. This kind of progress bar only represents the execution of a part of the application, while the execution of the whole application can display a progress bar through the application title bar, which requires setting the display style of the window first "requestWindowFeature(Window.FEATURE_PROGRESS)"。
First look at the following renderings:
Example 1: (default style (medium circle))
XML code
Example 2: (oversized circle)
Example 1: (default style (medium circle))
XML code
Example 2: (oversized circle)
XML code
Example 3: (small round)
XML code
Example 4: (Title small round)
XML code
Example 4 - use code of small circle in Title:
Java code
Example 5: (rectangular progress bar)
XML code
Example 5 - Code for using rectangular progress bar in Title:
Java code
Example 6: (progress dialog box - circular progress bar)
Java code
Example 7: (progress dialog box - Rectangular progress bar)
Java code
This article introduces seven styles of Android progress bar. I hope you like it.