Skip to content

Latest commit

 

History

History
63 lines (52 loc) · 1.26 KB

MIGRATION.md

File metadata and controls

63 lines (52 loc) · 1.26 KB

Migration

Migrate from 2.0 to 2.1+

BaseRoundCornerProgressBar.OnProgressChangedListener

Change the view ID parameter in onProgressChanged to View class

// Old
fun onProgressChanged(
    viewId: Int,
    progress: Float,
    isPrimaryProgress: Boolean,
    isSecondaryProgress: Boolean
)

// New
fun onProgressChanged(
    view: View,
    progress: Float,
    isPrimaryProgress: Boolean,
    isSecondaryProgress: Boolean
)

Custom your own progress bar by extends BaseRoundCornerProgressBar

Use AnimatedRoundCornerProgressBar instead of BaseRoundCornerProgressBar for progress change animation support.

class CustomRoundCornerProgressBar: AnimatedRoundCornerProgressBar() {
    /* ... */
}

And you do not have to create the GradientDrawable by yourself anymore. drawProgress will send it as parameter.

// Old
fun drawProgress(
    layoutProgress: LinearLayout,
    max: Float,
    progress: Float,
    totalWidth: Float,
    radius: Int,
    padding: Int,
    progressColor: Int,
    isReverse: Boolean
)

// New
fun drawProgress(
    layoutProgress: LinearLayout,
    progressDrawable: GradientDrawable,
    max: Float,
    progress: Float,
    totalWidth: Float,
    radius: Int,
    padding: Int,
    isReverse: Boolean
)