Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit de3407d

Browse files
committedJul 29, 2024·
6.8 Login Screen UI
Signed-off-by: velosobr <linoc.veloso@gmail.com>
1 parent 0872c56 commit de3407d

File tree

2 files changed

+66
-54
lines changed

2 files changed

+66
-54
lines changed
 

‎auth/presentation/src/main/java/com/velosobr/auth/presentation/login/LoginScreen.kt

+65-53
Original file line numberDiff line numberDiff line change
@@ -92,58 +92,70 @@ private fun LoginScreen(
9292
) {
9393

9494
GradientBackground {
95-
Column(
96-
modifier = Modifier
97-
.verticalScroll(rememberScrollState())
98-
.fillMaxSize()
99-
.padding(horizontal = 16.dp)
100-
.padding(vertical = 32.dp)
101-
.padding(top = 16.dp)
95+
Box (
96+
modifier = Modifier.fillMaxSize()
10297
) {
103-
Text(
104-
text = stringResource(id = R.string.loggin_in),
105-
fontWeight = FontWeight.Bold,
106-
style = MaterialTheme.typography.headlineMedium
107-
)
108-
Text(
109-
text = stringResource(id = R.string.gorun_wellcome_text),
110-
fontSize = 12.sp,
111-
color = MaterialTheme.colorScheme.onSurfaceVariant
112-
)
113-
114-
Spacer(modifier = Modifier.height(48.dp))
115-
116-
GoRunTextField(
117-
state = state.email,
118-
startIcon = EmailIcon,
119-
endIcon = null,
120-
hint = stringResource(id = R.string.example_email),
121-
title = stringResource(id = R.string.email),
122-
modifier = Modifier.padding(bottom = 16.dp)
123-
)
124-
Spacer(modifier = Modifier.height(16.dp))
125-
126-
GoRunPasswordTextField(
127-
state = state.password,
128-
isPasswordVisible = state.isPasswordVisible,
129-
onTogglePasswordVisibility = { onAction(LoginAction.OnTogglePasswordVisibilityClick) },
130-
hint = stringResource(id = R.string.password),
131-
title = stringResource(id = R.string.password),
132-
)
133-
134-
Spacer(modifier = Modifier.height(32.dp))
135-
136-
GoRunActionButton(
137-
text = stringResource(id = R.string.login),
138-
isLoading = state.isLoggingIn,
139-
enabled = state.canLogin,
140-
onClick = {
141-
onAction(LoginAction.OnLoginClick)
142-
},
143-
)
144-
145-
Spacer(modifier = Modifier.height(16.dp))
146-
Row {
98+
Column(
99+
modifier = Modifier
100+
.verticalScroll(rememberScrollState())
101+
.fillMaxSize()
102+
.padding(horizontal = 16.dp)
103+
.padding(vertical = 32.dp)
104+
.padding(top = 16.dp)
105+
) {
106+
Text(
107+
text = stringResource(id = R.string.loggin_in),
108+
fontWeight = FontWeight.Bold,
109+
style = MaterialTheme.typography.headlineMedium
110+
)
111+
Text(
112+
text = stringResource(id = R.string.gorun_wellcome_text),
113+
fontSize = 12.sp,
114+
color = MaterialTheme.colorScheme.onSurfaceVariant
115+
)
116+
117+
Spacer(modifier = Modifier.height(48.dp))
118+
119+
GoRunTextField(
120+
state = state.email,
121+
startIcon = EmailIcon,
122+
endIcon = null,
123+
hint = stringResource(id = R.string.example_email),
124+
title = stringResource(id = R.string.email),
125+
modifier = Modifier.padding(bottom = 16.dp)
126+
)
127+
Spacer(modifier = Modifier.height(16.dp))
128+
129+
GoRunPasswordTextField(
130+
state = state.password,
131+
isPasswordVisible = state.isPasswordVisible,
132+
onTogglePasswordVisibility = { onAction(LoginAction.OnTogglePasswordVisibilityClick) },
133+
hint = stringResource(id = R.string.password),
134+
title = stringResource(id = R.string.password),
135+
)
136+
137+
Spacer(modifier = Modifier.height(32.dp))
138+
139+
GoRunActionButton(
140+
text = stringResource(id = R.string.login),
141+
isLoading = state.isLoggingIn,
142+
enabled = state.canLogin,
143+
onClick = {
144+
onAction(LoginAction.OnLoginClick)
145+
},
146+
)
147+
148+
Spacer(modifier = Modifier.height(16.dp))
149+
150+
151+
152+
}
153+
Row(
154+
modifier = Modifier
155+
.align(Alignment.BottomCenter)
156+
.padding(bottom = 16.dp
157+
158+
) {
147159
Text(
148160
text = stringResource(id = R.string.dont_have_an_account) + " ",
149161
style = TextStyle(
@@ -152,7 +164,8 @@ private fun LoginScreen(
152164
)
153165
val annotatedString = buildAnnotatedString {
154166
pushStringAnnotation(
155-
tag = "clickable_text", annotation = stringResource(id = R.string.sign_up)
167+
tag = "clickable_text",
168+
annotation = stringResource(id = R.string.sign_up)
156169
)
157170
withStyle(
158171
style = SpanStyle(
@@ -173,7 +186,6 @@ private fun LoginScreen(
173186

174187
})
175188
}
176-
177189
}
178190
}
179191
}

‎auth/presentation/src/main/res/values/strings.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<string name="registration_successful">Registration succesful! You can log in now.</string>
2323
<string name="loggin_in">Olá!</string>
2424
<string name="gorun_wellcome_text">Bem vindo ao seu mais novo amigo de corrida! Rastreie, analize e conquiste as suas corridas.</string>
25-
<string name="dont_have_an_account">não tem uma conta?</string>
25+
<string name="dont_have_an_account">Não tem uma conta?</string>
2626
<string name="login_success">voce esta logado.</string>
2727
<string name="forgot_password">forgot password</string>
2828
</resources>

0 commit comments

Comments
 (0)
Please sign in to comment.