Skip to content

Commit

Permalink
Fixed the input text fields of Auth screens
Browse files Browse the repository at this point in the history
  • Loading branch information
aritra-tech committed May 26, 2024
1 parent 0ae7fd1 commit fa38524
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@
android:theme="@style/Theme.UnCrack">
</activity>

<activity android:name=".presentation.auth.forgotPassword.ForgotPasswordScreen"
android:exported="true"
android:theme="@style/Theme.UnCrack">
</activity>

<activity android:name=".presentation.masterKey.createMasterKey.CreateMasterKeyScreen"
android:exported="true"
android:theme="@style/Theme.UnCrack">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
Expand All @@ -29,6 +30,8 @@ import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.hilt.navigation.compose.hiltViewModel
Expand Down Expand Up @@ -108,6 +111,8 @@ fun ForgotPasswordContent(
modifier = Modifier
.fillMaxWidth(),
headerText = stringResource(R.string.enter_your_registered_mail),
maxLines = 1,
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Email, imeAction = ImeAction.Done),
value = email,
onValueChange = { email = it }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
Expand All @@ -37,6 +38,8 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
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 All @@ -49,6 +52,7 @@ import com.geekymusketeers.uncrack.components.UCTextField
import com.geekymusketeers.uncrack.presentation.auth.AuthViewModel
import com.geekymusketeers.uncrack.presentation.auth.forgotPassword.ForgotPasswordScreen
import com.geekymusketeers.uncrack.presentation.auth.signup.SignupScreen
import com.geekymusketeers.uncrack.presentation.masterKey.createMasterKey.CreateMasterKeyScreen
import com.geekymusketeers.uncrack.ui.theme.DMSansFontFamily
import com.geekymusketeers.uncrack.ui.theme.OnPrimaryContainerLight
import com.geekymusketeers.uncrack.ui.theme.PrimaryLight
Expand Down Expand Up @@ -137,6 +141,8 @@ fun LoginContent(
.fillMaxWidth(),
headerText = stringResource(R.string.email_header),
hintText = stringResource(R.string.email_hint),
maxLines = 1,
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Email, imeAction = ImeAction.Next),
value = email,
onValueChange = { viewModel.setEmail(it) }
)
Expand All @@ -148,6 +154,8 @@ fun LoginContent(
.fillMaxWidth(),
headerText = stringResource(R.string.password_header),
hintText = stringResource(R.string.password_hint),
maxLines = 1,
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password, imeAction = ImeAction.Done),
value = password,
onValueChange = { viewModel.setPassword(it) },
visualTransformation = if (passwordVisibility) VisualTransformation.None else PasswordVisualTransformation(),
Expand Down Expand Up @@ -204,7 +212,7 @@ fun LoginContent(
}
)
context.findActivity()?.apply {
startActivity(Intent(activity, MainActivity::class.java))
startActivity(Intent(activity, CreateMasterKeyScreen::class.java))
}
},
enabled = isSignInEnable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Scaffold
Expand All @@ -35,6 +36,8 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
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 @@ -131,6 +134,8 @@ fun SignupContent(
.fillMaxWidth(),
headerText = stringResource(R.string.name_header),
hintText = stringResource(R.string.name_hint),
maxLines = 1,
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text, imeAction = ImeAction.Next),
value = name,
onValueChange = { authViewModel.setUserName(it) }
)
Expand All @@ -143,6 +148,8 @@ fun SignupContent(
.fillMaxWidth(),
headerText = stringResource(R.string.email_header),
hintText = stringResource(R.string.email_hint),
maxLines = 1,
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Email, imeAction = ImeAction.Next),
value = email,
onValueChange = { authViewModel.setEmail(it) }
)
Expand All @@ -154,6 +161,8 @@ fun SignupContent(
.fillMaxWidth(),
headerText = stringResource(R.string.password_header),
hintText = stringResource(R.string.password_hint),
maxLines = 1,
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password, imeAction = ImeAction.Done),
value = password,
onValueChange = { authViewModel.setPassword(it) },
visualTransformation = if (passwordVisibility) VisualTransformation.None else PasswordVisualTransformation(),
Expand Down

0 comments on commit fa38524

Please sign in to comment.