{"id":267668,"date":"2015-11-06T19:08:02","date_gmt":"2015-11-06T16:08:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=267668"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=267668","title":{"rendered":"Material ProgressBar \u0434\u043b\u044f pre-Lollipop"},"content":{"rendered":"<p>       \u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438, \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0441 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0440\u0435\u0431\u044f\u0442\u0430\u043c\u0438 \u0432 <a href=\"https:\/\/www.novoda.com\/\">Novoda<\/a> \u043d\u0430\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438 \u0432\u0438\u0434\u0435\u043e \u0434\u043b\u044f \u0442\u0435\u043b\u0435\u0432\u0438\u0434\u0435\u043d\u0438\u044f \u0432 \u0412\u0435\u043b\u0438\u043a\u043e\u0431\u0440\u0438\u0442\u0430\u043d\u0438\u0438 <a href=\"http:\/\/www.channel4.com\/\">Channel 4<\/a>. \u041e\u0434\u0438\u043d \u0438\u0437 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u0438\u0437\u0430\u0439\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0431\u044b\u043b \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 ProgressBar \u0432 \u0441\u0442\u0438\u043b\u0435 Material Design. \u0414\u043b\u044f Android Lollipop \u0438 \u0432\u044b\u0448\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0440\u0443\u0434\u0430, \u043d\u043e \u0432\u043e\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u043d\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u041e\u0421 \u0441\u0442\u0430\u043b\u0430 \u0434\u043b\u044f \u043d\u0430\u0441 \u0438\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u0435\u043c. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 Lollipop \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 <code>ProgressBar<\/code>:<\/p>\n<p>  <iframe loading=\"lazy\" width=\"420\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/y75JWjV8cIQ?feature=oembed\" frameborder=\"0\" allowfullscreen><\/iframe> <\/p>\n<p>  \u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0441\u0442\u0438\u043b\u044c \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c, \u0442\u043e \u043a\u043e\u0440\u0435\u043d\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043b\u0435\u0436\u0430\u043b \u0432 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0441 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c. \u041a\u043e\u0440\u043e\u0442\u043a\u0430\u044f \u043b\u0438\u043d\u0438\u044f \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043b\u0435\u0432\u0430 \u043d\u0430 \u043f\u0440\u0430\u0432\u043e, \u043d\u043e \u0434\u043b\u0438\u043d\u0430 \u0435\u0435 \u0432\u0430\u0440\u044c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u0438\u0438 \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u044f.<a name=\"habracut\"><\/a><\/p>\n<p>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c, \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u0435\u043a\u043f\u043e\u0440\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u041d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0438 \u043a\u043e\u0435-\u043a\u0430\u043a\u0438\u0435 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u0438 \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439, \u0442\u0430\u043a \u043a\u0430\u043a \u0442\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f <code>AnimatedVectorDrawable<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0434\u043e Lollipop. \u0420\u0435\u0448\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u044f \u043d\u0430\u0448\u0435\u043b, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0432\u0430\u0440\u043d\u043e, \u043d\u043e \u0432\u0441\u0435 \u0436\u0435 \u0434\u0430\u043b\u043e \u043c\u043d\u0435 \u043d\u0430 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<p>  \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <code>ProgressBar<\/code> (\u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u043e\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e <code>ProgressBar<\/code>) \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0431\u0445\u043e\u0434\u0438\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0441\u0432\u043e\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u0433\u043e \u0438 \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u0443\u0436\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0432 <code>ProgressBar<\/code>. \u0422\u0440\u044e\u043a \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 \u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u2014 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u0434\u043d\u0438\u0439 \u043f\u043b\u0430\u043d, \u043f\u043e\u0442\u043e\u043c \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u0438 \u0437\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0439. \u0415\u0441\u043b\u0438 \u0437\u0430\u0434\u043d\u0438\u0439 \u043f\u043b\u0430\u043d \u0438 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u043e\u0434\u043d\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430, \u0430 \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430, \u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u044d\u0444\u0444\u0435\u043a\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u0438\u043d\u044b.<\/p>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u043c\u044b \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0446\u0432\u0435\u0442 \u0437\u0430\u0434\u043d\u0435\u0433\u043e \u043f\u043b\u0430\u043d\u0430 \u0441\u0432\u0435\u0442\u043b\u043e-\u0437\u0435\u043b\u0435\u043d\u044b\u043c, \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u0441\u0440\u0435\u0434\u043d\u0435-\u0437\u0435\u043b\u0435\u043d\u044b\u043c, \u0430 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u2014 \u0442\u0435\u043c\u043d\u043e-\u0437\u0435\u043b\u0435\u043d\u044b\u043c, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/85c\/1b8\/b69\/85c1b8b6923cb67603790b6cd14fe647.png\" alt=\"image\"\/><\/p>\n<p>  \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0435\u0441\u043b\u0438 \u043c\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u044b\u0439 \u0446\u0432\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u043a\u0430\u043a \u0438 \u0437\u0430\u0434\u043d\u0438\u0439 \u043f\u043b\u0430\u043d, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043d\u0443\u0436\u043d\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/614\/05c\/1d5\/61405c1d59dbc7cc1500e5d4155c46c5.png\" alt=\"image\"\/><\/p>\n<p>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 secondaryProgress \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 ProgressBar \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0436\u0435 \u043c\u044b \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u0432 \u043a\u043e\u0434\u0435:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">public class MaterialProgressBar extends ProgressBar {     private static final int INDETERMINATE_MAX = 1000;     private static final String SECONDARY_PROGRESS = &quot;secondaryProgress&quot;;     private static final String PROGRESS = &quot;progress&quot;;      private Animator animator = null;      private final int duration;      public MaterialProgressBar(Context context, AttributeSet attrs, int defStyleAttr) {         super(context, attrs, defStyleAttr);          TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.MaterialProgressBar, defStyleAttr, 0);         int backgroundColour;         int progressColour;         try {             backgroundColour = ta.getColor(R.styleable.MaterialProgressBar_backgroundColour, 0);             progressColour = ta.getColor(R.styleable.MaterialProgressBar_progressColour, 0);             int defaultDuration = context.getResources().getInteger(android.R.integer.config_mediumAnimTime);             duration = ta.getInteger(R.styleable.MaterialProgressBar_duration, defaultDuration);         } finally {             ta.recycle();         }         Resources resources = context.getResources();         setProgressDrawable(resources.getDrawable(android.R.drawable.progress_horizontal));         createIndeterminateProgressDrawable(backgroundColour, progressColour);         setMax(INDETERMINATE_MAX);         super.setIndeterminate(false);         this.setIndeterminate(true);     }      private void createIndeterminateProgressDrawable(@ColorInt int backgroundColour, @ColorInt int progressColour) {         LayerDrawable layerDrawable = (LayerDrawable) getProgressDrawable();         if (layerDrawable != null) {             layerDrawable.mutate();             layerDrawable.setDrawableByLayerId(android.R.id.background, createShapeDrawable(backgroundColour));             layerDrawable.setDrawableByLayerId(android.R.id.progress, createClipDrawable(backgroundColour));             layerDrawable.setDrawableByLayerId(android.R.id.secondaryProgress, createClipDrawable(progressColour));         }     }      private Drawable createClipDrawable(@ColorInt int colour) {         ShapeDrawable shapeDrawable = createShapeDrawable(colour);         return new ClipDrawable(shapeDrawable, Gravity.START, ClipDrawable.HORIZONTAL);     }      private ShapeDrawable createShapeDrawable(@ColorInt int colour) {         ShapeDrawable shapeDrawable = new ShapeDrawable();         setColour(shapeDrawable, colour);         return shapeDrawable;     }      private void setColour(ShapeDrawable drawable, int colour) {         Paint paint = drawable.getPaint();         paint.setColor(colour);     }     .     .     . } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u0435\u0442\u043e\u0434 \u0437\u0434\u0435\u0441\u044c \u2014 <code>createIndeterminateProgressDrawable()<\/code> \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u0441\u043b\u043e\u0439 \u0432 <code>LayerDrawable<\/code> (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a <code>ProgressBar<\/code>) \u0441 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438 \u0446\u0432\u0435\u0442\u0430\u043c\u0438.<\/p>\n<p>  \u0415\u0449\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u0436\u0435\u0441\u0442\u043a\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u044d\u0442\u043e, \u043a\u0430\u043a <code>ProgressBar<\/code> \u0441 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u2013 \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0443 \u0438 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e <code>ProgressBar<\/code> \u0432 \u0440\u0435\u0436\u0438\u043c \u0441 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u0435\u0433\u043c\u0435\u043d\u0442, \u043d\u043e \u043a\u0430\u043a \u0435\u0433\u043e \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c? \u042d\u0442\u043e \u043d\u0430 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u043c\u044b \u0430\u043d\u0438\u043c\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u0438 \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c ProgressBar, \u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0440\u0430\u0437\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0442\u043e\u0440\u044b:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">public class MaterialProgressBar extends ProgressBar {     .     .     .     @Override     public synchronized void setIndeterminate(boolean indeterminate) {         if (isStarted()) {             return;         }         animator = createIndeterminateAnimator();         animator.setTarget(this);         animator.start();     }      private boolean isStarted() {         return animator != null && animator.isStarted();     }      private Animator createIndeterminateAnimator() {         AnimatorSet set = new AnimatorSet();         Animator progressAnimator = getAnimator(SECONDARY_PROGRESS, new DecelerateInterpolator());         Animator secondaryProgressAnimator = getAnimator(PROGRESS, new AccelerateInterpolator());         set.playTogether(progressAnimator, secondaryProgressAnimator);         set.setDuration(duration);         return set;     }      @NonNull     private ObjectAnimator getAnimator(String propertyName, Interpolator interpolator) {         ObjectAnimator progressAnimator = ObjectAnimator.ofInt(this, propertyName, 0, INDETERMINATE_MAX);         progressAnimator.setInterpolator(interpolator);         progressAnimator.setDuration(duration);         progressAnimator.setRepeatMode(ValueAnimator.RESTART);         progressAnimator.setRepeatCount(ValueAnimator.INFINITE);         return progressAnimator;     } } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0421\u0434\u0435\u043b\u0430\u0432 \u043d\u0430\u0448 <code>ProgressBar<\/code> \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e, \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0437\u0430\u043c\u0435\u0434\u043b\u0438\u0432 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<p>  <iframe loading=\"lazy\" width=\"420\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/BcR88M0T-K4?feature=oembed\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p>  \u0412\u0441\u0435 \u0436\u0435 \u0432\u0435\u0440\u043d\u0435\u043c \u0435\u0433\u043e \u043a \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u0430\u043c \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044f\u043c \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0441\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u043c ProgressBar \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0432 Lollipop:<\/p>\n<p>  <iframe loading=\"lazy\" width=\"420\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/r26Urtvxbmk?feature=oembed\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043e\u043d\u0438 \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b\u043c\u0438 \u2014 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432 Lollipop \u0438\u043c\u0435\u0435\u0442 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e \u043d\u0430 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u043a\u043e\u0440\u043e\u0447\u0435. \u041d\u0435 \u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u044d\u0442\u043e, \u0434\u0430\u043d\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043b\u0438\u0437\u043a\u0430 \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u0434\u043e Lollipop.<\/p>\n<p>  \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e <a href=\"https:\/\/github.com\/StylingAndroid\/MaterialProgressBar\/tree\/master\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>.       <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/270317\/\"> http:\/\/habrahabr.ru\/post\/270317\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438, \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0441 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0440\u0435\u0431\u044f\u0442\u0430\u043c\u0438 \u0432 <a href=\"https:\/\/www.novoda.com\/\">Novoda<\/a> \u043d\u0430\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438 \u0432\u0438\u0434\u0435\u043e \u0434\u043b\u044f \u0442\u0435\u043b\u0435\u0432\u0438\u0434\u0435\u043d\u0438\u044f \u0432 \u0412\u0435\u043b\u0438\u043a\u043e\u0431\u0440\u0438\u0442\u0430\u043d\u0438\u0438 <a href=\"http:\/\/www.channel4.com\/\">Channel 4<\/a>. \u041e\u0434\u0438\u043d \u0438\u0437 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u0438\u0437\u0430\u0439\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0431\u044b\u043b \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 ProgressBar \u0432 \u0441\u0442\u0438\u043b\u0435 Material Design. \u0414\u043b\u044f Android Lollipop \u0438 \u0432\u044b\u0448\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0440\u0443\u0434\u0430, \u043d\u043e \u0432\u043e\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u043d\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u041e\u0421 \u0441\u0442\u0430\u043b\u0430 \u0434\u043b\u044f \u043d\u0430\u0441 \u0438\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u0435\u043c. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 Lollipop \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 <code>ProgressBar<\/code>:<\/p>\n<p>  <iframe loading=\"lazy\" width=\"420\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/y75JWjV8cIQ?feature=oembed\" frameborder=\"0\" allowfullscreen><\/iframe> <\/p>\n<p>  \u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0441\u0442\u0438\u043b\u044c \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c, \u0442\u043e \u043a\u043e\u0440\u0435\u043d\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043b\u0435\u0436\u0430\u043b \u0432 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0441 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c. \u041a\u043e\u0440\u043e\u0442\u043a\u0430\u044f \u043b\u0438\u043d\u0438\u044f \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043b\u0435\u0432\u0430 \u043d\u0430 \u043f\u0440\u0430\u0432\u043e, \u043d\u043e \u0434\u043b\u0438\u043d\u0430 \u0435\u0435 \u0432\u0430\u0440\u044c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u0438\u0438 \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u044f.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-267668","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/267668","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=267668"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/267668\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=267668"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=267668"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=267668"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}