parent
66a645a1da
commit
f1e0c51e6c
5 changed files with 55 additions and 0 deletions
|
|
@ -260,6 +260,7 @@ dependencies {
|
|||
implementation(libs.compose.grid)
|
||||
implementation(libs.palette.ktx)
|
||||
implementation(libs.material.kolor)
|
||||
implementation(libs.haze)
|
||||
|
||||
implementation(libs.google.api.services.drive)
|
||||
implementation(libs.google.api.client.oauth)
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import androidx.compose.material.icons.Icons
|
|||
import androidx.compose.material.icons.filled.PlayArrow
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.SnackbarHost
|
||||
import androidx.compose.material3.SnackbarHostState
|
||||
import androidx.compose.material3.Text
|
||||
|
|
@ -48,9 +49,15 @@ import androidx.compose.ui.platform.LocalDensity
|
|||
import androidx.compose.ui.platform.LocalHapticFeedback
|
||||
import androidx.compose.ui.platform.LocalLayoutDirection
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.util.fastAll
|
||||
import androidx.compose.ui.util.fastAny
|
||||
import androidx.compose.ui.util.fastMap
|
||||
import com.materialkolor.ktx.blend
|
||||
import dev.chrisbanes.haze.HazeDefaults
|
||||
import dev.chrisbanes.haze.HazeState
|
||||
import dev.chrisbanes.haze.HazeStyle
|
||||
import dev.chrisbanes.haze.haze
|
||||
import eu.kanade.domain.source.service.SourcePreferences
|
||||
import eu.kanade.domain.ui.UiPreferences
|
||||
import eu.kanade.presentation.browse.RelatedMangaTitle
|
||||
|
|
@ -187,6 +194,7 @@ fun MangaScreen(
|
|||
onSourceClick: () -> Unit,
|
||||
onCoverLoaded: (MangaCover) -> Unit,
|
||||
onPaletteScreenClick: () -> Unit,
|
||||
hazeState: HazeState,
|
||||
// KMK <--
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
|
|
@ -249,6 +257,7 @@ fun MangaScreen(
|
|||
onSourceClick = onSourceClick,
|
||||
onCoverLoaded = onCoverLoaded,
|
||||
onPaletteScreenClick = onPaletteScreenClick,
|
||||
hazeState = hazeState,
|
||||
// KMK <--
|
||||
)
|
||||
} else {
|
||||
|
|
@ -304,6 +313,7 @@ fun MangaScreen(
|
|||
onSourceClick = onSourceClick,
|
||||
onCoverLoaded = onCoverLoaded,
|
||||
onPaletteScreenClick = onPaletteScreenClick,
|
||||
hazeState = hazeState,
|
||||
// KMK <--
|
||||
)
|
||||
}
|
||||
|
|
@ -376,6 +386,7 @@ private fun MangaScreenSmallImpl(
|
|||
onSourceClick: () -> Unit,
|
||||
onCoverLoaded: (MangaCover) -> Unit,
|
||||
onPaletteScreenClick: () -> Unit,
|
||||
hazeState: HazeState,
|
||||
// KMK <--
|
||||
) {
|
||||
val chapterListState = rememberLazyListState()
|
||||
|
|
@ -396,6 +407,7 @@ private fun MangaScreenSmallImpl(
|
|||
// KMK -->
|
||||
val relatedMangasEnabled = Injekt.get<SourcePreferences>().relatedMangas().get()
|
||||
val expandRelatedMangas = Injekt.get<UiPreferences>().expandRelatedTitles().get()
|
||||
val fullCoverBackground = MaterialTheme.colorScheme.surfaceTint.blend(MaterialTheme.colorScheme.surface)
|
||||
// KMK <--
|
||||
|
||||
val internalOnBackPressed = {
|
||||
|
|
@ -489,6 +501,16 @@ private fun MangaScreenSmallImpl(
|
|||
)
|
||||
}
|
||||
},
|
||||
// KMK -->
|
||||
modifier = Modifier
|
||||
.haze(
|
||||
state = hazeState,
|
||||
style = HazeStyle(
|
||||
tint = HazeDefaults.tint(fullCoverBackground),
|
||||
blurRadius = 10.dp,
|
||||
)
|
||||
),
|
||||
// KMK <--
|
||||
) { contentPadding ->
|
||||
val topPadding = contentPadding.calculateTopPadding()
|
||||
|
||||
|
|
@ -765,6 +787,7 @@ private fun MangaScreenLargeImpl(
|
|||
onSourceClick: () -> Unit,
|
||||
onCoverLoaded: (MangaCover) -> Unit,
|
||||
onPaletteScreenClick: () -> Unit,
|
||||
hazeState: HazeState,
|
||||
// KMK <--
|
||||
) {
|
||||
val layoutDirection = LocalLayoutDirection.current
|
||||
|
|
@ -784,6 +807,7 @@ private fun MangaScreenLargeImpl(
|
|||
// KMK -->
|
||||
val relatedMangasEnabled = Injekt.get<SourcePreferences>().relatedMangas().get()
|
||||
val expandRelatedMangas = Injekt.get<UiPreferences>().expandRelatedTitles().get()
|
||||
val fullCoverBackground = MaterialTheme.colorScheme.surfaceTint.blend(MaterialTheme.colorScheme.surface)
|
||||
// KMK <--
|
||||
|
||||
val insetPadding = WindowInsets.systemBars.only(WindowInsetsSides.Horizontal).asPaddingValues()
|
||||
|
|
@ -876,6 +900,16 @@ private fun MangaScreenLargeImpl(
|
|||
)
|
||||
}
|
||||
},
|
||||
// KMK -->
|
||||
modifier = Modifier
|
||||
.haze(
|
||||
state = hazeState,
|
||||
style = HazeStyle(
|
||||
tint = HazeDefaults.tint(fullCoverBackground),
|
||||
blurRadius = 10.dp,
|
||||
)
|
||||
),
|
||||
// KMK <--
|
||||
) { contentPadding ->
|
||||
PullRefresh(
|
||||
refreshing = state.isRefreshingData,
|
||||
|
|
|
|||
|
|
@ -62,6 +62,9 @@ fun MangaCoverDialog(
|
|||
onSaveClick: () -> Unit,
|
||||
onEditClick: ((EditCoverAction) -> Unit)?,
|
||||
onDismissRequest: () -> Unit,
|
||||
// KMK -->
|
||||
modifier: Modifier = Modifier,
|
||||
// KMK <--
|
||||
) {
|
||||
Dialog(
|
||||
onDismissRequest = onDismissRequest,
|
||||
|
|
@ -71,6 +74,9 @@ fun MangaCoverDialog(
|
|||
),
|
||||
) {
|
||||
Scaffold(
|
||||
// KMK -->
|
||||
modifier = modifier,
|
||||
// KMK <--
|
||||
snackbarHost = { SnackbarHost(hostState = snackbarHostState) },
|
||||
containerColor = Color.Transparent,
|
||||
bottomBar = {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ import cafe.adriel.voyager.navigator.Navigator
|
|||
import cafe.adriel.voyager.navigator.currentOrThrow
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import com.materialkolor.DynamicMaterialTheme
|
||||
import dev.chrisbanes.haze.HazeState
|
||||
import dev.chrisbanes.haze.hazeChild
|
||||
import eu.kanade.domain.manga.model.hasCustomCover
|
||||
import eu.kanade.domain.manga.model.toSManga
|
||||
import eu.kanade.domain.ui.UiPreferences
|
||||
|
|
@ -272,6 +274,10 @@ class MangaScreen(
|
|||
}
|
||||
// SY <--
|
||||
|
||||
// KMK -->
|
||||
val hazeState = remember { HazeState() }
|
||||
// KMK <--
|
||||
|
||||
MangaScreen(
|
||||
state = successState,
|
||||
snackbarHostState = screenModel.snackbarHostState,
|
||||
|
|
@ -383,6 +389,7 @@ class MangaScreen(
|
|||
},
|
||||
onCoverLoaded = { if (themeCoverBased || successState.manga.favorite) screenModel.setPaletteColor(it) },
|
||||
onPaletteScreenClick = { navigator.push(PaletteScreen(successState.seedColor?.toArgb())) },
|
||||
hazeState = hazeState,
|
||||
// KMK <--
|
||||
)
|
||||
|
||||
|
|
@ -472,6 +479,12 @@ class MangaScreen(
|
|||
}
|
||||
},
|
||||
onDismissRequest = onDismissRequest,
|
||||
// KMK -->
|
||||
modifier = Modifier
|
||||
.hazeChild(
|
||||
state = hazeState,
|
||||
),
|
||||
// KMK <--
|
||||
)
|
||||
} else {
|
||||
LoadingScreen(Modifier.systemBarsPadding())
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ compose-webview = "io.github.kevinnzou:compose-webview:0.33.6"
|
|||
compose-grid = "io.woong.compose.grid:grid:1.2.2"
|
||||
palette-ktx = "androidx.palette:palette-ktx:1.0.0"
|
||||
material-kolor = "com.materialkolor:material-kolor:1.7.0"
|
||||
haze = "dev.chrisbanes.haze:haze:0.7.2"
|
||||
|
||||
swipe = "me.saket.swipe:swipe:1.3.0"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue