Hello, what is the name of this counter? With each completed action - it increases by 1 unit and the circle is gradually filled. Are there any lessons or ready-made examples on this counter? (this is not a progress bar)
|
2 answers
There is no standard control, but there are third-party solutions. Judging by en-SO , this library will suit you: CircleProgress
<com.github.lzyzsd.circleprogress.CircleProgress android:id="@+id/circle_progress" android:layout_marginLeft="50dp" android:layout_width="100dp" android:layout_height="100dp" custom:circle_progress="20"/>
|
Here is an example of such a progressBar
, but without the numbers inside, with them you can make a ProgressBar
and TextView
inside RelativeLayout, for example!
progressBarCircular = (ProgressBar) findViewById(R.id.progressBar); progressBarCircular.setMax(100);
in the markup insert it like this:
<ProgressBar android:id="@+id/progressBar" style="?android:attr/progressBarStyleHorizontal" android:layout_width="@dimen/result_check_progress_bar_height" android:layout_height="@dimen/result_check_progress_bar_height" android:rotation="-90" android:max="100" android:progress="0" android:progressDrawable="@drawable/shape_circular" />
shape_circular.xml
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@android:id/secondaryProgress"> <shape android:shape="ring" android:useLevel="true" android:thickness="5sp"> </shape> </item> <item android:id="@android:id/progress" > <shape android:innerRadius="55dp" android:shape="ring" android:useLevel="true" android:thickness="6.0sp"> <rotate android:fromDegrees="0" android:toDegrees="360" /> <solid android:color="#70ed70"/> </shape> </item> </layer-list>
|