feat(bundles tab): add BackHandler

This commit is contained in:
Ax333l 2023-10-26 09:03:26 +02:00 committed by oSumAtrIX
parent 3f34407741
commit 691b615b02
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4

View File

@ -1,5 +1,6 @@
package app.revanced.manager.ui.screen
import androidx.activity.compose.BackHandler
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
@ -203,6 +204,13 @@ fun DashboardScreen(
}
DashboardPage.BUNDLES -> {
BackHandler {
if (bundlesSelectable) vm.cancelSourceSelection() else composableScope.launch {
pagerState.animateScrollToPage(
DashboardPage.DASHBOARD.ordinal
)
}
}
val sources by vm.sources.collectAsStateWithLifecycle(initialValue = emptyList())