Skip to content

Commit

Permalink
Add missing PasswordVisualTransformation to Compose sample
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhuinden committed Oct 20, 2022
1 parent 1369acb commit 8d37157
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import androidx.compose.material.TextField
import androidx.compose.runtime.Composable
import androidx.compose.runtime.State
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp

Expand All @@ -31,6 +33,7 @@ fun LoginScreenLayout(
value = username.value,
placeholder = { Text("Username") },
onValueChange = usernameUpdater,
singleLine = true,
)

Spacer(modifier = Modifier.height(8.dp))
Expand All @@ -39,6 +42,8 @@ fun LoginScreenLayout(
value = password.value,
placeholder = { Text("Password") },
onValueChange = passwordUpdater,
visualTransformation = remember { PasswordVisualTransformation() },
singleLine = true,
)

Spacer(modifier = Modifier.height(16.dp))
Expand Down

0 comments on commit 8d37157

Please sign in to comment.