mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 03:07:25 +01:00
Fix missing downloaded only/incognito banners in Browse Source (#7936)
This commit is contained in:
parent
c7d09d098a
commit
99270e370e
@ -2,6 +2,7 @@ package eu.kanade.presentation.browse
|
|||||||
|
|
||||||
import androidx.compose.animation.AnimatedVisibility
|
import androidx.compose.animation.AnimatedVisibility
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.PaddingValues
|
import androidx.compose.foundation.layout.PaddingValues
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.navigationBarsPadding
|
import androidx.compose.foundation.layout.navigationBarsPadding
|
||||||
@ -39,8 +40,10 @@ import eu.kanade.presentation.browse.components.BrowseSourceComfortableGrid
|
|||||||
import eu.kanade.presentation.browse.components.BrowseSourceCompactGrid
|
import eu.kanade.presentation.browse.components.BrowseSourceCompactGrid
|
||||||
import eu.kanade.presentation.browse.components.BrowseSourceList
|
import eu.kanade.presentation.browse.components.BrowseSourceList
|
||||||
import eu.kanade.presentation.browse.components.BrowseSourceToolbar
|
import eu.kanade.presentation.browse.components.BrowseSourceToolbar
|
||||||
|
import eu.kanade.presentation.components.DownloadedOnlyModeBanner
|
||||||
import eu.kanade.presentation.components.EmptyScreen
|
import eu.kanade.presentation.components.EmptyScreen
|
||||||
import eu.kanade.presentation.components.ExtendedFloatingActionButton
|
import eu.kanade.presentation.components.ExtendedFloatingActionButton
|
||||||
|
import eu.kanade.presentation.components.IncognitoModeBanner
|
||||||
import eu.kanade.presentation.components.LoadingScreen
|
import eu.kanade.presentation.components.LoadingScreen
|
||||||
import eu.kanade.presentation.components.Scaffold
|
import eu.kanade.presentation.components.Scaffold
|
||||||
import eu.kanade.tachiyomi.R
|
import eu.kanade.tachiyomi.R
|
||||||
@ -58,6 +61,8 @@ fun BrowseSourceScreen(
|
|||||||
onMangaClick: (Manga) -> Unit,
|
onMangaClick: (Manga) -> Unit,
|
||||||
onMangaLongClick: (Manga) -> Unit,
|
onMangaLongClick: (Manga) -> Unit,
|
||||||
onWebViewClick: () -> Unit,
|
onWebViewClick: () -> Unit,
|
||||||
|
incognitoMode: Boolean,
|
||||||
|
downloadedOnlyMode: Boolean,
|
||||||
) {
|
) {
|
||||||
val columns by presenter.getColumnsPreferenceForCurrentOrientation()
|
val columns by presenter.getColumnsPreferenceForCurrentOrientation()
|
||||||
|
|
||||||
@ -73,6 +78,7 @@ fun BrowseSourceScreen(
|
|||||||
|
|
||||||
Scaffold(
|
Scaffold(
|
||||||
topBar = { scrollBehavior ->
|
topBar = { scrollBehavior ->
|
||||||
|
Column {
|
||||||
BrowseSourceToolbar(
|
BrowseSourceToolbar(
|
||||||
state = presenter,
|
state = presenter,
|
||||||
source = presenter.source!!,
|
source = presenter.source!!,
|
||||||
@ -84,6 +90,13 @@ fun BrowseSourceScreen(
|
|||||||
onSearch = { presenter.search() },
|
onSearch = { presenter.search() },
|
||||||
scrollBehavior = scrollBehavior,
|
scrollBehavior = scrollBehavior,
|
||||||
)
|
)
|
||||||
|
if (downloadedOnlyMode) {
|
||||||
|
DownloadedOnlyModeBanner()
|
||||||
|
}
|
||||||
|
if (incognitoMode) {
|
||||||
|
IncognitoModeBanner()
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
floatingActionButton = {
|
floatingActionButton = {
|
||||||
BrowseSourceFloatingActionButton(
|
BrowseSourceFloatingActionButton(
|
||||||
|
@ -70,6 +70,8 @@ open class BrowseSourceController(bundle: Bundle) :
|
|||||||
val intent = WebViewActivity.newIntent(context, source.baseUrl, source.id, source.name)
|
val intent = WebViewActivity.newIntent(context, source.baseUrl, source.id, source.name)
|
||||||
context.startActivity(intent)
|
context.startActivity(intent)
|
||||||
},
|
},
|
||||||
|
incognitoMode = presenter.isIncognitoMode,
|
||||||
|
downloadedOnlyMode = presenter.isDownloadOnly,
|
||||||
)
|
)
|
||||||
|
|
||||||
val onDismissRequest = { presenter.dialog = null }
|
val onDismissRequest = { presenter.dialog = null }
|
||||||
|
@ -103,6 +103,9 @@ open class BrowseSourcePresenter(
|
|||||||
|
|
||||||
var displayMode by preferences.sourceDisplayMode().asState()
|
var displayMode by preferences.sourceDisplayMode().asState()
|
||||||
|
|
||||||
|
val isDownloadOnly: Boolean by preferences.downloadedOnly().asState()
|
||||||
|
val isIncognitoMode: Boolean by preferences.incognitoMode().asState()
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun getColumnsPreferenceForCurrentOrientation(): State<GridCells> {
|
fun getColumnsPreferenceForCurrentOrientation(): State<GridCells> {
|
||||||
val isLandscape = LocalConfiguration.current.orientation == Configuration.ORIENTATION_LANDSCAPE
|
val isLandscape = LocalConfiguration.current.orientation == Configuration.ORIENTATION_LANDSCAPE
|
||||||
|
Loading…
Reference in New Issue
Block a user