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() } LaunchedEffect(Unit) { firstFocus.tryRequestFocus() }
Column(modifier = modifier) { Column(modifier = modifier) {
Text( TitleText(stringResource(R.string.add_row_for, library.name))
text = "Add row for ${library.name}",
)
LazyColumn( LazyColumn(
contentPadding = PaddingValues(8.dp), contentPadding = PaddingValues(8.dp),
verticalArrangement = Arrangement.spacedBy(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.focus.focusRequester
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.tv.material3.MaterialTheme import androidx.tv.material3.MaterialTheme
import androidx.tv.material3.Text
import androidx.tv.material3.surfaceColorAtElevation import androidx.tv.material3.surfaceColorAtElevation
import com.github.damontecres.wholphin.R import com.github.damontecres.wholphin.R
import com.github.damontecres.wholphin.data.model.HomeRowViewOptions import com.github.damontecres.wholphin.data.model.HomeRowViewOptions
@ -45,11 +44,7 @@ fun HomeRowSettings(
val firstFocus = remember { FocusRequester() } val firstFocus = remember { FocusRequester() }
LaunchedEffect(Unit) { firstFocus.tryRequestFocus() } LaunchedEffect(Unit) { firstFocus.tryRequestFocus() }
Column(modifier = modifier) { Column(modifier = modifier) {
Text( TitleText(title)
text = title,
style = MaterialTheme.typography.titleLarge,
color = MaterialTheme.colorScheme.onSurface,
)
LazyColumn { LazyColumn {
itemsIndexed(options) { index, pref -> itemsIndexed(options) { index, pref ->
pref as AppPreference<HomeRowViewOptions, Any> 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.Column
import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxHeight 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.LazyColumn
import androidx.compose.foundation.lazy.itemsIndexed import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.material3.HorizontalDivider 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.focusRequester
import androidx.compose.ui.focus.focusRestorer import androidx.compose.ui.focus.focusRestorer
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.tv.material3.MaterialTheme
import androidx.tv.material3.Text import androidx.tv.material3.Text
import com.github.damontecres.wholphin.R import com.github.damontecres.wholphin.R
import com.github.damontecres.wholphin.ui.ifElse import com.github.damontecres.wholphin.ui.ifElse
@ -35,9 +31,7 @@ fun HomeSettingsAddRow(
) { ) {
// LaunchedEffect(Unit) { firstFocus.tryRequestFocus() } // LaunchedEffect(Unit) { firstFocus.tryRequestFocus() }
Column(modifier = modifier) { Column(modifier = modifier) {
Text( TitleText(stringResource(R.string.add_row))
text = "Add row for...",
)
LazyColumn( LazyColumn(
contentPadding = PaddingValues(8.dp), contentPadding = PaddingValues(8.dp),
verticalArrangement = Arrangement.spacedBy(8.dp), verticalArrangement = Arrangement.spacedBy(8.dp),
@ -46,18 +40,6 @@ fun HomeSettingsAddRow(
.fillMaxHeight() .fillMaxHeight()
.focusRestorer(firstFocus), .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( itemsIndexed(
listOf( listOf(
MetaRowType.CONTINUE_WATCHING, MetaRowType.CONTINUE_WATCHING,
@ -75,17 +57,8 @@ fun HomeSettingsAddRow(
) )
} }
item { item {
TitleText(stringResource(R.string.library))
HorizontalDivider() 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 -> itemsIndexed(libraries) { index, library ->
HomeSettingsListItem( HomeSettingsListItem(
@ -98,17 +71,8 @@ fun HomeSettingsAddRow(
) )
} }
item { item {
TitleText(stringResource(R.string.more))
HorizontalDivider() 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 { item {
HomeSettingsListItem( HomeSettingsListItem(

View file

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

View file

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

View file

@ -18,6 +18,7 @@ import androidx.compose.material.icons.filled.Settings
import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.HorizontalDivider
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.NonRestartableComposable
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.runtime.rememberCoroutineScope
@ -72,12 +73,7 @@ fun HomeSettingsRowList(
LaunchedEffect(Unit) { focusRequesters.getOrNull(position)?.tryRequestFocus() } LaunchedEffect(Unit) { focusRequesters.getOrNull(position)?.tryRequestFocus() }
Column(modifier = modifier) { Column(modifier = modifier) {
Text( TitleText(stringResource(R.string.customize_home))
text = stringResource(R.string.customize_home),
style = MaterialTheme.typography.titleLarge,
textAlign = TextAlign.Center,
modifier = Modifier.fillMaxWidth(),
)
LazyColumn( LazyColumn(
state = listState, state = listState,
verticalArrangement = Arrangement.spacedBy(8.dp), verticalArrangement = Arrangement.spacedBy(8.dp),
@ -129,12 +125,7 @@ fun HomeSettingsRowList(
) )
} }
item { item {
Text( TitleText(stringResource(R.string.home_rows))
text = stringResource(R.string.home_rows),
style = MaterialTheme.typography.titleLarge,
textAlign = TextAlign.Center,
modifier = Modifier.fillMaxWidth(),
)
HorizontalDivider() HorizontalDivider()
} }
itemsIndexed(state.rows, key = { _, row -> row.id }) { index, row -> 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="save_to_server">Save to server</string>
<string name="load_from_web_client">Load from web client</string> <string name="load_from_web_client">Load from web client</string>
<string name="use_series">Use series image</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"> <string-array name="theme_song_volume">
<item>Disabled</item> <item>Disabled</item>