This repository was archived by the owner on Sep 13, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
app/src/main/java/eu/acolombo/progressindicatorview/example
progress-indicator-view/src/main/java/eu/acolombo/progressindicatorview Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import android.animation.ValueAnimator
44import android.annotation.SuppressLint
55import android.os.Bundle
66import android.os.Handler
7+ import android.util.Log
78import android.view.View
89import android.widget.SeekBar
910import androidx.fragment.app.Fragment
@@ -21,6 +22,10 @@ abstract class BaseFragment : Fragment() {
2122 textProgress?.text = " ${progressIndicatorView.progress} %"
2223 textMax?.text = " ${progressIndicatorView.max} %"
2324 textMin?.text = " ${progressIndicatorView.min} %"
25+
26+ progressIndicatorView.onMaxReached = { Log .d(javaClass.name, " MAX" ) }
27+ progressIndicatorView.onStepChanged = { step, forward -> Log .d(javaClass.name, " $step $forward " ) }
28+ progressIndicatorView.onMinReached = { Log .d(javaClass.name, " MIN" ) }
2429 }
2530
2631 fun setupProgress (progress : Int ) {
Original file line number Diff line number Diff line change @@ -71,6 +71,11 @@ class ProgressIndicatorView @JvmOverloads constructor(
7171 }
7272 selection != stepProgress - 1 && skipSteps -> {
7373 selection = stepProgress - 1
74+ when (progress) {
75+ min -> onMinReached()
76+ max -> onMaxReached()
77+ else -> onStepChanged(selection + 1 , step < selection + 1 )
78+ }
7479 }
7580 }
7681 }
You can’t perform that action at this time.
0 commit comments