A simple widget extending android.view.View that allows a circular progress bar, with multiple customizations and also a possibility to add a image to its center.
Use it the way you want it :)
Make sure you have attrs.xml
Xml declaration
<br.com.gilson.tlcpb.widget.TwoLevelCircularProgressBar
android:layout_width="100dp"
android:layout_height="100dp"
app:tlcp_drawable="@drawable/ic_bike"
app:tlcp_progress_color="@color/blue"
app:tlcp_strokeWidth="15dp"/>
There are some attributes defined in the attrs.xml.
tlcp_bg_color
- defines the circular progress background
tlcp_drawable
- defines the centralized image
tlcp_progress_color
- defines the first progress bar color
tlcp_progress2_color
- - defines the second progress bar color
tlcp_strokeWidth
- defines the circle stroke width
tlcp_progress
- defines the first progress value (0 / 100)
tlcp_progress2
- defines the second progress value (0 / 100)
Inorder to set the circularProgressBar attribute from the xml, make sure your layout xml contains an additional namespace.
xmlns:app="http://schemas.android.com/apk/res/your_package_name"
Progression level:
myCircularProgress.setProgressValue(value)
myCircularProgress.setProgress2Value(value)
- Centralized text
- Text bellow image