2015-07-02 49 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/ –