Skip to content

Commit

Permalink
state reset added after dismiss
Browse files Browse the repository at this point in the history
  • Loading branch information
Adityapanther committed Feb 18, 2024
1 parent ef5da82 commit 5898bff
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:8.1.0")
classpath("com.android.tools.build:gradle:8.1.4")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0")
}
}
Expand Down
12 changes: 6 additions & 6 deletions sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ dependencies {
androidTestImplementation(composeBom)

implementation(project(":swiper"))
implementation("androidx.core:core-ktx:1.10.1")
implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.9.0")
implementation("com.google.android.material:material:1.11.0")
implementation("androidx.compose.ui:ui:${rootProject.extra["compose_version"]}")
implementation("androidx.compose.material:material:${rootProject.extra["compose_version"]}")
implementation("androidx.compose.ui:ui-tooling:${rootProject.extra["compose_version"]}")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.1")
implementation("androidx.activity:activity-compose:1.7.2")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
implementation("androidx.activity:activity-compose:1.8.2")
testImplementation("junit:junit:4.+")
androidTestImplementation("androidx.test.ext:junit:1.1.2")
androidTestImplementation("androidx.test.espresso:espresso-core:3.3.0")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation("androidx.compose.ui:ui-test-junit4:${rootProject.extra["compose_version"]}")
}
6 changes: 3 additions & 3 deletions swiper/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ dependencies {

implementation("androidx.compose.foundation:foundation")
testImplementation("junit:junit:4.+")
androidTestImplementation("androidx.test.ext:junit:1.1.2")
androidTestImplementation("androidx.test.espresso:espresso-core:3.3.0")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
}

afterEvaluate {
Expand All @@ -45,7 +45,7 @@ afterEvaluate {
create<MavenPublication>("release") {
groupId = "moe.tlaster"
artifactId = "swiper"
version = "0.7.1"
version = "0.7.2"

from(components["release"])
}
Expand Down
2 changes: 2 additions & 0 deletions swiper/src/main/java/moe/tlaster/swiper/SwiperState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ class SwiperState(
dismissed = true
_offset.animateTo(maxHeight.toFloat().withSign(_offset.value), initialVelocity = velocity)
onDismiss.invoke()
restore()
}

private suspend fun restore() {
onEnd.invoke()
_offset.animateTo(0f)
dismissed = false
}

companion object {
Expand Down

0 comments on commit 5898bff

Please sign in to comment.