This is kind of a countdown function. It uses nice digital counters.
- Min and Sec
- Optional Buttons : Pause and Stop
- Free size : Relative Layout
- Free background color
- Easy Theme : Wooden, Classic, Happy, Balck, Neon, Simple
- Get Running Function :Repeatdly to do
- Get Finish Function: Such as handler.removeCallbacks(runnable)
Install my-project with https://jitpack.io/
dependencies {
implementation 'com.github.Mori-hub:NiceCountDown:1.0.0'
}
// Call Lib
val countView = CountView(
this // Add the Activity
,R.id.timerPosition, // Layout must be Relative Layout ! as a Parent
{Toast.makeText(this, "It's Finish", Toast.LENGTH_SHORT).show()} //Function after finish
, null // Function in Running time, Repeatedly !!!
, "wooden" // You can choose a theme or null
)
// When you call this method , the timer will start !
countView.startTimer(0, 20)
- Parent Layout : This must be a Relative Layout and put anywhere
- null : For Running Function and Finish Function
- Show Timer: When you call main method, the layout will attach to the window
- startTimer: When you call this method , the timer will start !
findViewById<Button>(R.id.start).setOnClickListener {
countView.startTimer(1, 20) // set time by Min and Sec --> 1:20
}
countView.buttons(
findViewById<Button>(R.id.stop), // Optional Button , For Stop the timer
findViewById<Button>(R.id.pause))// Optional Button , For Pause the timer
I'm a full stack developer...
Java, Kotlin, CSS....
Important: For Gradle 7.2 & jitpack.io Please use this way : https://stackoverflow.com/a/71603699/12272687
Update: March 2022
If you have any feedback, please reach out to us at SR-App@outlook.com