Skip to content

Commit 763c744

Browse files
committed
移除设置页切换内容时的回弹动画
1 parent 4d54b59 commit 763c744

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

app/mobile/src/main/kotlin/dev/aaa1115910/bv/mobile/screen/settings/SettingsScreen.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ package dev.aaa1115910.bv.mobile.screen.settings
22

33
import android.app.Activity
44
import androidx.activity.compose.BackHandler
5+
import androidx.compose.animation.fadeIn
6+
import androidx.compose.animation.fadeOut
7+
import androidx.compose.animation.slideInHorizontally
8+
import androidx.compose.animation.slideOutHorizontally
59
import androidx.compose.foundation.background
610
import androidx.compose.foundation.interaction.MutableInteractionSource
711
import androidx.compose.material3.LocalMinimumInteractiveComponentSize
@@ -53,6 +57,8 @@ fun SettingsScreen() {
5357
listPane = {
5458
AnimatedPane(
5559
modifier = Modifier.preferredWidth(360.dp),
60+
enterTransition = fadeIn() + slideInHorizontally(),
61+
exitTransition = fadeOut() + slideOutHorizontally()
5662
) {
5763
SettingsCategories(
5864
selectedSettings = if (singlePart) null else selectedSettings
@@ -69,7 +75,11 @@ fun SettingsScreen() {
6975
}
7076
},
7177
detailPane = {
72-
AnimatedPane(modifier = Modifier) {
78+
AnimatedPane(
79+
modifier = Modifier,
80+
enterTransition = fadeIn() + slideInHorizontally { it / 2 },
81+
exitTransition = fadeOut() + slideOutHorizontally { it / 2 }
82+
) {
7383
SettingsDetails(
7484
selectedSettings = selectedSettings ?: MobileSettings.Play,
7585
showNavBack = scaffoldNavigator.canNavigateBack(),

0 commit comments

Comments
 (0)