Drawing circle gradually in android -
progressbar p p=(pregressbar)findviewbyid(r.id.p); objectanimator animation = objectanimator.ofint (p, "progress", 0, 100); animation.setduration (3000); animation.setinterpolator (new decelerateinterpolator ()); animation.start ();`
then in xml
<progressbar android:id="@+id/p" style="?android:attr/progressbarstylehorizontal" android:layout_width="@dimen/progreess_circle" android:layout_height="@dimen/progreess_circle" android:layout_gravity="center" android:rotation="270" android:progress="0" android:drawingcachequality="low" android:progressdrawable="@drawable/circular" />
circular.xml
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:innerradiusratio="2.3" android:shape="ring" android:thickness="10sp" > <solid android:color="@color/yellow_text_color" />
Comments
Post a Comment