Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a circular progressBar like telegram?

I want a determinate circular progress bar like telegram android app but i cant find it in the project sources.

enter image description here

and it is rotating

enter image description here

Update: i am using material progress But it does not rotate in determinate mode, what i want is to rotate while loading... just like telegram app.

like image 374
Morteza Rastgoo Avatar asked Jul 02 '15 06:07

Morteza Rastgoo


1 Answers

Create a rotate.xml in res/anim folder:

<?xml version="1.0" encoding="UTF-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="1600"
    android:fromDegrees="0"
    android:interpolator="@android:anim/linear_interpolator"
    android:pivotX="50%"
    android:pivotY="50%"
    android:repeatCount="infinite"
    android:toDegrees="360" />

Load anim and run in code:

view.startAnimation(AnimationUtils.loadAnimation(activity, R.anim.rotate));
like image 51
Morteza Rastgoo Avatar answered Sep 29 '22 15:09

Morteza Rastgoo