Skip to content

Commit

Permalink
Fixed the input text fields of password screens
Browse files Browse the repository at this point in the history
  • Loading branch information
aritra-tech committed May 27, 2024
1 parent fa38524 commit e7e77d2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
Expand All @@ -29,6 +30,8 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.text.input.VisualTransformation
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -110,6 +113,7 @@ fun AddPasswordScreen(
.fillMaxWidth(),
maxLines = 1,
headerText = stringResource(id = R.string.email),
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Email, imeAction = ImeAction.Next),
value = email,
onValueChange = {
addEditViewModel.setEmail(it)
Expand All @@ -123,6 +127,7 @@ fun AddPasswordScreen(
.fillMaxWidth(),
maxLines = 1,
headerText = stringResource(id = R.string.username),
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text, imeAction = ImeAction.Next),
value = username,
onValueChange = {
addEditViewModel.setUserName(it)
Expand All @@ -136,6 +141,7 @@ fun AddPasswordScreen(
.fillMaxWidth(),
maxLines = 1,
headerText = stringResource(id = R.string.password),
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password, imeAction = ImeAction.Done),
value = password,
onValueChange = {
addEditViewModel.setPassword(it)
Expand Down Expand Up @@ -177,6 +183,7 @@ fun AddPasswordScreen(
modifier = Modifier
.fillMaxWidth(),
headerText = stringResource(id = R.string.note),
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Email, imeAction = ImeAction.Done),
value = note,
onValueChange = {
addEditViewModel.setNote(it)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
Expand All @@ -30,6 +31,8 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.text.input.VisualTransformation
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -114,6 +117,8 @@ fun EditPasswordScreen(
modifier = Modifier
.fillMaxWidth(),
headerText = stringResource(id = R.string.email),
maxLines = 1,
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Email, imeAction = ImeAction.Next),
value = accountEmail,
onValueChange = { email ->
viewPasswordViewModel.updateEmail(email)
Expand All @@ -126,6 +131,8 @@ fun EditPasswordScreen(
modifier = Modifier
.fillMaxWidth(),
headerText = stringResource(id = R.string.username),
maxLines = 1,
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text, imeAction = ImeAction.Next),
value = accountUserName,
onValueChange = { username ->
viewPasswordViewModel.updateUserName(username)
Expand All @@ -138,6 +145,8 @@ fun EditPasswordScreen(
modifier = Modifier
.fillMaxWidth(),
headerText = stringResource(id = R.string.password),
maxLines = 1,
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password, imeAction = ImeAction.Done),
value = accountPassword,
onValueChange = { password ->
viewPasswordViewModel.updatePassword(password)
Expand Down Expand Up @@ -179,6 +188,8 @@ fun EditPasswordScreen(
modifier = Modifier
.fillMaxWidth(),
headerText = stringResource(id = R.string.note),
maxLines = 1,
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Email, imeAction = ImeAction.Done),
value = accountNote,
onValueChange = { note ->
viewPasswordViewModel.updateNote(note)
Expand Down

0 comments on commit e7e77d2

Please sign in to comment.