Skip to content

Commit

Permalink
feat: fix text color
Browse files Browse the repository at this point in the history
  • Loading branch information
kaleidot725 committed Sep 1, 2024
1 parent c19ec53 commit 14fd1b1
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 9 deletions.
9 changes: 7 additions & 2 deletions src/main/kotlin/view/pages/devices/DevicesPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ fun DevicesPage(
DevicesPageState.Error -> {
Box(modifier = Modifier.fillMaxSize()) {
Texts.Subtitle1(
DEVICES_PAGE_ERROR_STARTING_ADB_SERVER,
text = DEVICES_PAGE_ERROR_STARTING_ADB_SERVER,
color = MaterialTheme.colors.onBackground,
modifier = Modifier.align(Alignment.Center),
)
}
Expand All @@ -87,7 +88,11 @@ fun DevicesPage(

DevicesPageState.DeviceIsEmpty -> {
Box(modifier = Modifier.fillMaxSize()) {
Texts.Subtitle1(DEVICES_PAGE_NOT_FOUND_DEVICES, modifier = Modifier.align(Alignment.Center))
Texts.Subtitle1(
text = DEVICES_PAGE_NOT_FOUND_DEVICES,
color = MaterialTheme.colors.onBackground,
modifier = Modifier.align(Alignment.Center)
)
}
}
}
Expand Down
10 changes: 8 additions & 2 deletions src/main/kotlin/view/pages/devices/DevicesPageForMini.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package view.pages.devices
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.CircularProgressIndicator
import androidx.compose.material.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.collectAsState
Expand Down Expand Up @@ -53,7 +54,8 @@ fun DevicesPageForMini(
DevicesPageState.Error -> {
Box(modifier = Modifier.fillMaxSize()) {
Texts.Subtitle1(
DEVICES_PAGE_ERROR_STARTING_ADB_SERVER,
text = DEVICES_PAGE_ERROR_STARTING_ADB_SERVER,
color = MaterialTheme.colors.onBackground,
modifier = Modifier.align(Alignment.Center),
)
}
Expand All @@ -73,7 +75,11 @@ fun DevicesPageForMini(

DevicesPageState.DeviceIsEmpty -> {
Box(modifier = Modifier.fillMaxSize()) {
Texts.Subtitle1(DEVICES_PAGE_NOT_FOUND_DEVICES, modifier = Modifier.align(Alignment.Center))
Texts.Subtitle1(
text = DEVICES_PAGE_NOT_FOUND_DEVICES,
color = MaterialTheme.colors.onBackground,
modifier = Modifier.align(Alignment.Center)
)
}
}
}
Expand Down
25 changes: 25 additions & 0 deletions src/main/kotlin/view/parts/Texts.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@ import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.style.TextOverflow

object Texts {
@Composable
fun H1(
text: String,
color: Color = Color.Unspecified,
maxLines: Int = Int.MAX_VALUE,
modifier: Modifier = Modifier,
) {
Text(
text = text,
color = color,
maxLines = maxLines,
modifier = modifier,
overflow = TextOverflow.Ellipsis,
Expand All @@ -27,11 +30,13 @@ object Texts {
@Composable
fun H2(
text: String,
color: Color = Color.Unspecified,
maxLines: Int = Int.MAX_VALUE,
modifier: Modifier = Modifier,
) {
Text(
text = text,
color = color,
maxLines = maxLines,
modifier = modifier,
overflow = TextOverflow.Ellipsis,
Expand All @@ -42,11 +47,13 @@ object Texts {
@Composable
fun H3(
text: String,
color: Color = Color.Unspecified,
maxLines: Int = Int.MAX_VALUE,
modifier: Modifier = Modifier,
) {
Text(
text = text,
color = color,
maxLines = maxLines,
modifier = modifier,
overflow = TextOverflow.Ellipsis,
Expand All @@ -57,11 +64,13 @@ object Texts {
@Composable
fun H4(
text: String,
color: Color = Color.Unspecified,
maxLines: Int = Int.MAX_VALUE,
modifier: Modifier = Modifier,
) {
Text(
text = text,
color = color,
maxLines = maxLines,
modifier = modifier,
overflow = TextOverflow.Ellipsis,
Expand All @@ -72,11 +81,13 @@ object Texts {
@Composable
fun H5(
text: String,
color: Color = Color.Unspecified,
maxLines: Int = Int.MAX_VALUE,
modifier: Modifier = Modifier,
) {
Text(
text = text,
color = color,
maxLines = maxLines,
modifier = modifier,
overflow = TextOverflow.Ellipsis,
Expand All @@ -87,11 +98,13 @@ object Texts {
@Composable
fun H6(
text: String,
color: Color = Color.Unspecified,
maxLines: Int = Int.MAX_VALUE,
modifier: Modifier = Modifier,
) {
Text(
text = text,
color = color,
maxLines = maxLines,
modifier = modifier,
overflow = TextOverflow.Ellipsis,
Expand All @@ -102,11 +115,13 @@ object Texts {
@Composable
fun Subtitle1(
text: String,
color: Color = Color.Unspecified,
maxLines: Int = Int.MAX_VALUE,
modifier: Modifier = Modifier,
) {
Text(
text = text,
color = color,
maxLines = maxLines,
modifier = modifier,
overflow = TextOverflow.Ellipsis,
Expand All @@ -117,11 +132,13 @@ object Texts {
@Composable
fun Subtitle2(
text: String,
color: Color = Color.Unspecified,
maxLines: Int = Int.MAX_VALUE,
modifier: Modifier = Modifier,
) {
Text(
text = text,
color = color,
maxLines = maxLines,
modifier = modifier,
overflow = TextOverflow.Ellipsis,
Expand All @@ -132,11 +149,13 @@ object Texts {
@Composable
fun Body1(
text: String,
color: Color = Color.Unspecified,
maxLines: Int = Int.MAX_VALUE,
modifier: Modifier = Modifier,
) {
Text(
text = text,
color = color,
maxLines = maxLines,
modifier = modifier,
overflow = TextOverflow.Ellipsis,
Expand All @@ -147,11 +166,13 @@ object Texts {
@Composable
fun Body2(
text: String,
color: Color = Color.Unspecified,
maxLines: Int = Int.MAX_VALUE,
modifier: Modifier = Modifier,
) {
Text(
text = text,
color = color,
maxLines = maxLines,
modifier = modifier,
overflow = TextOverflow.Ellipsis,
Expand All @@ -162,11 +183,13 @@ object Texts {
@Composable
fun Button(
text: String,
color: Color = Color.Unspecified,
maxLines: Int = Int.MAX_VALUE,
modifier: Modifier = Modifier,
) {
Text(
text = text,
color = color,
maxLines = maxLines,
modifier = modifier,
overflow = TextOverflow.Ellipsis,
Expand All @@ -177,11 +200,13 @@ object Texts {
@Composable
fun Caption(
text: String,
color: Color = Color.Unspecified,
maxLines: Int = Int.MAX_VALUE,
modifier: Modifier = Modifier,
) {
Text(
text = text,
color = color,
maxLines = maxLines,
modifier = modifier,
overflow = TextOverflow.Ellipsis,
Expand Down
10 changes: 5 additions & 5 deletions src/main/kotlin/view/templates/HeaderAndContent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ fun MainLayout(
) {
Box(
modifier =
Modifier
.fillMaxSize()
.background(MaterialTheme.colors.background)
.clip(RoundedCornerShape(8.dp))
.border(BorderStroke(1.dp, Colors.WINDOW_BORDER)),
Modifier
.fillMaxSize()
.background(MaterialTheme.colors.background)
.clip(RoundedCornerShape(8.dp))
.border(BorderStroke(1.dp, Colors.WINDOW_BORDER)),
) {
Column(modifier = Modifier.fillMaxSize()) {
header()
Expand Down

0 comments on commit 14fd1b1

Please sign in to comment.