Skip to content

Commit

Permalink
Merge pull request #29 from wealthfront/cancel-and-clear
Browse files Browse the repository at this point in the history
Cancel and clear animations on detach
  • Loading branch information
Kritarie committed Jan 30, 2024
2 parents 159d8b6 + fcc9ef9 commit 4dfa9a7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,7 @@ open class BlendableAnimator : Animator() {
}
})

if (repeatCount > 0) {
cancelAnimatorOnViewsDetached()
}
cancelAnimatorOnViewsDetached()
queueAnimationsIfNotAlreadyQueued()
innerAnimator.start()
markAnimationsAsFullyQueued()
Expand Down Expand Up @@ -206,7 +204,10 @@ open class BlendableAnimator : Animator() {

override fun getListeners(): ArrayList<AnimatorListener>? = innerAnimator.listeners

override fun cancel() = innerAnimator.cancel()
override fun cancel() {
innerAnimator.cancel()
animations.clear()
}

override fun removeListener(listener: AnimatorListener) =
innerAnimator.removeListener(ListenerWrapper(listener, this))
Expand Down
1 change: 1 addition & 0 deletions blend-sample-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ dependencies {
implementation(Libs.ktx)
implementation(Libs.constraintLayout)
implementation(Libs.material)
debugImplementation(Libs.leakCanary)
testImplementation(project(":blend-test"))
testImplementation(Libs.junit)
testImplementation(Libs.truth)
Expand Down
3 changes: 3 additions & 0 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Version.junitVersion
import Version.kotlinVersion
import Version.kotlinterVersion
import Version.ktxVersion
import Version.leakCanaryVersion
import Version.materialVersion
import Version.mockitoVersion
import Version.robolectricVersion
Expand All @@ -30,6 +31,7 @@ object Libs {
val ktx = "androidx.core:core-ktx:$ktxVersion"
val constraintLayout = "androidx.constraintlayout:constraintlayout:$constraintLayoutVersion"
val material = "com.google.android.material:material:$materialVersion"
val leakCanary = "com.squareup.leakcanary:leakcanary-android:$leakCanaryVersion"
val inject = "javax.inject:javax.inject:$javaInject"
val jsr305 = "com.google.code.findbugs:jsr305:$jsrVersion"
val testCore = "androidx.test:core:$testSupportVersion"
Expand All @@ -56,6 +58,7 @@ object Version {
val ktxVersion = "1.2.0"
val constraintLayoutVersion = "1.1.3"
val materialVersion = "1.1.0"
val leakCanaryVersion = "2.12"
val truthVersion = "0.39"
val junitVersion = "4.13.2"
val robolectricVersion = "4.9.2"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ android.enableJetifier=true
kotlin.code.style=official

GROUP=com.wealthfront
VERSION_NAME=0.2.3
VERSION_NAME=0.2.4-SNAPSHOT

POM_DESCRIPTION=Animation library that gracefully handles interruptions

Expand Down

0 comments on commit 4dfa9a7

Please sign in to comment.