diff --git a/UIViews/src/main/java/com/programmersbox/uiviews/history/HistoryFragment.kt b/UIViews/src/main/java/com/programmersbox/uiviews/history/HistoryFragment.kt index d8922c3f9..e18ff4052 100644 --- a/UIViews/src/main/java/com/programmersbox/uiviews/history/HistoryFragment.kt +++ b/UIViews/src/main/java/com/programmersbox/uiviews/history/HistoryFragment.kt @@ -184,7 +184,7 @@ fun HistoryUi( SnackbarResult.ActionPerformed -> item } } - } + }, ) } else { HistoryItemPlaceholder() @@ -200,6 +200,7 @@ private fun HistoryItem( dao: HistoryDao, logoDrawable: Drawable?, scope: CoroutineScope, + modifier: Modifier = Modifier, onError: () -> Unit, ) { var showPopup by remember { mutableStateOf(false) } @@ -233,6 +234,7 @@ private fun HistoryItem( SwipeToDismissBox( state = dismissState, + modifier = modifier, backgroundContent = { val direction = dismissState.dismissDirection val color by animateColorAsState( diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 2e50c551f..9c2264d1a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,7 @@ generativeai = "0.9.0" gradle = "8.7.1" kotlin = "2.0.21" -kspVersion = "2.0.21-1.0.25" +kspVersion = "2.0.21-1.0.26" androidxBaselineprofileGradlePlugin = "1.3.3" composeCollapsable = "0.4.0" @@ -33,7 +33,7 @@ jetbrainsCompiler = "1.5.1" accompanist = "0.36.0" okhttpVersion = "4.12.0" ktorVersion = "3.0.0" -workVersion = "2.10.0-beta01" +workVersion = "2.10.0-rc01" ziplineVersion = "1.1.0" landscapist = "2.4.1" protobufVersion = "4.26.1" @@ -303,7 +303,7 @@ androidxWebkit = "androidx.webkit:webkit:1.12.1" mlkitTranslate = "com.google.mlkit:translate:17.0.3" mlkitLanguage = "com.google.mlkit:language-id:17.0.6" -firebasePlatform = "com.google.firebase:firebase-bom:33.4.0" +firebasePlatform = "com.google.firebase:firebase-bom:33.5.1" firebaseDatabase = { group = "com.google.firebase", name = "firebase-database" } firebaseFirestore = { group = "com.google.firebase", name = "firebase-firestore" } firebaseAuth = { group = "com.google.firebase", name = "firebase-auth" } diff --git a/mangaworld/src/main/java/com/programmersbox/mangaworld/reader/compose/AppBars.kt b/mangaworld/src/main/java/com/programmersbox/mangaworld/reader/compose/AppBars.kt index 3d047586d..13ec6d77e 100644 --- a/mangaworld/src/main/java/com/programmersbox/mangaworld/reader/compose/AppBars.kt +++ b/mangaworld/src/main/java/com/programmersbox/mangaworld/reader/compose/AppBars.kt @@ -198,12 +198,13 @@ internal fun FloatingBottomBar( chapterChange: () -> Unit, onChapterShow: () -> Unit, modifier: Modifier = Modifier, + showFloatBar: Boolean = true, + onShowFloatBarChange: (Boolean) -> Unit = {}, exitAlwaysScrollBehavior: FloatingAppBarScrollBehavior? = null, ) { Box( modifier = Modifier.fillMaxWidth() ) { - var showFloatBar by remember { mutableStateOf(false) } HorizontalFloatingAppBar( modifier = modifier .align(Alignment.BottomEnd) @@ -255,7 +256,7 @@ internal fun FloatingBottomBar( scrollBehavior = exitAlwaysScrollBehavior, content = { FilledIconButton( - onClick = { showFloatBar = !showFloatBar }, + onClick = { onShowFloatBarChange(!showFloatBar) }, modifier = Modifier .width(64.dp) ) { diff --git a/mangaworld/src/main/java/com/programmersbox/mangaworld/reader/compose/ReaderCompose.kt b/mangaworld/src/main/java/com/programmersbox/mangaworld/reader/compose/ReaderCompose.kt index 99beff92e..2c72ba39f 100644 --- a/mangaworld/src/main/java/com/programmersbox/mangaworld/reader/compose/ReaderCompose.kt +++ b/mangaworld/src/main/java/com/programmersbox/mangaworld/reader/compose/ReaderCompose.kt @@ -33,6 +33,7 @@ import androidx.compose.material3.ModalBottomSheet import androidx.compose.material3.ModalDrawerSheet import androidx.compose.material3.ModalNavigationDrawer import androidx.compose.material3.Scaffold +import androidx.compose.material3.TimePickerDefaults import androidx.compose.material3.rememberDrawerState import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect @@ -79,6 +80,7 @@ import eu.wewox.pagecurl.config.rememberPageCurlConfig import eu.wewox.pagecurl.page.PageCurl import eu.wewox.pagecurl.page.PageCurlState import eu.wewox.pagecurl.page.rememberPageCurlState +import kotlinx.coroutines.delay import kotlinx.coroutines.launch import org.koin.compose.koinInject @@ -195,11 +197,14 @@ fun ReadView( val floatingBottomBar by mangaSettingsHandling.rememberUseFloatingReaderBottomBar() - val exitAlwaysScrollBehavior = FloatingAppBarDefaults.exitAlwaysScrollBehavior(exitDirection = FloatingAppBarExitDirection.Bottom) + var showFloatBar by remember { mutableStateOf(false) } LaunchedEffect(showItems) { if (showItems) { - exitAlwaysScrollBehavior.state.offset = 0f + delay(250) + showFloatBar = true + } else { + showFloatBar = false } } @@ -267,8 +272,16 @@ fun ReadView( topBar = { AnimatedVisibility( visible = showItems, - enter = slideInVertically { -it } + fadeIn(), - exit = slideOutVertically { -it } + fadeOut() + enter = slideInVertically( + animationSpec = MaterialTheme.motionScheme.fastSpatialSpec() + ) { -it } + fadeIn( + animationSpec = MaterialTheme.motionScheme.fastSpatialSpec() + ), + exit = slideOutVertically( + animationSpec = MaterialTheme.motionScheme.fastSpatialSpec() + ) { -it } + fadeOut( + animationSpec = MaterialTheme.motionScheme.fastSpatialSpec() + ) ) { ReaderTopBar( pages = pages, @@ -299,7 +312,8 @@ fun ReadView( chapterChange = ::showToast, onChapterShow = { scope.launch { drawerState.open() } }, vm = readVm, - exitAlwaysScrollBehavior = exitAlwaysScrollBehavior.takeIf { showItems } + showFloatBar = showFloatBar, + onShowFloatBarChange = { showFloatBar = it }, ) } else { BottomBar( @@ -317,7 +331,6 @@ fun ReadView( } } }, - modifier = Modifier.nestedScroll(exitAlwaysScrollBehavior) ) { p -> Box( modifier = if (showBlur)