mirror of
https://github.com/home-assistant/android
synced 2024-09-06 17:23:32 +00:00
Make more onboarding screens scrollable (#2987)
- Fixes not being able to continue as the buttons are off screen
This commit is contained in:
parent
6da455f1be
commit
326ab94652
|
@ -1,12 +1,15 @@
|
|||
package io.homeassistant.companion.android.onboarding.integration
|
||||
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxHeight
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.text.KeyboardActions
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material.Button
|
||||
import androidx.compose.material.Switch
|
||||
import androidx.compose.material.SwitchDefaults
|
||||
|
@ -37,14 +40,20 @@ fun MobileAppIntegrationView(
|
|||
onLocationTrackingChanged: (Boolean) -> Unit,
|
||||
onFinishClicked: () -> Unit
|
||||
) {
|
||||
|
||||
val scrollState = rememberScrollState()
|
||||
val keyboardController = LocalSoftwareKeyboardController.current
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxHeight()
|
||||
.fillMaxWidth()
|
||||
.padding(16.dp)
|
||||
) {
|
||||
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.verticalScroll(scrollState)
|
||||
.fillMaxWidth()
|
||||
.weight(1f)
|
||||
) {
|
||||
OnboardingHeaderView(
|
||||
icon = if (onboardingViewModel.deviceIsWatch) {
|
||||
CommunityMaterial.Icon3.cmd_watch
|
||||
|
@ -91,12 +100,17 @@ fun MobileAppIntegrationView(
|
|||
TextButton(onClick = openPrivacyPolicy) {
|
||||
Text(stringResource(id = commonR.string.privacy_url))
|
||||
}
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
Button(
|
||||
onClick = onFinishClicked,
|
||||
modifier = Modifier.align(Alignment.End)
|
||||
}
|
||||
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.padding(top = 16.dp)
|
||||
.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.End
|
||||
) {
|
||||
Button(onClick = onFinishClicked) {
|
||||
Text(stringResource(id = commonR.string.continue_connect))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,8 +3,10 @@ package io.homeassistant.companion.android.onboarding.manual
|
|||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.text.KeyboardActions
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material.Button
|
||||
import androidx.compose.material.Text
|
||||
import androidx.compose.material.TextField
|
||||
|
@ -28,10 +30,12 @@ fun ManualSetupView(
|
|||
onboardingViewModel: OnboardingViewModel,
|
||||
connectedClicked: () -> Unit
|
||||
) {
|
||||
val scrollState = rememberScrollState()
|
||||
val keyboardController = LocalSoftwareKeyboardController.current
|
||||
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.verticalScroll(scrollState)
|
||||
.fillMaxWidth()
|
||||
.padding(16.dp)
|
||||
) {
|
||||
|
|
Loading…
Reference in a new issue