Skip to content

Commit

Permalink
Clarify obfuscation variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Rawa authored and Pururun committed Sep 27, 2023
1 parent 9bec285 commit d6adb5a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import net.mullvad.mullvadvpn.lib.common.util.groupWithSpaces
@Composable
fun AccountNumberView(
accountNumber: String,
doObfuscateWithPasswordDots: Boolean,
obfuscateWithPasswordDots: Boolean,
modifier: Modifier = Modifier
) {
InformationView(
content =
if (doObfuscateWithPasswordDots) accountNumber.groupPasswordModeWithSpaces()
if (obfuscateWithPasswordDots) accountNumber.groupPasswordModeWithSpaces()
else accountNumber.groupWithSpaces(),
modifier = modifier,
whenMissing = MissingPolicy.SHOW_SPINNER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,23 @@ private fun PreviewCopyableObfuscationView() {

@Composable
fun CopyableObfuscationView(content: String) {
var shouldObfuscated by remember { mutableStateOf(true) }
var obfuscationEnabled by remember { mutableStateOf(true) }

Row(
verticalAlignment = CenterVertically,
modifier = Modifier.padding(end = Dimens.sideMargin)
) {
AccountNumberView(
accountNumber = content,
doObfuscateWithPasswordDots = shouldObfuscated,
obfuscateWithPasswordDots = obfuscationEnabled,
modifier = Modifier.weight(1f)
)
AnimatedIconButton(
defaultIcon = painterResource(id = R.drawable.icon_hide),
secondaryIcon = painterResource(id = R.drawable.icon_show),
isToggleButton = true,
contentDescription = stringResource(id = R.string.hide_account_number),
onClick = { shouldObfuscated = !shouldObfuscated }
onClick = { obfuscationEnabled = !obfuscationEnabled }
)

val context = LocalContext.current
Expand Down

0 comments on commit d6adb5a

Please sign in to comment.