style(login): fixed overflow making it difficult to type password with stoat instance field
This commit is contained in:
parent
1ca13ade68
commit
eb9a4fe344
|
|
@ -23,7 +23,8 @@ fun FormTextField(
|
|||
action: ImeAction = ImeAction.Done,
|
||||
supportingText: @Composable (() -> Unit)? = null,
|
||||
singleLine: Boolean = true,
|
||||
enabled: Boolean = true
|
||||
enabled: Boolean = true,
|
||||
placeholder: @Composable (() -> Unit)? = null,
|
||||
) {
|
||||
TextField(
|
||||
value = value,
|
||||
|
|
@ -34,6 +35,7 @@ fun FormTextField(
|
|||
label = { Text(label) },
|
||||
supportingText = supportingText,
|
||||
enabled = enabled,
|
||||
modifier = modifier
|
||||
modifier = modifier,
|
||||
placeholder = placeholder
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,8 +12,12 @@ import androidx.compose.foundation.layout.imePadding
|
|||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.safeDrawingPadding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.overscroll
|
||||
import androidx.compose.foundation.rememberOverscrollEffect
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.text.input.TextObfuscationMode
|
||||
import androidx.compose.foundation.text.input.rememberTextFieldState
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
|
|
@ -206,7 +210,9 @@ fun LoginScreen(navController: NavController, viewModel: LoginViewModel = hiltVi
|
|||
.fillMaxSize()
|
||||
.padding(20.dp)
|
||||
.imePadding()
|
||||
.safeDrawingPadding(),
|
||||
.safeDrawingPadding()
|
||||
.verticalScroll(rememberScrollState())
|
||||
.overscroll(rememberOverscrollEffect()),
|
||||
verticalArrangement = Arrangement.Center,
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
|
|
@ -230,18 +236,22 @@ fun LoginScreen(navController: NavController, viewModel: LoginViewModel = hiltVi
|
|||
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.width(270.dp),
|
||||
.width(270.dp)
|
||||
.overscroll(rememberOverscrollEffect())
|
||||
.verticalScroll(rememberScrollState()),
|
||||
verticalArrangement = Arrangement.Center,
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
FormTextField(
|
||||
value = viewModel.stoatInstanceUrl,
|
||||
label = "Stoat instance", // FIXME hardcoded string
|
||||
label = stringResource(R.string.stoat_instance), // TODO: needs translations
|
||||
type = KeyboardType.Uri,
|
||||
action = ImeAction.Next,
|
||||
onChange = viewModel::setStoatInstanceUrl,
|
||||
modifier = Modifier
|
||||
.padding(vertical = 25.dp)
|
||||
.padding(vertical = 25.dp),
|
||||
placeholder = {Text(text = STOAT_WEB_APP_DEFAULT)},
|
||||
supportingText = {Text(text = stringResource(R.string.stoat_instance_hint))}
|
||||
)
|
||||
FormTextField(
|
||||
value = viewModel.email,
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@
|
|||
<string name="login_onboarding_heading">Find your community, connect with the world.</string>
|
||||
<string name="login_onboarding_body">Stoat is one of the best ways to stay connected with your friends and community, anywhere, anytime.</string>
|
||||
|
||||
<string name="stoat_instance">Stoat host</string>
|
||||
<string name="stoat_instance_hint">This is the base URL of the Stoat instance you\'re logging in to, if you want to connect to self-hosted instances. You can leave this blank to use the official Stoat instance.</string>
|
||||
<string name="email">Email</string>
|
||||
<string name="password">Password</string>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue