/progress-circle

Simple progress cirlce

Primary LanguageKotlinMIT LicenseMIT

Progress Circle

This is a progress bar implemented as circle. The inner area is editable and presented as RelativeLayout, so you can put anything inside.

kotlin sample.xml

Attributes

app:progress_bar_size Float
app:radius Float
android:progress Integer
android:background Color
app:primary_color Color
app:secondary_color Color
app:outline Boolean
app:outline_color Color

Events

interface OnProgressChangeListener
onProgressChange(Float, Int)

Properties

progress Float
progressBarWidth Float
progressChangeListener OnProgressChangeListener?
radius Float
isRenderOutlineCircle Boolean
outlineColor Int
primaryColor Int
secondaryColor Int
outlineColor Int
duration Int
time Int

Methods

reset(void)
setCustomShader(Shader)
translate(int)

Example

override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        
        val progressCircle: ProgressCircle = findViewById(R.id.progress_circular)
        progressCircle.progressChangeListener = this
        
        mediaPlayer = MediaPlayer()
        mediaPlayer.setDataSource("audio.mp3")
        progressCircle.duration = mediaPlayer.duration
    }

override fun onProgressChange(progress: Float, time: Int) {
    mediaPlayer.seekTo(time * 1000)
}

Gestures

Move (forward/backward) Move finger from (let-right) (right-left). The gesture acceleration effect move speed. So short quick swipe will move the progress more then long slow