Repository navigation
Home
dips25 edited this page Jun 3, 2026
·
2 revisions
dependencyResolutionManagement
{
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
dependencies {implementation 'com.github.dips25:BottleFillProgress:v1.0-beta'}
<com.anim.bottlefillanimationprogress.BottleProgress
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:type="normal"
app:duration="1000"
app:waterColor="@android:color/holo_blue_bright"
android:id="@+id/bottle_progress"/>
bp = findViewById<BottleProgress>(R.id.bottle_progress)
//set the colors(default blue)
bp!!.setColors(intArrayOf(android.R.color.holo_purple
,android.R.color.holo_red_dark
,android.R.color.holo_green_light))
override fun onResume() {
super.onResume()
//start when needed
bp!!.startAnim()
}
override fun onPause() {
super.onPause()
//stop when not needed(onPause())
bp!!.stopAnim()
}
override fun onStop() {
super.onStop()
//stop when not needed(onStop)
bp!!.stopAnim()
}
val button: Button = findViewById(R.id.button_click)
button.setOnClickListener {
bp!!.startAnim()
}
val stopButton = findViewById<Button>(R.id.button_stop)
stopButton.setOnClickListener {
bp!!.stopAnim()
}