build(deps): Kotlin 2.4.20, Compose BOM 2026.09, material3 alpha28, navigation 2.10

Жест назад ведёт тот же shared-axis, что и кнопка: дефолт 2.10 - scaleOut(0.7).
This commit is contained in:
samosvalishe committed 2026-09-22 10:05:11 +03:00
1 parent 7ab921c667
commit 8abeeb70b3
3 files changed
+28 -22

No files matched your search

@@ -18,7 +18,7 @@ import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.material3.TextButton import androidx.compose.material3.TextButton
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo import androidx.compose.material3.adaptive.currentWindowAdaptiveInfoV2
import androidx.compose.material3.adaptive.navigationsuite.NavigationSuiteItem import androidx.compose.material3.adaptive.navigationsuite.NavigationSuiteItem
import androidx.compose.material3.adaptive.navigationsuite.NavigationSuiteScaffold import androidx.compose.material3.adaptive.navigationsuite.NavigationSuiteScaffold
import androidx.compose.material3.adaptive.navigationsuite.NavigationSuiteScaffoldDefaults import androidx.compose.material3.adaptive.navigationsuite.NavigationSuiteScaffoldDefaults
@@ -107,7 +107,7 @@ fun AppNavigation(
} }
val suiteType = NavigationSuiteScaffoldDefaults val suiteType = NavigationSuiteScaffoldDefaults
.navigationSuiteType(currentWindowAdaptiveInfo()) .navigationSuiteType(currentWindowAdaptiveInfoV2())
val context = LocalContext.current val context = LocalContext.current
@@ -222,16 +222,12 @@ private fun AppNavHost(
} }
} }
}, },
popEnterTransition = { popEnterTransition = { popEnter(reducedMotion) },
if (reducedMotion) EnterTransition.None popExitTransition = { popExit(reducedMotion) },
else fadeIn(tween(NAV_FADE_IN_MS, easing = EmphasizedEasing)) + // Дефолт navigation 2.10 для жеста назад - scaleOut(0.7): экран "проваливается".
slideInHorizontally(tween(NAV_SLIDE_MS, easing = EmphasizedEasing)) { -it / 5 } // Жест ведёт тот же shared-axis, что и кнопка назад.
}, predictivePopEnterTransition = { popEnter(reducedMotion) },
popExitTransition = { predictivePopExitTransition = { popExit(reducedMotion) }
if (reducedMotion) ExitTransition.None
else fadeOut(tween(NAV_FADE_OUT_MS, easing = EmphasizedEasing)) +
slideOutHorizontally(tween(NAV_SLIDE_MS, easing = EmphasizedEasing)) { it / 12 }
}
) { ) {
homeGraph(navController, settingsViewModel, serverConfigViewModel, proxyViewModel) homeGraph(navController, settingsViewModel, serverConfigViewModel, proxyViewModel)
logsGraph(proxyViewModel) logsGraph(proxyViewModel)
@@ -241,6 +237,16 @@ private fun AppNavHost(
} }
} }
private fun popEnter(reducedMotion: Boolean): EnterTransition =
if (reducedMotion) EnterTransition.None
else fadeIn(tween(NAV_FADE_IN_MS, easing = EmphasizedEasing)) +
slideInHorizontally(tween(NAV_SLIDE_MS, easing = EmphasizedEasing)) { -it / 5 }
private fun popExit(reducedMotion: Boolean): ExitTransition =
if (reducedMotion) ExitTransition.None
else fadeOut(tween(NAV_FADE_OUT_MS, easing = EmphasizedEasing)) +
slideOutHorizontally(tween(NAV_SLIDE_MS, easing = EmphasizedEasing)) { it / 12 }
private val tabOrder = listOf( private val tabOrder = listOf(
HomeGraph::class, LogsGraph::class, ShareGraph::class, SettingsGraph::class, AddGraph::class HomeGraph::class, LogsGraph::class, ShareGraph::class, SettingsGraph::class, AddGraph::class
) )
@@ -272,6 +278,7 @@ private fun TelegramSubscribeDialog(onSubscribe: () -> Unit, onDismiss: () -> Un
text = { Text(stringResource(R.string.tg_subscribe_desc)) }, text = { Text(stringResource(R.string.tg_subscribe_desc)) },
confirmButton = { confirmButton = {
TextButton( TextButton(
shapes = ButtonDefaults.shapes(),
onClick = onSubscribe, onClick = onSubscribe,
colors = ButtonDefaults.textButtonColors( colors = ButtonDefaults.textButtonColors(
contentColor = MaterialTheme.colorScheme.primary contentColor = MaterialTheme.colorScheme.primary
@@ -279,7 +286,7 @@ private fun TelegramSubscribeDialog(onSubscribe: () -> Unit, onDismiss: () -> Un
) { Text(stringResource(R.string.tg_subscribe_btn)) } ) { Text(stringResource(R.string.tg_subscribe_btn)) }
}, },
dismissButton = { dismissButton = {
TextButton(onClick = onDismiss) { Text(stringResource(R.string.tg_not_now)) } TextButton(shapes = ButtonDefaults.shapes(), onClick = onDismiss) { Text(stringResource(R.string.tg_not_now)) }
} }
) )
} }
@@ -67,7 +67,6 @@ internal fun AppList(
items(filtered, key = { it.packageName }) { app -> items(filtered, key = { it.packageName }) { app ->
val checked = app.packageName in selected val checked = app.packageName in selected
ListItem( ListItem(
headlineContent = { Text(app.label) },
supportingContent = { supportingContent = {
Text(app.packageName, style = MaterialTheme.typography.labelSmall) Text(app.packageName, style = MaterialTheme.typography.labelSmall)
}, },
@@ -86,7 +85,7 @@ internal fun AppList(
role = Role.Checkbox, role = Role.Checkbox,
onValueChange = { onToggle(app.packageName) } onValueChange = { onToggle(app.packageName) }
) )
) ) { Text(app.label) }
} }
} }
} }
+7 -7
View File
@@ -1,20 +1,20 @@
[versions] [versions]
agp = "9.1.1" agp = "9.1.1"
kotlin = "2.4.10" kotlin = "2.4.20"
coreKtx = "1.19.0" coreKtx = "1.19.0"
activity = "1.13.0" activity = "1.13.0"
composeBom = "2026.08.00" composeBom = "2026.09.00"
material3 = "1.5.0-alpha26" material3 = "1.5.0-alpha28"
navigationCompose = "2.9.8" navigationCompose = "2.10.1"
datastorePreferences = "1.2.1" datastorePreferences = "1.2.1"
lifecycleViewmodelCompose = "2.11.0" lifecycleViewmodelCompose = "2.11.0"
coreSplashscreen = "1.2.0" coreSplashscreen = "1.2.0"
jsch = "2.28.6" jsch = "2.28.7"
coroutinesAndroid = "1.11.0" coroutinesAndroid = "1.11.0"
bouncycastle = "1.85.2" bouncycastle = "1.86"
koin = "4.2.2" koin = "4.2.2"
desugarJdkLibs = "2.1.5" desugarJdkLibs = "2.1.5"
camerax = "1.6.1" camerax = "1.6.2"
mlkitBarcode = "17.3.0" mlkitBarcode = "17.3.0"
zxingCore = "3.5.4" zxingCore = "3.5.4"
junit = "4.13.2" junit = "4.13.2"