* MoreScreen: Remove title Also removes the state banners as it's redundant * Add back banners (cherry picked from commit cf6407c4d414a34949c3b97a451b14585db852df) # Conflicts: # app/src/main/java/eu/kanade/presentation/more/MoreScreen.kt
58 lines
1.7 KiB
Kotlin
58 lines
1.7 KiB
Kotlin
package eu.kanade.presentation.components
|
|
|
|
import androidx.compose.foundation.background
|
|
import androidx.compose.foundation.layout.Column
|
|
import androidx.compose.foundation.layout.fillMaxWidth
|
|
import androidx.compose.foundation.layout.padding
|
|
import androidx.compose.material3.MaterialTheme
|
|
import androidx.compose.material3.Text
|
|
import androidx.compose.runtime.Composable
|
|
import androidx.compose.ui.Modifier
|
|
import androidx.compose.ui.res.stringResource
|
|
import androidx.compose.ui.text.style.TextAlign
|
|
import androidx.compose.ui.unit.dp
|
|
import eu.kanade.tachiyomi.R
|
|
|
|
@Composable
|
|
fun AppStateBanners(
|
|
downloadedOnlyMode: Boolean,
|
|
incognitoMode: Boolean,
|
|
modifier: Modifier = Modifier,
|
|
) {
|
|
Column(modifier = modifier) {
|
|
if (downloadedOnlyMode) {
|
|
DownloadedOnlyModeBanner()
|
|
}
|
|
if (incognitoMode) {
|
|
IncognitoModeBanner()
|
|
}
|
|
}
|
|
}
|
|
|
|
@Composable
|
|
private fun DownloadedOnlyModeBanner() {
|
|
Text(
|
|
text = stringResource(R.string.label_downloaded_only),
|
|
modifier = Modifier
|
|
.background(color = MaterialTheme.colorScheme.tertiary)
|
|
.fillMaxWidth()
|
|
.padding(4.dp),
|
|
color = MaterialTheme.colorScheme.onTertiary,
|
|
textAlign = TextAlign.Center,
|
|
style = MaterialTheme.typography.labelMedium,
|
|
)
|
|
}
|
|
|
|
@Composable
|
|
private fun IncognitoModeBanner() {
|
|
Text(
|
|
text = stringResource(R.string.pref_incognito_mode),
|
|
modifier = Modifier
|
|
.background(color = MaterialTheme.colorScheme.primary)
|
|
.fillMaxWidth()
|
|
.padding(4.dp),
|
|
color = MaterialTheme.colorScheme.onPrimary,
|
|
textAlign = TextAlign.Center,
|
|
style = MaterialTheme.typography.labelMedium,
|
|
)
|
|
}
|