Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Improve font for displaying password
Browse files Browse the repository at this point in the history
Use monospace font for displaying password fields in ciphers

closes #86
  • Loading branch information
M3DZIK committed Feb 23, 2024
1 parent 13b4a3a commit 3072d52
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import androidx.compose.ui.platform.LocalLifecycleOwner
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.Lifecycle
Expand Down Expand Up @@ -115,6 +116,7 @@ fun CipherViewScreen(
CipherField(
title = stringResource(R.string.Password),
value = cipherData.password,
fontFamily = FontFamily.Monospace,
copy = true,
hidden = true,
customIcon = {
Expand Down Expand Up @@ -154,7 +156,8 @@ fun CipherViewScreen(

Text(
text = passwords[i].password,
style = MaterialTheme.typography.bodyMedium
style = MaterialTheme.typography.bodyMedium,
fontFamily = FontFamily.Monospace,
)
}

Expand Down Expand Up @@ -351,6 +354,7 @@ fun CipherViewScreen(
fun CipherField(
title: String,
value: String?,
fontFamily: FontFamily? = null,
hidden: Boolean = false,
openUri: Boolean = false,
uri: String? = null,
Expand Down Expand Up @@ -381,11 +385,13 @@ fun CipherField(
if (hiddenState) {
Text(
text = "".repeat(value.length),
fontFamily = fontFamily,
style = MaterialTheme.typography.bodyMedium
)
} else {
Text(
text = value,
fontFamily = fontFamily,
style = MaterialTheme.typography.bodyMedium
)
}
Expand Down

0 comments on commit 3072d52

Please sign in to comment.