Skip to content

Commit

Permalink
changed the attr progress name, probably has one conflict with new an…
Browse files Browse the repository at this point in the history
…droid stuido 3.6 or lastest.
  • Loading branch information
pcamilo-i9 committed Mar 10, 2020
1 parent 99e1572 commit 9f0f0af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/com/circleprogressbar/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class MainActivity : AppCompatActivity() {

override fun onResume() {
super.onResume()
progress_circular.setProgressAnimation(40f,2000)
progress_circular.runProgress(progressListener)
progress_circular.setProgressAnimation(40f,2000)
}

private val progressListener = object : CircleProgressBar.CircleProgressBarCallback {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class CircleProgressBar(context: Context?, attrs: AttributeSet?) : View(context,

typedArray?.let {
try {
progress = it.getFloat(R.styleable.CircleProgressBar_progress, progress)
progress = it.getFloat(R.styleable.CircleProgressBar_progressCircleBar, progress)
color = it.getInt(R.styleable.CircleProgressBar_progressColor, color)
max = it.getInt(R.styleable.CircleProgressBar_maxProgress, max)
min = it.getInt(R.styleable.CircleProgressBar_minProgress, min)
Expand Down Expand Up @@ -173,7 +173,9 @@ class CircleProgressBar(context: Context?, attrs: AttributeSet?) : View(context,
}

override fun onAnimationEnd(animation: Animator?) {
mListener?.onProgressEnd()
mListener?.let {
it.onProgressEnd()
}
}

override fun onAnimationStart(animation: Animator?) {
Expand Down
2 changes: 1 addition & 1 deletion circleprogressbar/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<!-- Sets the stroke width of progress -->
<attr name="strokeWidth" format="integer"/>
<!-- Sets the value of progress -->
<attr name="progress" format="integer"/>
<attr name="progressCircleBar" format="integer"/>
<!-- Sets the color of progress -->
<attr name="progressColor" format="color"/>
<!-- Sets the identifier of progress -->
Expand Down

0 comments on commit 9f0f0af

Please sign in to comment.