Android progress bar --------progressbar

   Looking at the app written by others, the progress bar is quite perfect, and I also want to define a good-looking progress bar. Android has a great advantage, that is, it allows us to toss around at will.

  A few things to know about the progressbar:

1. The progressbar has two progress, one is android:progress, the other is android:secondProgress. The latter is mainly for caching the network cache involved. It is a definite progress.

2. Uncertainty is unclear. It is uncertain how long an operation will take to complete. If there is a network request, we cannot predict how long this network operation will take. At this time, you need to use an indeterminate progress bar. This attribute is controlled by android:indeterminate;

3. The style of the progress bar (whether it is a circle or a rectangle, of course, is determined by style) Set the style of the progress bar through attributes such as style="?android:attr/progressBarstyle"

There are three items in the progressbar source code: background secondProgress progress. You can tell what these three items are for just by looking at the names. In fact, you can modify the shape attributes, rounded corners, gradients, etc. as you like by putting a copy of these two items into your own project. .


4, android:indeterminateDrawable can define a circular progress bar through resource files (can be     changed through anim_list rotate and shape gradient ).





Guess you like

Origin blog.csdn.net/tiandiyinghun/article/details/48575233