2015-07-02 29 views
4

我想要一个确定的圆形进度条,如电报Android应用程序,但我无法在项目源中找到它。如何制作一个圆形的progressBar如电报?

enter image description here

,它是旋转

enter image description here

更新:我使用material progress但并不确定模式旋转,我想是在加载旋转...就像电报应用程序一样。

+4

的人谁不使用电报的98%任意截图? –

+0

:)我添加了屏幕截图! –

+3

好的,在github上有这样的libs的音调。 https://github.com/search?utf8=%E2%9C%93&q=android+circular+progressbar –

回答

3

在res /动画文件夹中创建一个rotate.xml:

<?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" /> 

加载动画和代码运行:

view.startAnimation(AnimationUtils.loadAnimation(activity, R.anim.rotate)); 
+0

是否有任何CSS? – Muhaimin

+0

@MuhaiminAbdul http://kimmobrunfeldt.github.io/progressbar.js/examples/telegram/ –