Skip to content

Commit

Permalink
color the password icon and improve the indicator a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
hg42 committed Aug 1, 2024
1 parent 5c9128f commit 6034304
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -201,12 +202,13 @@ fun PasswordPreference(
pref = pref,
titleId = pref.titleId,
summaryId = pref.summaryId,
summary = if (pref.value.isNotEmpty()) "*****" else "-----",
summary = if (pref.value.isNotEmpty()) "*********" else "- - - - -",
icon = {
pref.icon?.let { icon ->
PrefIcon(
icon = icon,
text = stringResource(id = pref.titleId),
tint = if (pref.value.isNotEmpty()) Color.Green else Color.Red,
)
} ?: run {
Spacer(modifier = Modifier.requiredWidth(36.dp))
Expand Down

0 comments on commit 6034304

Please sign in to comment.