From 2e2dee9e26489debccc261b8ad130e58bb571db6 Mon Sep 17 00:00:00 2001 From: Acclorite <140836141+Acclorite@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:44:40 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20Replace=20DropDown=20with=20Bott?= =?UTF-8?q?omSheet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Replaced DropDown with NavigationBottomSheet * Renamed LocalOnNavigate → LocalNavigator, LocalNavigator → LocalNavigatorInstance --- .../book_story/domain/util/Position.kt | 8 ++ .../core/components/CustomDropDownMenuItem.kt | 47 ---------- .../core/components/MoreDropDown.kt | 93 ------------------- .../BottomNavigationBar.kt | 4 +- .../CustomNavigationRail.kt | 4 +- .../core/navigation/Navigation.kt | 58 ++++++++---- .../core/navigation/NavigationBottomSheet.kt | 79 ++++++++++++++++ .../core/navigation/NavigationIconButton.kt | 25 +++++ .../core/navigation/NavigationItem.kt | 88 ++++++++++++++++++ .../presentation/screens/about/AboutScreen.kt | 4 +- .../about/nested/credits/CreditsScreen.kt | 4 +- .../nested/license_info/LicenseInfoScreen.kt | 6 +- .../about/nested/licenses/LicensesScreen.kt | 4 +- .../screens/book_info/BookInfoScreen.kt | 10 +- .../components/BookInfoMoreBottomSheet.kt | 76 +++++++++++++++ .../components/BookInfoMoreDropDown.kt | 77 --------------- .../book_info/components/BookInfoTopBar.kt | 9 +- .../components/dialog/BookInfoDeleteDialog.kt | 5 +- .../components/dialog/BookInfoMoveDialog.kt | 5 +- .../screens/book_info/data/BookInfoEvent.kt | 2 + .../screens/book_info/data/BookInfoState.kt | 2 + .../book_info/data/BookInfoViewModel.kt | 8 ++ .../screens/browse/BrowseScreen.kt | 4 +- .../components/BrowseEmptyPlaceholder.kt | 4 +- .../adding_dialog/BrowseAddingDialog.kt | 4 +- .../browse/components/top_bar/BrowseTopBar.kt | 8 +- .../presentation/screens/help/HelpScreen.kt | 4 +- .../screens/help/components/HelpItem.kt | 4 +- .../screens/history/HistoryScreen.kt | 10 +- .../screens/library/LibraryScreen.kt | 4 +- .../library/components/LibraryTopBar.kt | 6 +- .../screens/reader/ReaderScreen.kt | 6 +- .../reader/components/ReaderUpdateDialog.kt | 4 +- .../reader/components/app_bar/ReaderTopBar.kt | 4 +- .../screens/settings/SettingsScreen.kt | 4 +- .../nested/appearance/AppearanceSettings.kt | 4 +- .../settings/nested/browse/BrowseSettings.kt | 4 +- .../nested/general/GeneralSettings.kt | 4 +- .../settings/nested/reader/ReaderSettings.kt | 4 +- .../screens/start/components/StartDone.kt | 6 +- app/src/main/res/values-de/strings.xml | 1 - app/src/main/res/values-es/strings.xml | 1 - app/src/main/res/values-fr/strings.xml | 1 - app/src/main/res/values-pl/strings.xml | 1 - app/src/main/res/values-tr/strings.xml | 1 - app/src/main/res/values-uk/strings.xml | 2 +- app/src/main/res/values/strings.xml | 2 +- 47 files changed, 408 insertions(+), 307 deletions(-) create mode 100644 app/src/main/java/ua/acclorite/book_story/domain/util/Position.kt delete mode 100644 app/src/main/java/ua/acclorite/book_story/presentation/core/components/CustomDropDownMenuItem.kt delete mode 100644 app/src/main/java/ua/acclorite/book_story/presentation/core/components/MoreDropDown.kt create mode 100644 app/src/main/java/ua/acclorite/book_story/presentation/core/navigation/NavigationBottomSheet.kt create mode 100644 app/src/main/java/ua/acclorite/book_story/presentation/core/navigation/NavigationIconButton.kt create mode 100644 app/src/main/java/ua/acclorite/book_story/presentation/core/navigation/NavigationItem.kt create mode 100644 app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/components/BookInfoMoreBottomSheet.kt delete mode 100644 app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/components/BookInfoMoreDropDown.kt diff --git a/app/src/main/java/ua/acclorite/book_story/domain/util/Position.kt b/app/src/main/java/ua/acclorite/book_story/domain/util/Position.kt new file mode 100644 index 00000000..732ee1a8 --- /dev/null +++ b/app/src/main/java/ua/acclorite/book_story/domain/util/Position.kt @@ -0,0 +1,8 @@ +package ua.acclorite.book_story.domain.util + +import androidx.compose.runtime.Immutable + +@Immutable +enum class Position { + TOP, CENTER, BOTTOM, SOLO +} \ No newline at end of file diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/core/components/CustomDropDownMenuItem.kt b/app/src/main/java/ua/acclorite/book_story/presentation/core/components/CustomDropDownMenuItem.kt deleted file mode 100644 index 07e773cd..00000000 --- a/app/src/main/java/ua/acclorite/book_story/presentation/core/components/CustomDropDownMenuItem.kt +++ /dev/null @@ -1,47 +0,0 @@ -package ua.acclorite.book_story.presentation.core.components - -import androidx.compose.foundation.layout.PaddingValues -import androidx.compose.foundation.layout.size -import androidx.compose.material3.DropdownMenuItem -import androidx.compose.material3.Icon -import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.vector.ImageVector -import androidx.compose.ui.unit.dp - -/** - * Custom Dropdown Menu Item. Used in Dropdown. - */ -@Composable -fun CustomDropDownMenuItem( - leadingIcon: ImageVector, - text: String, - onClick: () -> Unit -) { - DropdownMenuItem( - leadingIcon = { - Icon( - leadingIcon, - contentDescription = null, - modifier = Modifier.size(24.dp), - tint = MaterialTheme.colorScheme.onSurfaceVariant - ) - }, - trailingIcon = { - - }, - text = { - Text( - text = text, - color = MaterialTheme.colorScheme.onSurface, - style = MaterialTheme.typography.bodyLarge - ) - }, - onClick = { - onClick() - }, - contentPadding = PaddingValues(start = 12.dp, end = 0.dp) - ) -} \ No newline at end of file diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/core/components/MoreDropDown.kt b/app/src/main/java/ua/acclorite/book_story/presentation/core/components/MoreDropDown.kt deleted file mode 100644 index 26986749..00000000 --- a/app/src/main/java/ua/acclorite/book_story/presentation/core/components/MoreDropDown.kt +++ /dev/null @@ -1,93 +0,0 @@ -package ua.acclorite.book_story.presentation.core.components - -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.PaddingValues -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.MoreVert -import androidx.compose.material3.DropdownMenu -import androidx.compose.material3.DropdownMenuItem -import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateOf -import androidx.compose.runtime.remember -import androidx.compose.runtime.setValue -import androidx.compose.ui.res.stringResource -import androidx.compose.ui.unit.DpOffset -import androidx.compose.ui.unit.dp -import ua.acclorite.book_story.R -import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator -import ua.acclorite.book_story.presentation.core.navigation.Screen - -/** - * More drop down. - * Navigates to Settings, About and Help screens. - */ -@Composable -fun MoreDropDown() { - val navigator = LocalNavigator.current - var showDropDown by remember { mutableStateOf(false) } - - val startPadding = remember { 12.dp } - val endPadding = remember { 36.dp } - - Box { - CustomIconButton( - icon = Icons.Default.MoreVert, - contentDescription = R.string.show_dropdown_content_desc, - disableOnClick = false, - enabled = !showDropDown - ) { - showDropDown = true - } - - DropdownMenu( - expanded = showDropDown, - onDismissRequest = { showDropDown = false }, - offset = DpOffset((-15).dp, 0.dp) - ) { - DropdownMenuItem( - text = { - Text( - text = stringResource(id = R.string.settings_screen), - color = MaterialTheme.colorScheme.onSurface, - style = MaterialTheme.typography.bodyLarge - ) - }, - onClick = { - navigator.navigate(Screen.Settings) - }, - contentPadding = PaddingValues(start = startPadding, end = endPadding) - ) - DropdownMenuItem( - text = { - Text( - text = stringResource(id = R.string.help_screen), - color = MaterialTheme.colorScheme.onSurface, - style = MaterialTheme.typography.bodyLarge - ) - }, - onClick = { - navigator.navigate(Screen.Help(false)) - }, - contentPadding = PaddingValues(start = startPadding, end = endPadding) - ) - DropdownMenuItem( - text = { - Text( - text = stringResource(id = R.string.about_screen), - color = MaterialTheme.colorScheme.onSurface, - style = MaterialTheme.typography.bodyLarge - ) - }, - onClick = { - navigator.navigate(Screen.About) - }, - contentPadding = PaddingValues(start = startPadding, end = endPadding) - ) - - - } - } -} \ No newline at end of file diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/core/components/bottom_navigation_bar/BottomNavigationBar.kt b/app/src/main/java/ua/acclorite/book_story/presentation/core/components/bottom_navigation_bar/BottomNavigationBar.kt index ccedaa5d..9b18e12d 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/core/components/bottom_navigation_bar/BottomNavigationBar.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/core/components/bottom_navigation_bar/BottomNavigationBar.kt @@ -9,7 +9,7 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import ua.acclorite.book_story.domain.util.Route import ua.acclorite.book_story.presentation.core.constants.Constants -import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator +import ua.acclorite.book_story.presentation.core.navigation.LocalNavigatorInstance /** * Bottom navigation bar, uses default [NavigationBar]. @@ -17,7 +17,7 @@ import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator @Composable fun BottomNavigationBar() { var currentScreen: Route? by remember { mutableStateOf(null) } - val navigator = LocalNavigator.current + val navigator = LocalNavigatorInstance.current LaunchedEffect(Unit) { navigator.currentScreen.collect { route -> diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/core/components/custom_navigation_rail/CustomNavigationRail.kt b/app/src/main/java/ua/acclorite/book_story/presentation/core/components/custom_navigation_rail/CustomNavigationRail.kt index 6cb44224..b7b8f5e8 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/core/components/custom_navigation_rail/CustomNavigationRail.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/core/components/custom_navigation_rail/CustomNavigationRail.kt @@ -25,7 +25,7 @@ import androidx.compose.ui.platform.LocalLayoutDirection import androidx.compose.ui.unit.dp import ua.acclorite.book_story.domain.util.Route import ua.acclorite.book_story.presentation.core.constants.Constants -import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator +import ua.acclorite.book_story.presentation.core.navigation.LocalNavigatorInstance /** * Custom Navigation Rail. It is used to be shown on Tablets. @@ -33,7 +33,7 @@ import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator @Composable fun CustomNavigationRail() { var currentScreen: Route? by remember { mutableStateOf(null) } - val navigator = LocalNavigator.current + val navigator = LocalNavigatorInstance.current val layoutDirection = LocalLayoutDirection.current LaunchedEffect(Unit) { diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/core/navigation/Navigation.kt b/app/src/main/java/ua/acclorite/book_story/presentation/core/navigation/Navigation.kt index 04a15065..6f046811 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/core/navigation/Navigation.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/core/navigation/Navigation.kt @@ -41,6 +41,9 @@ import dagger.assisted.AssistedInject import dagger.hilt.android.lifecycle.HiltViewModel import dagger.hilt.android.lifecycle.withCreationCallback import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import kotlinx.parcelize.Parcelize import kotlinx.serialization.Serializable @@ -54,13 +57,10 @@ private const val BACKSTACK = "back_stack" private const val USE_BACK_ANIM = "use_back_animation" private const val SCREENS = "screens" -/** - * Passed in [CompositionLocalProvider]. - */ -val LocalNavigator = compositionLocalOf { +val LocalNavigatorInstance = compositionLocalOf { error("Cannot initialize Navigator.") } -val LocalOnNavigate = compositionLocalOf { +val LocalNavigator = compositionLocalOf { error("Cannot initialize Navigator.") } @@ -162,6 +162,9 @@ class Navigator @AssistedInject constructor( private val backStack = savedStateHandle.getStateFlow(BACKSTACK, mutableListOf()) val screens = savedStateHandle.getStateFlow(SCREENS, mutableListOf()) + private val _showNavigationBottomSheet = MutableStateFlow(false) + private val showNavigationBottomSheet = _showNavigationBottomSheet.asStateFlow() + init { putScreen(startScreen) } @@ -276,6 +279,20 @@ class Navigator @AssistedInject constructor( return this::class.simpleName!! } + /** + * Shows navigation bottom sheet. + */ + fun showNavigationBottomSheet() { + _showNavigationBottomSheet.update { true } + } + + /** + * Hides navigation bottom sheet. + */ + fun hideNavigationBottomSheet() { + _showNavigationBottomSheet.update { false } + } + /** * Animated Screen. Used in [NavigationHost]. * Each [composable] should have unique [Screen]. @@ -340,27 +357,36 @@ class Navigator @AssistedInject constructor( content: @Composable () -> Unit ) { val activity = LocalContext.current as ComponentActivity - val currentScreen = currentScreen.collectAsState() - val useBackAnimation by useBackAnimation.collectAsState() - val shouldShow by remember { - derivedStateOf { - screens.any { it == currentScreen.value } - } - } - val windowClass = calculateWindowSizeClass(activity = activity) val tabletUI = remember(windowClass) { windowClass.widthSizeClass != WindowWidthSizeClass.Compact } val layoutDirection = LocalLayoutDirection.current + val currentScreen = currentScreen.collectAsState() + val useBackAnimation by useBackAnimation.collectAsState() + val showNavigation = remember { + derivedStateOf { + screens.any { it == currentScreen.value } + } + } + val showNavigationBottomSheet = showNavigationBottomSheet.collectAsState() + CustomAnimatedVisibility( - visible = shouldShow, + visible = showNavigation.value, enter = if (useBackAnimation) backEnterBarAnim else enterBarAnim, exit = if (useBackAnimation) backExitBarAnim else exitBarAnim ) { + if (showNavigationBottomSheet.value) { + NavigationBottomSheet( + onDismissRequest = { + hideNavigationBottomSheet() + } + ) + } + Scaffold( bottomBar = { if (!tabletUI) { @@ -440,8 +466,8 @@ fun NavigationHost( ) CompositionLocalProvider( - LocalNavigator provides navigator, - LocalOnNavigate provides { navigator.it() } + LocalNavigatorInstance provides navigator, + LocalNavigator provides { navigator.it() } ) { content(navigator) } diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/core/navigation/NavigationBottomSheet.kt b/app/src/main/java/ua/acclorite/book_story/presentation/core/navigation/NavigationBottomSheet.kt new file mode 100644 index 00000000..a8b08d5e --- /dev/null +++ b/app/src/main/java/ua/acclorite/book_story/presentation/core/navigation/NavigationBottomSheet.kt @@ -0,0 +1,79 @@ +package ua.acclorite.book_story.presentation.core.navigation + +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp +import ua.acclorite.book_story.R +import ua.acclorite.book_story.domain.util.Position +import ua.acclorite.book_story.presentation.core.components.custom_bottom_sheet.CustomBottomSheet + +/** + * Navigation Bottom Sheet. + * Previously known as More Drop-Down. + * Bottom sheet allows to have more options and it generally looks better. + * + * @param onDismissRequest Dismiss callback. + */ +@Composable +fun NavigationBottomSheet(onDismissRequest: () -> Unit) { + val onNavigate = LocalNavigator.current + + CustomBottomSheet( + modifier = Modifier.fillMaxWidth(), + onDismissRequest = onDismissRequest + ) { + LazyColumn(Modifier.fillMaxWidth()) { + item { + NavigationItem( + title = stringResource(id = R.string.about_screen), + primary = false, + position = Position.TOP + ) { + onNavigate { + navigate(screen = Screen.About) + hideNavigationBottomSheet() + } + } + } + + item { + NavigationItem( + title = stringResource(id = R.string.help_screen), + primary = false, + position = Position.BOTTOM + ) { + onNavigate { + navigate(screen = Screen.Help(fromStart = false)) + hideNavigationBottomSheet() + } + } + } + + item { + Spacer(Modifier.height(18.dp)) + } + + item { + NavigationItem( + title = stringResource(id = R.string.settings_screen), + primary = true, + position = Position.SOLO + ) { + onNavigate { + navigate(screen = Screen.Settings) + hideNavigationBottomSheet() + } + } + } + + item { + Spacer(modifier = Modifier.height(8.dp)) + } + } + } +} \ No newline at end of file diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/core/navigation/NavigationIconButton.kt b/app/src/main/java/ua/acclorite/book_story/presentation/core/navigation/NavigationIconButton.kt new file mode 100644 index 00000000..d60023ad --- /dev/null +++ b/app/src/main/java/ua/acclorite/book_story/presentation/core/navigation/NavigationIconButton.kt @@ -0,0 +1,25 @@ +package ua.acclorite.book_story.presentation.core.navigation + +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.MoreVert +import androidx.compose.runtime.Composable +import ua.acclorite.book_story.R +import ua.acclorite.book_story.presentation.core.components.CustomIconButton + +/** + * Navigation Icon Button. + * Used to display [NavigationBottomSheet]. + */ +@Composable +fun NavigationIconButton( + onClick: Navigator.() -> Unit = { showNavigationBottomSheet() } +) { + val navigator = LocalNavigatorInstance.current + CustomIconButton( + icon = Icons.Default.MoreVert, + contentDescription = R.string.more_content_desc, + disableOnClick = false, + ) { + navigator.onClick() + } +} \ No newline at end of file diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/core/navigation/NavigationItem.kt b/app/src/main/java/ua/acclorite/book_story/presentation/core/navigation/NavigationItem.kt new file mode 100644 index 00000000..33f1e5ed --- /dev/null +++ b/app/src/main/java/ua/acclorite/book_story/presentation/core/navigation/NavigationItem.kt @@ -0,0 +1,88 @@ +package ua.acclorite.book_story.presentation.core.navigation + +import androidx.compose.foundation.background +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.CornerSize +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.remember +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.dp +import ua.acclorite.book_story.domain.util.Position + +/** + * Navigation item. + * + * @param title Title. + * @param primary Whether this item is primary. + * @param position Position of the item. + * @param onClick OnClick callback. + */ +@Composable +fun NavigationItem( + title: String, + primary: Boolean, + position: Position, + onClick: () -> Unit +) { + val largeShape = MaterialTheme.shapes.large + val shape = remember(position) { + when (position) { + Position.TOP -> largeShape.copy( + bottomStart = CornerSize(0.dp), + bottomEnd = CornerSize(0.dp) + ) + + Position.CENTER -> RoundedCornerShape(0.dp) + + Position.SOLO -> largeShape + + Position.BOTTOM -> largeShape.copy( + topStart = CornerSize(0.dp), + topEnd = CornerSize(0.dp) + ) + } + } + val paddingValues = remember(position) { + when (position) { + Position.TOP -> PaddingValues(bottom = 1.dp) + Position.CENTER -> PaddingValues(vertical = 1.dp) + Position.SOLO -> PaddingValues(0.dp) + Position.BOTTOM -> PaddingValues(top = 1.dp) + } + } + + Box( + modifier = Modifier + .padding(paddingValues) + .fillMaxWidth() + .padding(horizontal = 18.dp) + .clip(shape = shape) + .background( + if (primary) MaterialTheme.colorScheme.primaryContainer + else MaterialTheme.colorScheme.surfaceContainer + ) + .clickable { + onClick() + } + .padding(horizontal = 18.dp, vertical = 18.dp), + contentAlignment = Alignment.Center + ) { + Text( + text = title, + style = MaterialTheme.typography.labelLarge, + color = if (primary) MaterialTheme.colorScheme.onPrimaryContainer + else MaterialTheme.colorScheme.onSurface, + overflow = TextOverflow.Ellipsis + ) + } +} \ No newline at end of file diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/about/AboutScreen.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/about/AboutScreen.kt index d3e92904..2415fa09 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/about/AboutScreen.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/about/AboutScreen.kt @@ -33,7 +33,7 @@ import ua.acclorite.book_story.presentation.core.components.GoBackButton import ua.acclorite.book_story.presentation.core.components.LocalAboutViewModel import ua.acclorite.book_story.presentation.core.components.collapsibleUntilExitScrollBehaviorWithLazyListState import ua.acclorite.book_story.presentation.core.constants.Constants -import ua.acclorite.book_story.presentation.core.navigation.LocalOnNavigate +import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator import ua.acclorite.book_story.presentation.core.navigation.Screen import ua.acclorite.book_story.presentation.core.util.showToast import ua.acclorite.book_story.presentation.screens.about.components.AboutItem @@ -51,7 +51,7 @@ fun AboutScreenRoot() { private fun AboutScreen() { val state = LocalAboutViewModel.current.state val onEvent = LocalAboutViewModel.current.onEvent - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current val context = LocalContext.current val scrollState = TopAppBarDefaults.collapsibleUntilExitScrollBehaviorWithLazyListState() diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/about/nested/credits/CreditsScreen.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/about/nested/credits/CreditsScreen.kt index 14ef6eb6..3e0d6e39 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/about/nested/credits/CreditsScreen.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/about/nested/credits/CreditsScreen.kt @@ -23,7 +23,7 @@ import ua.acclorite.book_story.presentation.core.components.LocalAboutViewModel import ua.acclorite.book_story.presentation.core.components.collapsibleUntilExitScrollBehaviorWithLazyListState import ua.acclorite.book_story.presentation.core.components.customItems import ua.acclorite.book_story.presentation.core.constants.Constants -import ua.acclorite.book_story.presentation.core.navigation.LocalOnNavigate +import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator import ua.acclorite.book_story.presentation.core.util.showToast import ua.acclorite.book_story.presentation.screens.about.data.AboutEvent import ua.acclorite.book_story.presentation.screens.about.nested.credits.components.CreditItem @@ -37,7 +37,7 @@ fun CreditsScreenRoot() { @Composable private fun CreditsScreen() { val onEvent = LocalAboutViewModel.current.onEvent - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current val context = LocalContext.current val scrollState = TopAppBarDefaults.collapsibleUntilExitScrollBehaviorWithLazyListState() diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/about/nested/license_info/LicenseInfoScreen.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/about/nested/license_info/LicenseInfoScreen.kt index 20f64192..8df10a14 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/about/nested/license_info/LicenseInfoScreen.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/about/nested/license_info/LicenseInfoScreen.kt @@ -38,7 +38,7 @@ import ua.acclorite.book_story.presentation.core.components.GoBackButton import ua.acclorite.book_story.presentation.core.components.LocalLicenseInfoViewModel import ua.acclorite.book_story.presentation.core.components.collapsibleUntilExitScrollBehaviorWithLazyListState import ua.acclorite.book_story.presentation.core.components.customItems -import ua.acclorite.book_story.presentation.core.navigation.LocalOnNavigate +import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator import ua.acclorite.book_story.presentation.core.navigation.Screen import ua.acclorite.book_story.presentation.core.util.showToast import ua.acclorite.book_story.presentation.screens.about.nested.license_info.data.LicenseInfoEvent @@ -48,7 +48,7 @@ import ua.acclorite.book_story.presentation.ui.SlidingTransition @Composable fun LicenseInfoScreenRoot(screen: Screen.About.LicenseInfo) { val viewModel = LocalLicenseInfoViewModel.current.viewModel - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current val context = LocalContext.current LaunchedEffect(Unit) { @@ -68,7 +68,7 @@ private fun LicenseInfoScreen() { val state = LocalLicenseInfoViewModel.current.state val onEvent = LocalLicenseInfoViewModel.current.onEvent val context = LocalContext.current - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current val scrollState = TopAppBarDefaults.collapsibleUntilExitScrollBehaviorWithLazyListState() val licenses = remember(state.value.license?.licenses) { diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/about/nested/licenses/LicensesScreen.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/about/nested/licenses/LicensesScreen.kt index 1a6987d5..94553d03 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/about/nested/licenses/LicensesScreen.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/about/nested/licenses/LicensesScreen.kt @@ -30,7 +30,7 @@ import ua.acclorite.book_story.presentation.core.components.GoBackButton import ua.acclorite.book_story.presentation.core.components.LocalLicensesViewModel import ua.acclorite.book_story.presentation.core.components.collapsibleUntilExitScrollBehaviorWithLazyListState import ua.acclorite.book_story.presentation.core.components.customItems -import ua.acclorite.book_story.presentation.core.navigation.LocalOnNavigate +import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator import ua.acclorite.book_story.presentation.core.navigation.Screen import ua.acclorite.book_story.presentation.screens.about.nested.licenses.components.LicenseItem @@ -50,7 +50,7 @@ fun LicensesScreenRoot() { @Composable private fun LicensesScreen() { val state = LocalLicensesViewModel.current.state - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current val scrollState = TopAppBarDefaults.collapsibleUntilExitScrollBehaviorWithLazyListState( state.value.listState diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/BookInfoScreen.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/BookInfoScreen.kt index fcf8b19c..e3fbbbae 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/BookInfoScreen.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/BookInfoScreen.kt @@ -47,11 +47,12 @@ import ua.acclorite.book_story.R import ua.acclorite.book_story.presentation.core.components.CustomAnimatedVisibility import ua.acclorite.book_story.presentation.core.components.CustomSnackbar import ua.acclorite.book_story.presentation.core.components.LocalBookInfoViewModel -import ua.acclorite.book_story.presentation.core.navigation.LocalOnNavigate +import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator import ua.acclorite.book_story.presentation.core.navigation.Screen import ua.acclorite.book_story.presentation.screens.book_info.components.BookInfoBackground import ua.acclorite.book_story.presentation.screens.book_info.components.BookInfoDescriptionSection import ua.acclorite.book_story.presentation.screens.book_info.components.BookInfoInfoSection +import ua.acclorite.book_story.presentation.screens.book_info.components.BookInfoMoreBottomSheet import ua.acclorite.book_story.presentation.screens.book_info.components.BookInfoStatisticSection import ua.acclorite.book_story.presentation.screens.book_info.components.BookInfoTopBar import ua.acclorite.book_story.presentation.screens.book_info.components.change_cover_bottom_sheet.BookInfoChangeCoverBottomSheet @@ -64,7 +65,7 @@ import ua.acclorite.book_story.presentation.screens.book_info.data.BookInfoEvent @Composable fun BookInfoScreenRoot(screen: Screen.BookInfo) { val viewModel = LocalBookInfoViewModel.current.viewModel - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current val context = LocalContext.current val snackbarState = remember { SnackbarHostState() } @@ -95,7 +96,7 @@ private fun BookInfoScreen(snackbarState: SnackbarHostState) { val context = LocalContext.current val state = LocalBookInfoViewModel.current.state val onEvent = LocalBookInfoViewModel.current.onEvent - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current val listState = rememberLazyListState() val refreshState = rememberPullRefreshState( @@ -125,6 +126,9 @@ private fun BookInfoScreen(snackbarState: SnackbarHostState) { if (state.value.showConfirmTextUpdateDialog) { BookInfoConfirmUpdateDialog(snackbarHostState = snackbarState) } + if (state.value.showMoreBottomSheet) { + BookInfoMoreBottomSheet(snackbarState = snackbarState) + } Scaffold( Modifier diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/components/BookInfoMoreBottomSheet.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/components/BookInfoMoreBottomSheet.kt new file mode 100644 index 00000000..9ccaccb1 --- /dev/null +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/components/BookInfoMoreBottomSheet.kt @@ -0,0 +1,76 @@ +package ua.acclorite.book_story.presentation.screens.book_info.components + +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.material3.SnackbarHostState +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp +import ua.acclorite.book_story.R +import ua.acclorite.book_story.domain.util.Position +import ua.acclorite.book_story.presentation.core.components.LocalBookInfoViewModel +import ua.acclorite.book_story.presentation.core.components.custom_bottom_sheet.CustomBottomSheet +import ua.acclorite.book_story.presentation.core.navigation.NavigationItem +import ua.acclorite.book_story.presentation.screens.book_info.data.BookInfoEvent + +/** + * Book Info More Bottom Sheet. + * Replaces DropDown. + * + * @param snackbarState [SnackbarHostState]. + */ +@Composable +fun BookInfoMoreBottomSheet(snackbarState: SnackbarHostState) { + val onEvent = LocalBookInfoViewModel.current.onEvent + + CustomBottomSheet( + modifier = Modifier.fillMaxWidth(), + onDismissRequest = { + onEvent(BookInfoEvent.OnShowHideMoreBottomSheet(false)) + } + ) { + LazyColumn(Modifier.fillMaxWidth()) { + item { + NavigationItem( + title = stringResource(id = R.string.details_book), + primary = false, + position = Position.SOLO + ) { + snackbarState.currentSnackbarData?.dismiss() + onEvent(BookInfoEvent.OnShowHideDetailsBottomSheet) + } + } + + item { + Spacer(Modifier.height(18.dp)) + } + + item { + NavigationItem( + title = stringResource(id = R.string.delete_this_book), + primary = true, + position = Position.TOP + ) { + onEvent(BookInfoEvent.OnShowHideDeleteDialog) + } + } + + item { + NavigationItem( + title = stringResource(id = R.string.move_this_book), + primary = true, + position = Position.BOTTOM + ) { + onEvent(BookInfoEvent.OnShowHideMoveDialog) + } + } + + item { + Spacer(modifier = Modifier.height(8.dp)) + } + } + } +} \ No newline at end of file diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/components/BookInfoMoreDropDown.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/components/BookInfoMoreDropDown.kt deleted file mode 100644 index 1f42134e..00000000 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/components/BookInfoMoreDropDown.kt +++ /dev/null @@ -1,77 +0,0 @@ -package ua.acclorite.book_story.presentation.screens.book_info.components - -import androidx.compose.foundation.layout.Box -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.automirrored.outlined.DriveFileMove -import androidx.compose.material.icons.outlined.Delete -import androidx.compose.material.icons.outlined.Info -import androidx.compose.material.icons.outlined.MoreVert -import androidx.compose.material3.DropdownMenu -import androidx.compose.material3.SnackbarHostState -import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateOf -import androidx.compose.runtime.remember -import androidx.compose.runtime.setValue -import androidx.compose.ui.res.stringResource -import androidx.compose.ui.unit.DpOffset -import androidx.compose.ui.unit.dp -import ua.acclorite.book_story.R -import ua.acclorite.book_story.presentation.core.components.CustomDropDownMenuItem -import ua.acclorite.book_story.presentation.core.components.CustomIconButton -import ua.acclorite.book_story.presentation.core.components.LocalBookInfoViewModel -import ua.acclorite.book_story.presentation.screens.book_info.data.BookInfoEvent - -/** - * Book info more dropdown. Has three options: Delete, Move and Details. - */ -@Composable -fun BookInfoMoreDropDown(snackbarState: SnackbarHostState) { - val state = LocalBookInfoViewModel.current.state - val onEvent = LocalBookInfoViewModel.current.onEvent - - var showDropDown by remember { mutableStateOf(false) } - - Box { - CustomIconButton( - icon = Icons.Outlined.MoreVert, - contentDescription = R.string.show_dropdown_content_desc, - disableOnClick = false, - enabled = !showDropDown && - !state.value.updating - ) { - showDropDown = true - } - - DropdownMenu( - expanded = showDropDown, - onDismissRequest = { - showDropDown = false - }, - offset = DpOffset((-15).dp, 0.dp) - ) { - CustomDropDownMenuItem( - leadingIcon = Icons.AutoMirrored.Outlined.DriveFileMove, - text = stringResource(id = R.string.move_this_book) - ) { - onEvent(BookInfoEvent.OnShowHideMoveDialog) - showDropDown = false - } - CustomDropDownMenuItem( - leadingIcon = Icons.Outlined.Delete, - text = stringResource(id = R.string.delete_this_book) - ) { - onEvent(BookInfoEvent.OnShowHideDeleteDialog) - showDropDown = false - } - CustomDropDownMenuItem( - leadingIcon = Icons.Outlined.Info, - text = stringResource(id = R.string.details_book) - ) { - snackbarState.currentSnackbarData?.dismiss() - onEvent(BookInfoEvent.OnShowHideDetailsBottomSheet) - showDropDown = false - } - } - } -} \ No newline at end of file diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/components/BookInfoTopBar.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/components/BookInfoTopBar.kt index 5d871ee2..5a4da233 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/components/BookInfoTopBar.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/components/BookInfoTopBar.kt @@ -27,7 +27,8 @@ import ua.acclorite.book_story.presentation.core.components.GoBackButton import ua.acclorite.book_story.presentation.core.components.LocalBookInfoViewModel import ua.acclorite.book_story.presentation.core.components.LocalHistoryViewModel import ua.acclorite.book_story.presentation.core.components.LocalLibraryViewModel -import ua.acclorite.book_story.presentation.core.navigation.LocalOnNavigate +import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator +import ua.acclorite.book_story.presentation.core.navigation.NavigationIconButton import ua.acclorite.book_story.presentation.screens.book_info.data.BookInfoEvent import ua.acclorite.book_story.presentation.screens.history.data.HistoryEvent import ua.acclorite.book_story.presentation.screens.library.data.LibraryEvent @@ -50,7 +51,7 @@ fun BookInfoTopBar( val onEvent = LocalBookInfoViewModel.current.onEvent val onLibraryEvent = LocalLibraryViewModel.current.onEvent val onHistoryEvent = LocalHistoryViewModel.current.onEvent - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current val context = LocalContext.current val firstVisibleItemIndex by remember { derivedStateOf { listState.firstVisibleItemIndex } } @@ -127,7 +128,9 @@ fun BookInfoTopBar( !state.value.editAuthor && !state.value.editDescription ) { - BookInfoMoreDropDown(snackbarState = snackbarState) + NavigationIconButton { + onEvent(BookInfoEvent.OnShowHideMoreBottomSheet(true)) + } } CustomAnimatedVisibility( visible = state.value.editTitle || diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/components/dialog/BookInfoDeleteDialog.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/components/dialog/BookInfoDeleteDialog.kt index bf30fcfb..77f04aea 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/components/dialog/BookInfoDeleteDialog.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/components/dialog/BookInfoDeleteDialog.kt @@ -11,7 +11,7 @@ import ua.acclorite.book_story.presentation.core.components.LocalBrowseViewModel import ua.acclorite.book_story.presentation.core.components.LocalHistoryViewModel import ua.acclorite.book_story.presentation.core.components.LocalLibraryViewModel import ua.acclorite.book_story.presentation.core.components.custom_dialog.CustomDialogWithContent -import ua.acclorite.book_story.presentation.core.navigation.LocalOnNavigate +import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator import ua.acclorite.book_story.presentation.core.util.showToast import ua.acclorite.book_story.presentation.screens.book_info.data.BookInfoEvent import ua.acclorite.book_story.presentation.screens.browse.data.BrowseEvent @@ -27,7 +27,7 @@ fun BookInfoDeleteDialog() { val onLibraryEvent = LocalLibraryViewModel.current.onEvent val onHistoryEvent = LocalHistoryViewModel.current.onEvent val onBrowseEvent = LocalBrowseViewModel.current.onEvent - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current val context = LocalContext.current CustomDialogWithContent( @@ -51,6 +51,7 @@ fun BookInfoDeleteDialog() { } ) ) + onEvent(BookInfoEvent.OnShowHideMoreBottomSheet(false)) context.getString(R.string.book_deleted) .showToast(context = context) } diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/components/dialog/BookInfoMoveDialog.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/components/dialog/BookInfoMoveDialog.kt index d177ce60..8c8894d1 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/components/dialog/BookInfoMoveDialog.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/components/dialog/BookInfoMoveDialog.kt @@ -15,7 +15,7 @@ import ua.acclorite.book_story.presentation.core.components.LocalLibraryViewMode import ua.acclorite.book_story.presentation.core.components.customItems import ua.acclorite.book_story.presentation.core.components.custom_dialog.CustomDialogWithLazyColumn import ua.acclorite.book_story.presentation.core.components.custom_dialog.SelectableDialogItem -import ua.acclorite.book_story.presentation.core.navigation.LocalOnNavigate +import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator import ua.acclorite.book_story.presentation.core.util.showToast import ua.acclorite.book_story.presentation.screens.book_info.data.BookInfoEvent import ua.acclorite.book_story.presentation.screens.history.data.HistoryEvent @@ -31,7 +31,7 @@ fun BookInfoMoveDialog() { val onEvent = LocalBookInfoViewModel.current.onEvent val onLibraryEvent = LocalLibraryViewModel.current.onEvent val onHistoryEvent = LocalHistoryViewModel.current.onEvent - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current val context = LocalContext.current val categories = remember { @@ -64,6 +64,7 @@ fun BookInfoMoveDialog() { onNavigate = onNavigate ) ) + onEvent(BookInfoEvent.OnShowHideMoreBottomSheet(false)) context.getString(R.string.book_moved) .showToast(context = context) }, diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/data/BookInfoEvent.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/data/BookInfoEvent.kt index 9594f942..df5ba26d 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/data/BookInfoEvent.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/data/BookInfoEvent.kt @@ -124,4 +124,6 @@ sealed class BookInfoEvent { val context: Context, val refreshList: (Book) -> Unit ) : BookInfoEvent() + + data class OnShowHideMoreBottomSheet(val show: Boolean) : BookInfoEvent() } \ No newline at end of file diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/data/BookInfoState.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/data/BookInfoState.kt index 37bb27b7..5fd77105 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/data/BookInfoState.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/data/BookInfoState.kt @@ -37,4 +37,6 @@ data class BookInfoState( val showDeleteDialog: Boolean = false, val showMoveDialog: Boolean = false, val selectedCategory: Category = Category.READING, + + val showMoreBottomSheet: Boolean = false, ) diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/data/BookInfoViewModel.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/data/BookInfoViewModel.kt index 2f4c0b8d..eea70b22 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/data/BookInfoViewModel.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/data/BookInfoViewModel.kt @@ -728,6 +728,14 @@ class BookInfoViewModel @Inject constructor( } } } + + is BookInfoEvent.OnShowHideMoreBottomSheet -> { + _state.update { + it.copy( + showMoreBottomSheet = event.show + ) + } + } } } } diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/browse/BrowseScreen.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/browse/BrowseScreen.kt index e1993b2c..8aa9516e 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/browse/BrowseScreen.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/browse/BrowseScreen.kt @@ -26,7 +26,7 @@ import ua.acclorite.book_story.R import ua.acclorite.book_story.domain.model.SelectableFile import ua.acclorite.book_story.presentation.core.components.LocalBrowseViewModel import ua.acclorite.book_story.presentation.core.components.LocalMainViewModel -import ua.acclorite.book_story.presentation.core.navigation.LocalOnNavigate +import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator import ua.acclorite.book_story.presentation.core.navigation.Screen import ua.acclorite.book_story.presentation.core.util.showToast import ua.acclorite.book_story.presentation.screens.browse.components.BrowseEmptyPlaceholder @@ -89,7 +89,7 @@ private fun BrowseScreen( val state = LocalBrowseViewModel.current.state val mainState = LocalMainViewModel.current.state val onEvent = LocalBrowseViewModel.current.onEvent - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current val context = LocalContext.current val refreshState = rememberPullRefreshState( diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/browse/components/BrowseEmptyPlaceholder.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/browse/components/BrowseEmptyPlaceholder.kt index 7a6f1964..dc9b4a14 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/browse/components/BrowseEmptyPlaceholder.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/browse/components/BrowseEmptyPlaceholder.kt @@ -13,7 +13,7 @@ import ua.acclorite.book_story.presentation.core.components.CustomAnimatedVisibi import ua.acclorite.book_story.presentation.core.components.LocalBrowseViewModel import ua.acclorite.book_story.presentation.core.components.is_messages.IsEmpty import ua.acclorite.book_story.presentation.core.components.is_messages.IsError -import ua.acclorite.book_story.presentation.core.navigation.LocalOnNavigate +import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator import ua.acclorite.book_story.presentation.core.navigation.Screen import ua.acclorite.book_story.presentation.screens.browse.data.BrowseEvent import ua.acclorite.book_story.presentation.ui.Transitions @@ -33,7 +33,7 @@ fun BoxScope.BrowseEmptyPlaceholder( ) { val state = LocalBrowseViewModel.current.state val onEvent = LocalBrowseViewModel.current.onEvent - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current CustomAnimatedVisibility( visible = state.value.isError, diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/browse/components/adding_dialog/BrowseAddingDialog.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/browse/components/adding_dialog/BrowseAddingDialog.kt index b7ef85f4..127a8a05 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/browse/components/adding_dialog/BrowseAddingDialog.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/browse/components/adding_dialog/BrowseAddingDialog.kt @@ -21,7 +21,7 @@ import ua.acclorite.book_story.presentation.core.components.LocalBrowseViewModel import ua.acclorite.book_story.presentation.core.components.LocalLibraryViewModel import ua.acclorite.book_story.presentation.core.components.customItems import ua.acclorite.book_story.presentation.core.components.custom_dialog.CustomDialogWithLazyColumn -import ua.acclorite.book_story.presentation.core.navigation.LocalOnNavigate +import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator import ua.acclorite.book_story.presentation.core.util.showToast import ua.acclorite.book_story.presentation.screens.browse.data.BrowseEvent import ua.acclorite.book_story.presentation.screens.library.data.LibraryEvent @@ -36,7 +36,7 @@ fun BrowseAddingDialog() { val state = LocalBrowseViewModel.current.state val onEvent = LocalBrowseViewModel.current.onEvent val onLibraryEvent = LocalLibraryViewModel.current.onEvent - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current CustomDialogWithLazyColumn( title = stringResource(id = R.string.add_books), diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/browse/components/top_bar/BrowseTopBar.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/browse/components/top_bar/BrowseTopBar.kt index ebe81d37..aeee6597 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/browse/components/top_bar/BrowseTopBar.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/browse/components/top_bar/BrowseTopBar.kt @@ -31,7 +31,7 @@ import ua.acclorite.book_story.presentation.core.components.CustomIconButton import ua.acclorite.book_story.presentation.core.components.CustomSearchTextField import ua.acclorite.book_story.presentation.core.components.LocalBrowseViewModel import ua.acclorite.book_story.presentation.core.components.LocalMainViewModel -import ua.acclorite.book_story.presentation.core.components.MoreDropDown +import ua.acclorite.book_story.presentation.core.navigation.NavigationIconButton import ua.acclorite.book_story.presentation.screens.browse.data.BrowseEvent import ua.acclorite.book_story.presentation.screens.settings.nested.browse.data.BrowseFilesStructure import ua.acclorite.book_story.presentation.screens.settings.nested.browse.data.BrowseLayout @@ -119,7 +119,7 @@ fun BrowseTopBar(filteredFiles: List) { ) { onEvent(BrowseEvent.OnShowHideFilterBottomSheet) } - MoreDropDown() + NavigationIconButton() } ), @@ -164,7 +164,7 @@ fun BrowseTopBar(filteredFiles: List) { ) { onEvent(BrowseEvent.OnShowHideFilterBottomSheet) } - MoreDropDown() + NavigationIconButton() } ), @@ -200,7 +200,7 @@ fun BrowseTopBar(filteredFiles: List) { ) }, contentActions = { - MoreDropDown() + NavigationIconButton() } ), diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/help/HelpScreen.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/help/HelpScreen.kt index 29589c1d..c8cadfb9 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/help/HelpScreen.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/help/HelpScreen.kt @@ -37,7 +37,7 @@ import ua.acclorite.book_story.presentation.core.components.LocalStartViewModel import ua.acclorite.book_story.presentation.core.components.collapsibleUntilExitScrollBehaviorWithLazyListState import ua.acclorite.book_story.presentation.core.components.customItems import ua.acclorite.book_story.presentation.core.constants.Constants -import ua.acclorite.book_story.presentation.core.navigation.LocalOnNavigate +import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator import ua.acclorite.book_story.presentation.core.navigation.Screen import ua.acclorite.book_story.presentation.data.MainEvent import ua.acclorite.book_story.presentation.screens.browse.data.BrowseEvent @@ -65,7 +65,7 @@ private fun HelpScreen() { val onMainEvent = LocalMainViewModel.current.onEvent val onBrowseEvent = LocalBrowseViewModel.current.onEvent val onStartEvent = LocalStartViewModel.current.onEvent - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current val scrollState = TopAppBarDefaults.collapsibleUntilExitScrollBehaviorWithLazyListState() diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/help/components/HelpItem.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/help/components/HelpItem.kt index 73497025..9fc058aa 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/help/components/HelpItem.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/help/components/HelpItem.kt @@ -30,7 +30,7 @@ import androidx.compose.ui.text.buildAnnotatedString import androidx.compose.ui.unit.dp import ua.acclorite.book_story.R import ua.acclorite.book_story.domain.model.HelpTip -import ua.acclorite.book_story.presentation.core.navigation.LocalOnNavigate +import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator import ua.acclorite.book_story.presentation.core.util.noRippleClickable import ua.acclorite.book_story.presentation.ui.ExpandingTransition @@ -46,7 +46,7 @@ fun HelpItem( helpTip: HelpTip, fromStart: Boolean ) { - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current val showDescription = rememberSaveable { mutableStateOf(false) diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/history/HistoryScreen.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/history/HistoryScreen.kt index 78728f26..4bc21860 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/history/HistoryScreen.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/history/HistoryScreen.kt @@ -44,10 +44,10 @@ import ua.acclorite.book_story.presentation.core.components.CustomSearchTextFiel import ua.acclorite.book_story.presentation.core.components.CustomSnackbar import ua.acclorite.book_story.presentation.core.components.LocalHistoryViewModel import ua.acclorite.book_story.presentation.core.components.LocalLibraryViewModel -import ua.acclorite.book_story.presentation.core.components.MoreDropDown import ua.acclorite.book_story.presentation.core.components.customItems import ua.acclorite.book_story.presentation.core.components.is_messages.IsEmpty -import ua.acclorite.book_story.presentation.core.navigation.LocalOnNavigate +import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator +import ua.acclorite.book_story.presentation.core.navigation.NavigationIconButton import ua.acclorite.book_story.presentation.core.navigation.Screen import ua.acclorite.book_story.presentation.screens.history.components.HistoryDeleteWholeHistoryDialog import ua.acclorite.book_story.presentation.screens.history.components.HistoryItem @@ -77,7 +77,7 @@ private fun HistoryScreen() { val state = LocalHistoryViewModel.current.state val onEvent = LocalHistoryViewModel.current.onEvent val onLibraryEvent = LocalLibraryViewModel.current.onEvent - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current val refreshState = rememberPullRefreshState( refreshing = state.value.isRefreshing, @@ -132,7 +132,7 @@ private fun HistoryScreen() { ) { onEvent(HistoryEvent.OnShowHideDeleteWholeHistoryDialog) } - MoreDropDown() + NavigationIconButton() } ), @@ -168,7 +168,7 @@ private fun HistoryScreen() { ) }, contentActions = { - MoreDropDown() + NavigationIconButton() }, ) ) diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/library/LibraryScreen.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/library/LibraryScreen.kt index 9317c68a..46e6bb31 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/library/LibraryScreen.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/library/LibraryScreen.kt @@ -51,7 +51,7 @@ import ua.acclorite.book_story.presentation.core.components.LocalMainViewModel import ua.acclorite.book_story.presentation.core.components.customItems import ua.acclorite.book_story.presentation.core.components.header import ua.acclorite.book_story.presentation.core.components.is_messages.IsEmpty -import ua.acclorite.book_story.presentation.core.navigation.LocalOnNavigate +import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator import ua.acclorite.book_story.presentation.core.navigation.Screen import ua.acclorite.book_story.presentation.core.util.showToast import ua.acclorite.book_story.presentation.screens.library.components.LibraryBookItem @@ -102,7 +102,7 @@ private fun LibraryScreen( val state = LocalLibraryViewModel.current.state val mainState = LocalMainViewModel.current.state val onEvent = LocalLibraryViewModel.current.onEvent - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current var isScrollInProgress by remember { mutableStateOf(false) } diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/library/components/LibraryTopBar.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/library/components/LibraryTopBar.kt index 7e16065d..dfc97c16 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/library/components/LibraryTopBar.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/library/components/LibraryTopBar.kt @@ -36,7 +36,7 @@ import ua.acclorite.book_story.presentation.core.components.AnimatedTopAppBarDat import ua.acclorite.book_story.presentation.core.components.CustomIconButton import ua.acclorite.book_story.presentation.core.components.CustomSearchTextField import ua.acclorite.book_story.presentation.core.components.LocalLibraryViewModel -import ua.acclorite.book_story.presentation.core.components.MoreDropDown +import ua.acclorite.book_story.presentation.core.navigation.NavigationIconButton import ua.acclorite.book_story.presentation.screens.library.data.LibraryEvent /** @@ -90,7 +90,7 @@ fun LibraryTopBar(pagerState: PagerState) { ) { onEvent(LibraryEvent.OnSearchShowHide) } - MoreDropDown() + NavigationIconButton() } ), @@ -128,7 +128,7 @@ fun LibraryTopBar(pagerState: PagerState) { ) }, contentActions = { - MoreDropDown() + NavigationIconButton() }, ), diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/reader/ReaderScreen.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/reader/ReaderScreen.kt index 62836187..4e1173fe 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/reader/ReaderScreen.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/reader/ReaderScreen.kt @@ -68,7 +68,7 @@ import ua.acclorite.book_story.presentation.core.components.LocalSettingsViewMod import ua.acclorite.book_story.presentation.core.components.customItemsIndexed import ua.acclorite.book_story.presentation.core.components.is_messages.IsError import ua.acclorite.book_story.presentation.core.constants.Constants -import ua.acclorite.book_story.presentation.core.navigation.LocalOnNavigate +import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator import ua.acclorite.book_story.presentation.core.navigation.Screen import ua.acclorite.book_story.presentation.core.util.noRippleClickable import ua.acclorite.book_story.presentation.core.util.showToast @@ -94,7 +94,7 @@ fun ReaderScreenRoot(screen: Screen.Reader) { val onHistoryEvent = LocalHistoryViewModel.current.onEvent val viewModel = LocalReaderViewModel.current.viewModel val context = LocalContext.current as ComponentActivity - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current val lazyListState = rememberSaveable( @@ -202,7 +202,7 @@ private fun ReaderScreen(lazyListState: LazyListState) { val onLibraryEvent = LocalLibraryViewModel.current.onEvent val onHistoryEvent = LocalHistoryViewModel.current.onEvent val context = LocalContext.current as ComponentActivity - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current val nestedScrollConnection = remember(state) { object : NestedScrollConnection { diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/reader/components/ReaderUpdateDialog.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/reader/components/ReaderUpdateDialog.kt index a5ee05be..00dbe6fa 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/reader/components/ReaderUpdateDialog.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/reader/components/ReaderUpdateDialog.kt @@ -9,7 +9,7 @@ import androidx.compose.ui.res.stringResource import ua.acclorite.book_story.R import ua.acclorite.book_story.presentation.core.components.LocalReaderViewModel import ua.acclorite.book_story.presentation.core.components.custom_dialog.CustomDialogWithContent -import ua.acclorite.book_story.presentation.core.navigation.LocalOnNavigate +import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator import ua.acclorite.book_story.presentation.screens.reader.data.ReaderEvent /** @@ -19,7 +19,7 @@ import ua.acclorite.book_story.presentation.screens.reader.data.ReaderEvent @Composable fun ReaderUpdateDialog() { val onEvent = LocalReaderViewModel.current.onEvent - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current val context = LocalContext.current CustomDialogWithContent( diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/reader/components/app_bar/ReaderTopBar.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/reader/components/app_bar/ReaderTopBar.kt index b54a6ca4..9180acfe 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/reader/components/app_bar/ReaderTopBar.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/reader/components/app_bar/ReaderTopBar.kt @@ -42,7 +42,7 @@ import ua.acclorite.book_story.presentation.core.components.LocalHistoryViewMode import ua.acclorite.book_story.presentation.core.components.LocalLibraryViewModel import ua.acclorite.book_story.presentation.core.components.LocalMainViewModel import ua.acclorite.book_story.presentation.core.components.LocalReaderViewModel -import ua.acclorite.book_story.presentation.core.navigation.LocalOnNavigate +import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator import ua.acclorite.book_story.presentation.core.navigation.Screen import ua.acclorite.book_story.presentation.core.util.noRippleClickable import ua.acclorite.book_story.presentation.core.util.showToast @@ -64,7 +64,7 @@ fun ReaderTopBar() { val onLibraryEvent = LocalLibraryViewModel.current.onEvent val onHistoryEvent = LocalHistoryViewModel.current.onEvent val context = LocalContext.current as ComponentActivity - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current val animatedChapterProgress = animateFloatAsState( targetValue = state.value.currentChapterProgress diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/settings/SettingsScreen.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/settings/SettingsScreen.kt index c724e941..952f4dfa 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/settings/SettingsScreen.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/settings/SettingsScreen.kt @@ -27,7 +27,7 @@ import ua.acclorite.book_story.R import ua.acclorite.book_story.presentation.core.components.CustomLazyColumn import ua.acclorite.book_story.presentation.core.components.GoBackButton import ua.acclorite.book_story.presentation.core.components.collapsibleUntilExitScrollBehaviorWithLazyListState -import ua.acclorite.book_story.presentation.core.navigation.LocalOnNavigate +import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator import ua.acclorite.book_story.presentation.core.navigation.Screen import ua.acclorite.book_story.presentation.screens.settings.components.SettingsCategoryItem @@ -39,7 +39,7 @@ fun SettingsScreenRoot() { @OptIn(ExperimentalMaterial3Api::class) @Composable private fun SettingsScreen() { - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current val scrollState = TopAppBarDefaults.collapsibleUntilExitScrollBehaviorWithLazyListState() Scaffold( diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/settings/nested/appearance/AppearanceSettings.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/settings/nested/appearance/AppearanceSettings.kt index 93a03496..bec41193 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/settings/nested/appearance/AppearanceSettings.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/settings/nested/appearance/AppearanceSettings.kt @@ -20,7 +20,7 @@ import ua.acclorite.book_story.R import ua.acclorite.book_story.presentation.core.components.CustomLazyColumn import ua.acclorite.book_story.presentation.core.components.GoBackButton import ua.acclorite.book_story.presentation.core.components.collapsibleUntilExitScrollBehaviorWithLazyListState -import ua.acclorite.book_story.presentation.core.navigation.LocalOnNavigate +import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator import ua.acclorite.book_story.presentation.screens.settings.nested.appearance.components.AppearanceSettingsCategory @Composable @@ -31,7 +31,7 @@ fun AppearanceSettingsRoot() { @OptIn(ExperimentalMaterial3Api::class) @Composable private fun AppearanceSettings() { - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current val scrollState = TopAppBarDefaults.collapsibleUntilExitScrollBehaviorWithLazyListState() Scaffold( diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/settings/nested/browse/BrowseSettings.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/settings/nested/browse/BrowseSettings.kt index 31afa646..3bd72268 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/settings/nested/browse/BrowseSettings.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/settings/nested/browse/BrowseSettings.kt @@ -20,7 +20,7 @@ import ua.acclorite.book_story.R import ua.acclorite.book_story.presentation.core.components.CustomLazyColumn import ua.acclorite.book_story.presentation.core.components.GoBackButton import ua.acclorite.book_story.presentation.core.components.collapsibleUntilExitScrollBehaviorWithLazyListState -import ua.acclorite.book_story.presentation.core.navigation.LocalOnNavigate +import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator import ua.acclorite.book_story.presentation.screens.settings.nested.browse.components.BrowseSettingsCategory @Composable @@ -31,7 +31,7 @@ fun BrowseSettingsRoot() { @OptIn(ExperimentalMaterial3Api::class) @Composable private fun BrowseSettings() { - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current val scrollState = TopAppBarDefaults.collapsibleUntilExitScrollBehaviorWithLazyListState() Scaffold( diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/settings/nested/general/GeneralSettings.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/settings/nested/general/GeneralSettings.kt index aea1f17b..ea8e34e5 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/settings/nested/general/GeneralSettings.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/settings/nested/general/GeneralSettings.kt @@ -19,7 +19,7 @@ import ua.acclorite.book_story.R import ua.acclorite.book_story.presentation.core.components.CustomLazyColumn import ua.acclorite.book_story.presentation.core.components.GoBackButton import ua.acclorite.book_story.presentation.core.components.collapsibleUntilExitScrollBehaviorWithLazyListState -import ua.acclorite.book_story.presentation.core.navigation.LocalOnNavigate +import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator import ua.acclorite.book_story.presentation.screens.settings.nested.general.components.GeneralSettingsCategory @Composable @@ -31,7 +31,7 @@ fun GeneralSettingsRoot() { @OptIn(ExperimentalMaterial3Api::class) @Composable private fun GeneralSettings() { - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current val scrollState = TopAppBarDefaults.collapsibleUntilExitScrollBehaviorWithLazyListState() Scaffold( diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/settings/nested/reader/ReaderSettings.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/settings/nested/reader/ReaderSettings.kt index 13c562c3..8fc70a5d 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/settings/nested/reader/ReaderSettings.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/settings/nested/reader/ReaderSettings.kt @@ -19,7 +19,7 @@ import ua.acclorite.book_story.R import ua.acclorite.book_story.presentation.core.components.CustomLazyColumn import ua.acclorite.book_story.presentation.core.components.GoBackButton import ua.acclorite.book_story.presentation.core.components.collapsibleUntilExitScrollBehaviorWithLazyListState -import ua.acclorite.book_story.presentation.core.navigation.LocalOnNavigate +import ua.acclorite.book_story.presentation.core.navigation.LocalNavigator import ua.acclorite.book_story.presentation.screens.settings.nested.reader.components.ReaderSettingsCategory @Composable @@ -30,7 +30,7 @@ fun ReaderSettingsRoot() { @OptIn(ExperimentalMaterial3Api::class) @Composable private fun ReaderSettings() { - val onNavigate = LocalOnNavigate.current + val onNavigate = LocalNavigator.current val scrollState = TopAppBarDefaults.collapsibleUntilExitScrollBehaviorWithLazyListState() Scaffold( diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/start/components/StartDone.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/start/components/StartDone.kt index 964bf077..36c1f3ce 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/start/components/StartDone.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/start/components/StartDone.kt @@ -44,7 +44,7 @@ fun StartDone() { val onEvent = LocalStartViewModel.current.onEvent val onMainEvent = LocalMainViewModel.current.onEvent val onBrowseEvent = LocalBrowseViewModel.current.onEvent - val navigator = LocalNavigator.current + val onNavigate = LocalNavigator.current StartNavigationTransition( modifier = Modifier @@ -71,7 +71,7 @@ fun StartDone() { onClick = { onEvent( StartEvent.OnGoToBrowse( - onNavigate = { navigator.it() }, + onNavigate = onNavigate, onCompletedStartGuide = { onBrowseEvent(BrowseEvent.OnLoadList) onMainEvent( @@ -90,7 +90,7 @@ fun StartDone() { shape = RoundedCornerShape(100), onClick = { onEvent( - StartEvent.OnGoToHelp { navigator.it() } + StartEvent.OnGoToHelp(onNavigate = onNavigate) ) } ) { diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index e768c6f5..584da368 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -170,7 +170,6 @@ Reader-Einstellungen Datei Checkbox - Dropdown Titelbild nicht gefunden Änderungen übernehmen Fehler diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index c63aba07..998ad0ef 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -246,7 +246,6 @@ Regresar Portada Archivo - Desplegable Portada no encontrada Aplicar cambios Error diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index d1fb915c..d224aabb 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -227,7 +227,6 @@ Répertoire Flèche du chemin Case à cocher - Menu déroulant L\'image de couverture n\'a pas été trouvée Appliquer les changements Erreur diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 3c5d3aac..e7aaa1cd 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -206,7 +206,6 @@ Czcionki Usuń wybrane książki Dodaj książki - Rozwijany Utwórz nowe ustawienie koloru Możesz to zrobić z poziomu ekranu Biblioteka, Historia i Przeglądaj, klikając trzy kropki w prawym górnym rogu i wybierając « Ustawienia » z menu rozwijanego. Następnie zobaczysz wszystkie dostępne ustawienia tej aplikacji. Eksperymentuj z nimi! Kontynuuj czytanie diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index c712e4bc..89dd8153 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -298,7 +298,6 @@ Sıralama düzeni Yol oku Onay kutusu - Açılır menü Kapak resmi bulunamadı Değişiklikleri uygula Hata diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index b05a3c02..4f4bd909 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -605,7 +605,6 @@ Порядок сортування Стрілка шляху Галочка - Випадаючий список Обкладенка не знайдена Застосувати зміни Помилка @@ -641,5 +640,6 @@ Чекпоінт вперед Розділи Оновити текст + Більше \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b676187d..88e328d9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -605,7 +605,6 @@ Sort order Path arrow Checkbox - Dropdown Cover image not found Apply changes Error @@ -644,5 +643,6 @@ Checkpoint forward Chapters Update text + More \ No newline at end of file