Skip to content

Commit 61edbf9

Browse files
jkmasselclaude
andcommitted
Make login form scrollable for landscape support
Flatten the two-column layout into a single scrollable column so the text field and button don't get crushed when the keyboard opens on small devices in landscape mode. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b31a705 commit 61edbf9

File tree

1 file changed

+45
-53
lines changed

1 file changed

+45
-53
lines changed

WordPress/src/main/java/org/wordpress/android/ui/accounts/login/applicationpassword/LoginSiteApplicationPasswordScreen.kt

Lines changed: 45 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -97,68 +97,60 @@ fun LoginSiteApplicationPasswordScreen(
9797
.fillMaxSize()
9898
.padding(paddingValues)
9999
.imePadding()
100+
.verticalScroll(rememberScrollState())
101+
.padding(horizontal = 16.dp)
100102
) {
101-
Column(
102-
modifier = Modifier
103-
.weight(1f)
104-
.verticalScroll(rememberScrollState())
105-
.padding(horizontal = 16.dp)
106-
) {
107-
Spacer(modifier = Modifier.height(16.dp))
103+
Spacer(modifier = Modifier.height(16.dp))
108104

109-
Text(
110-
text = stringResource(R.string.enter_site_address),
111-
style = MaterialTheme.typography.bodyLarge,
112-
color = MaterialTheme.colorScheme.onSurface
113-
)
105+
Text(
106+
text = stringResource(R.string.enter_site_address),
107+
style = MaterialTheme.typography.bodyLarge,
108+
color = MaterialTheme.colorScheme.onSurface
109+
)
114110

115-
Spacer(modifier = Modifier.height(24.dp))
111+
Spacer(modifier = Modifier.height(24.dp))
116112

117-
OutlinedTextField(
118-
value = siteAddress,
119-
onValueChange = { newValue ->
120-
siteAddress = newValue
121-
onErrorDismissed()
122-
},
123-
modifier = Modifier
124-
.fillMaxWidth()
125-
.focusRequester(focusRequester),
126-
label = { Text(text = stringResource(R.string.login_site_address)) },
127-
isError = errorMessage != null,
128-
supportingText = errorMessage?.let { { Text(text = it) } },
129-
keyboardOptions = KeyboardOptions(
130-
keyboardType = KeyboardType.Uri,
131-
imeAction = ImeAction.Done
132-
),
133-
keyboardActions = KeyboardActions(
134-
onDone = {
135-
if (isValid && !isLoading) {
136-
onContinueClick(cleanedAddress)
137-
}
113+
OutlinedTextField(
114+
value = siteAddress,
115+
onValueChange = { newValue ->
116+
siteAddress = newValue
117+
onErrorDismissed()
118+
},
119+
modifier = Modifier
120+
.fillMaxWidth()
121+
.focusRequester(focusRequester),
122+
label = { Text(text = stringResource(R.string.login_site_address)) },
123+
isError = errorMessage != null,
124+
supportingText = errorMessage?.let { { Text(text = it) } },
125+
keyboardOptions = KeyboardOptions(
126+
keyboardType = KeyboardType.Uri,
127+
imeAction = ImeAction.Done
128+
),
129+
keyboardActions = KeyboardActions(
130+
onDone = {
131+
if (isValid && !isLoading) {
132+
onContinueClick(cleanedAddress)
138133
}
139-
),
140-
singleLine = true
141-
)
134+
}
135+
),
136+
singleLine = true
137+
)
142138

143-
LaunchedEffect(Unit) {
144-
focusRequester.requestFocus()
145-
}
139+
LaunchedEffect(Unit) {
140+
focusRequester.requestFocus()
146141
}
147142

148-
Surface(
149-
modifier = Modifier.fillMaxWidth(),
150-
tonalElevation = 2.dp
143+
Spacer(modifier = Modifier.weight(1f))
144+
145+
Button(
146+
onClick = { onContinueClick(cleanedAddress) },
147+
modifier = Modifier
148+
.fillMaxWidth()
149+
.navigationBarsPadding()
150+
.padding(vertical = 16.dp),
151+
enabled = isValid && !isLoading
151152
) {
152-
Button(
153-
onClick = { onContinueClick(cleanedAddress) },
154-
modifier = Modifier
155-
.fillMaxWidth()
156-
.navigationBarsPadding()
157-
.padding(16.dp),
158-
enabled = isValid && !isLoading
159-
) {
160-
Text(text = stringResource(R.string.login_continue))
161-
}
153+
Text(text = stringResource(R.string.login_continue))
162154
}
163155
}
164156
}

0 commit comments

Comments
 (0)