progressbar-with-image
A custom android component to show progress of some asynchronous operation with different images for different states.
USAGE
To make a circular progressbar with image just add the ProgressImageView in your XML. Add the following line in your build.gradle to grab the library via gradle.
compile 'com.hs.progressbutton:imageprogressbar:1.0'
XML
<com.hs.progressbutton.ProgressImageView
android:id="@+id/layout"
android:layout_width="wrap_content"
app:radius="100dp"
app:thickness="10dp"
app:start_image="@drawable/download_gray"
app:end_image="@drawable/download"
app:pause_image="@drawable/download_blue"
app:progress_image="@drawable/download_grey"
app:ring_color="#00ff0f"
android:layout_height="wrap_content">
</com.hs.progressbutton.ProgressImageView>
Here is the list of properties you must use to configure this view:
- app:radius (in dp) ==> sets the size of the view.
- app:thickness (in dp) ==> sets the thickness of the progress ring.
- app:start_image (drawable) ==> initial image to be shown on the view
- app:progress_image (drawable) ==> image to be shown when in progress
- app:pause_image (drawable) ==> image to be shown when progress is paused.
- app:end_image (drawable) ==> image to be shown on completion of progress.
- app:ring_color (color) ==> color of the circular progressbar.
- app:complete_ring_color (color) ==> color of circular progressbar on 100% progress
- app:state (integer) ==> use to define various states of view based on which image changes.
#Note:
images on the view can be updated by calling updateProgressState method over the view with current state of progress.
Different states are (0==> ProgressImageView.ProgressState.START, 1==> ProgressImageView.ProgressState.PROGRESS,2==>
ProgressImageView.ProgressState.PAUSED,3==> ProgressImageView.ProgressState.END)