From a0e5ae4f3ca9c4f43cec764dacec54fb4c846960 Mon Sep 17 00:00:00 2001 From: Isira Seneviratne Date: Sat, 21 Dec 2024 08:44:19 +0530 Subject: [PATCH] Use font styling --- .../newpipe/ui/components/channel/AboutChannelSection.kt | 2 +- .../schabi/newpipe/ui/components/metadata/MetadataItem.kt | 5 ++--- .../schabi/newpipe/ui/components/metadata/TagsSection.kt | 3 +-- .../ui/components/video/StreamDescriptionSection.kt | 7 +++---- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/ui/components/channel/AboutChannelSection.kt b/app/src/main/java/org/schabi/newpipe/ui/components/channel/AboutChannelSection.kt index f5f2af6d5..ae40d333b 100644 --- a/app/src/main/java/org/schabi/newpipe/ui/components/channel/AboutChannelSection.kt +++ b/app/src/main/java/org/schabi/newpipe/ui/components/channel/AboutChannelSection.kt @@ -42,7 +42,7 @@ fun AboutChannelSection(channelInfo: ParcelableChannelInfo) { ) { if (description.isNotEmpty()) { item { - Text(text = description) + Text(text = description, style = MaterialTheme.typography.bodyMedium) } } diff --git a/app/src/main/java/org/schabi/newpipe/ui/components/metadata/MetadataItem.kt b/app/src/main/java/org/schabi/newpipe/ui/components/metadata/MetadataItem.kt index 18c990c77..98df47681 100644 --- a/app/src/main/java/org/schabi/newpipe/ui/components/metadata/MetadataItem.kt +++ b/app/src/main/java/org/schabi/newpipe/ui/components/metadata/MetadataItem.kt @@ -15,7 +15,6 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.AnnotatedString -import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp @@ -38,10 +37,10 @@ fun MetadataItem(@StringRes title: Int, value: AnnotatedString) { modifier = Modifier.width(96.dp), textAlign = TextAlign.End, text = stringResource(title).uppercase(), - fontWeight = FontWeight.Bold + style = MaterialTheme.typography.titleSmall ) - Text(text = value) + Text(text = value, style = MaterialTheme.typography.bodyMedium) } } diff --git a/app/src/main/java/org/schabi/newpipe/ui/components/metadata/TagsSection.kt b/app/src/main/java/org/schabi/newpipe/ui/components/metadata/TagsSection.kt index 6254e9c51..d0f77ac8b 100644 --- a/app/src/main/java/org/schabi/newpipe/ui/components/metadata/TagsSection.kt +++ b/app/src/main/java/org/schabi/newpipe/ui/components/metadata/TagsSection.kt @@ -16,7 +16,6 @@ import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource -import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp @@ -35,7 +34,7 @@ fun TagsSection(serviceId: Int, tags: List) { Text( modifier = Modifier.fillMaxWidth(), text = stringResource(R.string.metadata_tags).uppercase(), - fontWeight = FontWeight.Bold, + style = MaterialTheme.typography.titleMedium, textAlign = TextAlign.Center ) diff --git a/app/src/main/java/org/schabi/newpipe/ui/components/video/StreamDescriptionSection.kt b/app/src/main/java/org/schabi/newpipe/ui/components/video/StreamDescriptionSection.kt index 94d4ada93..d8645d40b 100644 --- a/app/src/main/java/org/schabi/newpipe/ui/components/video/StreamDescriptionSection.kt +++ b/app/src/main/java/org/schabi/newpipe/ui/components/video/StreamDescriptionSection.kt @@ -40,7 +40,6 @@ import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.platform.rememberNestedScrollInteropConnection import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource -import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import org.schabi.newpipe.R @@ -83,7 +82,7 @@ fun StreamDescriptionSection(streamInfo: StreamInfo) { val date = Localization.formatDate(LocalContext.current, it.offsetDateTime()) Text( text = stringResource(R.string.upload_date_text, date), - fontWeight = FontWeight.Bold + style = MaterialTheme.typography.titleMedium ) } @@ -135,10 +134,10 @@ fun StreamDescriptionSection(streamInfo: StreamInfo) { if (isSelectable) { SelectionContainer { - Text(text = description) + Text(text = description, style = MaterialTheme.typography.bodyMedium) } } else { - Text(text = description) + Text(text = description, style = MaterialTheme.typography.bodyMedium) } } }