More consistent titles

This commit is contained in:
Damontecres 2026-01-29 19:35:42 -05:00
parent fb891799c7
commit d3448771c8
No known key found for this signature in database
7 changed files with 27 additions and 64 deletions

View file

@ -32,9 +32,7 @@ fun HomeLibraryRowTypeList(
) {
LaunchedEffect(Unit) { firstFocus.tryRequestFocus() }
Column(modifier = modifier) {
Text(
text = "Add row for ${library.name}",
)
TitleText(stringResource(R.string.add_row_for, library.name))
LazyColumn(
contentPadding = PaddingValues(8.dp),
verticalArrangement = Arrangement.spacedBy(8.dp),

View file

@ -13,7 +13,6 @@ import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.unit.dp
import androidx.tv.material3.MaterialTheme
import androidx.tv.material3.Text
import androidx.tv.material3.surfaceColorAtElevation
import com.github.damontecres.wholphin.R
import com.github.damontecres.wholphin.data.model.HomeRowViewOptions
@ -45,11 +44,7 @@ fun HomeRowSettings(
val firstFocus = remember { FocusRequester() }
LaunchedEffect(Unit) { firstFocus.tryRequestFocus() }
Column(modifier = modifier) {
Text(
text = title,
style = MaterialTheme.typography.titleLarge,
color = MaterialTheme.colorScheme.onSurface,
)
TitleText(title)
LazyColumn {
itemsIndexed(options) { index, pref ->
pref as AppPreference<HomeRowViewOptions, Any>

View file

@ -5,8 +5,6 @@ import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.material3.HorizontalDivider
@ -17,9 +15,7 @@ import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.focus.focusRestorer
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.tv.material3.MaterialTheme
import androidx.tv.material3.Text
import com.github.damontecres.wholphin.R
import com.github.damontecres.wholphin.ui.ifElse
@ -35,9 +31,7 @@ fun HomeSettingsAddRow(
) {
// LaunchedEffect(Unit) { firstFocus.tryRequestFocus() }
Column(modifier = modifier) {
Text(
text = "Add row for...",
)
TitleText(stringResource(R.string.add_row))
LazyColumn(
contentPadding = PaddingValues(8.dp),
verticalArrangement = Arrangement.spacedBy(8.dp),
@ -46,18 +40,6 @@ fun HomeSettingsAddRow(
.fillMaxHeight()
.focusRestorer(firstFocus),
) {
item {
Text(
text = stringResource(R.string.continue_watching),
style = MaterialTheme.typography.titleMedium,
color = MaterialTheme.colorScheme.onSurface,
textAlign = TextAlign.Start,
modifier =
Modifier
.fillMaxWidth()
.padding(top = 8.dp, bottom = 4.dp),
)
}
itemsIndexed(
listOf(
MetaRowType.CONTINUE_WATCHING,
@ -75,17 +57,8 @@ fun HomeSettingsAddRow(
)
}
item {
TitleText(stringResource(R.string.library))
HorizontalDivider()
Text(
text = stringResource(R.string.library),
style = MaterialTheme.typography.titleMedium,
color = MaterialTheme.colorScheme.onSurface,
textAlign = TextAlign.Start,
modifier =
Modifier
.fillMaxWidth()
.padding(top = 8.dp, bottom = 4.dp),
)
}
itemsIndexed(libraries) { index, library ->
HomeSettingsListItem(
@ -98,17 +71,8 @@ fun HomeSettingsAddRow(
)
}
item {
TitleText(stringResource(R.string.more))
HorizontalDivider()
Text(
text = stringResource(R.string.more),
style = MaterialTheme.typography.titleMedium,
color = MaterialTheme.colorScheme.onSurface,
textAlign = TextAlign.Start,
modifier =
Modifier
.fillMaxWidth()
.padding(top = 8.dp, bottom = 4.dp),
)
}
item {
HomeSettingsListItem(

View file

@ -29,8 +29,8 @@ fun HomeSettingsFavoriteList(
) {
LaunchedEffect(Unit) { firstFocus.tryRequestFocus() }
Column(modifier = modifier) {
Text(
text = "Add favorites row...",
TitleText(
stringResource(R.string.add_row_for, stringResource(R.string.favorites)),
)
LazyColumn(
contentPadding = PaddingValues(8.dp),

View file

@ -56,7 +56,7 @@ fun HomeSettingsGlobal(
selected = false,
headlineContent = {
Text(
text = "Increase card sizes",
text = "Increase all card size",
)
},
leadingContent = {
@ -74,7 +74,7 @@ fun HomeSettingsGlobal(
selected = false,
headlineContent = {
Text(
text = "Decrease card sizes",
text = "Decrease all card size",
)
},
leadingContent = {

View file

@ -18,6 +18,7 @@ import androidx.compose.material.icons.filled.Settings
import androidx.compose.material3.HorizontalDivider
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.NonRestartableComposable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
@ -72,12 +73,7 @@ fun HomeSettingsRowList(
LaunchedEffect(Unit) { focusRequesters.getOrNull(position)?.tryRequestFocus() }
Column(modifier = modifier) {
Text(
text = stringResource(R.string.customize_home),
style = MaterialTheme.typography.titleLarge,
textAlign = TextAlign.Center,
modifier = Modifier.fillMaxWidth(),
)
TitleText(stringResource(R.string.customize_home))
LazyColumn(
state = listState,
verticalArrangement = Arrangement.spacedBy(8.dp),
@ -129,12 +125,7 @@ fun HomeSettingsRowList(
)
}
item {
Text(
text = stringResource(R.string.home_rows),
style = MaterialTheme.typography.titleLarge,
textAlign = TextAlign.Center,
modifier = Modifier.fillMaxWidth(),
)
TitleText(stringResource(R.string.home_rows))
HorizontalDivider()
}
itemsIndexed(state.rows, key = { _, row -> row.id }) { index, row ->
@ -248,3 +239,17 @@ fun HomeRowConfigContent(
}
}
}
@Composable
@NonRestartableComposable
fun TitleText(
title: String,
modifier: Modifier = Modifier,
) {
Text(
text = title,
style = MaterialTheme.typography.titleLarge,
textAlign = TextAlign.Center,
modifier = modifier.fillMaxWidth(),
)
}

View file

@ -473,6 +473,7 @@
<string name="save_to_server">Save to server</string>
<string name="load_from_web_client">Load from web client</string>
<string name="use_series">Use series image</string>
<string name="add_row_for">Add row for %1$s</string>
<string-array name="theme_song_volume">
<item>Disabled</item>