MoreScreen: Remove title (#8158)

* MoreScreen: Remove title

Also removes the state banners as it's redundant

* Add back banners
This commit is contained in:
Ivan Iskandar 2022-10-08 21:24:50 +07:00 committed by GitHub
parent 5f8252447f
commit cf6407c4d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 116 additions and 117 deletions

View File

@ -1,7 +1,7 @@
package eu.kanade.presentation.components package eu.kanade.presentation.components
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.layout.ColumnScope import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
@ -14,16 +14,19 @@ import androidx.compose.ui.unit.dp
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
@Composable @Composable
fun ColumnScope.AppStateBanners( fun AppStateBanners(
downloadedOnlyMode: Boolean, downloadedOnlyMode: Boolean,
incognitoMode: Boolean, incognitoMode: Boolean,
modifier: Modifier = Modifier,
) { ) {
Column(modifier = modifier) {
if (downloadedOnlyMode) { if (downloadedOnlyMode) {
DownloadedOnlyModeBanner() DownloadedOnlyModeBanner()
} }
if (incognitoMode) { if (incognitoMode) {
IncognitoModeBanner() IncognitoModeBanner()
} }
}
} }
@Composable @Composable

View File

@ -6,8 +6,8 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.size
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
@ -16,19 +16,18 @@ import eu.kanade.tachiyomi.R
@Composable @Composable
fun LogoHeader() { fun LogoHeader() {
Column { Column(
Surface(
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
horizontalAlignment = Alignment.CenterHorizontally,
) { ) {
Icon( Icon(
painter = painterResource(R.drawable.ic_tachi), painter = painterResource(R.drawable.ic_tachi),
contentDescription = null, contentDescription = null,
tint = MaterialTheme.colorScheme.onSurface, tint = MaterialTheme.colorScheme.onSurface,
modifier = Modifier modifier = Modifier
.padding(32.dp) .padding(vertical = 56.dp)
.size(56.dp), .size(64.dp),
) )
}
Divider() Divider()
} }

View File

@ -1,5 +1,6 @@
package eu.kanade.presentation.more package eu.kanade.presentation.more
import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.CloudOff import androidx.compose.material.icons.outlined.CloudOff
import androidx.compose.material.icons.outlined.GetApp import androidx.compose.material.icons.outlined.GetApp
@ -11,18 +12,17 @@ import androidx.compose.material.icons.outlined.SettingsBackupRestore
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.rememberVectorPainter import androidx.compose.ui.graphics.vector.rememberVectorPainter
import androidx.compose.ui.platform.LocalUriHandler import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.AppStateBanners
import eu.kanade.presentation.components.Divider import eu.kanade.presentation.components.Divider
import eu.kanade.presentation.components.PreferenceRow import eu.kanade.presentation.components.PreferenceRow
import eu.kanade.presentation.components.Scaffold
import eu.kanade.presentation.components.ScrollbarLazyColumn import eu.kanade.presentation.components.ScrollbarLazyColumn
import eu.kanade.presentation.components.SwitchPreference import eu.kanade.presentation.components.SwitchPreference
import eu.kanade.presentation.util.bottomNavPaddingValues import eu.kanade.presentation.util.bottomNavPaddingValues
import eu.kanade.presentation.util.plus
import eu.kanade.presentation.util.quantityStringResource import eu.kanade.presentation.util.quantityStringResource
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.more.DownloadQueueState import eu.kanade.tachiyomi.ui.more.DownloadQueueState
@ -41,23 +41,21 @@ fun MoreScreen(
val uriHandler = LocalUriHandler.current val uriHandler = LocalUriHandler.current
val downloadQueueState by presenter.downloadQueueState.collectAsState() val downloadQueueState by presenter.downloadQueueState.collectAsState()
Scaffold(
topBar = { scrollBehavior ->
AppBar(
title = stringResource(R.string.label_more),
downloadedOnlyMode = presenter.downloadedOnly.value,
incognitoMode = presenter.incognitoMode.value,
scrollBehavior = scrollBehavior,
)
},
) { contentPadding ->
ScrollbarLazyColumn( ScrollbarLazyColumn(
contentPadding = contentPadding + bottomNavPaddingValues, modifier = Modifier.statusBarsPadding(),
contentPadding = bottomNavPaddingValues,
) { ) {
item { item {
LogoHeader() LogoHeader()
} }
item {
AppStateBanners(
downloadedOnlyMode = presenter.downloadedOnly.value,
incognitoMode = presenter.incognitoMode.value,
)
}
item { item {
SwitchPreference( SwitchPreference(
preference = presenter.downloadedOnly, preference = presenter.downloadedOnly,
@ -144,5 +142,4 @@ fun MoreScreen(
) )
} }
} }
}
} }