Fix scrolling on login
This commit is contained in:
parent
3b0027b8b5
commit
e54520c2fa
3 changed files with 16 additions and 7 deletions
|
|
@ -47,7 +47,6 @@ class MainActivity : ComponentActivity() {
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
// FIXME Scrolling is broken on login screens. Commenting this line fixes the issue.
|
|
||||||
WindowCompat.setDecorFitsSystemWindows(window, false)
|
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||||
setContent {
|
setContent {
|
||||||
ElementXTheme {
|
ElementXTheme {
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,8 @@ fun LoginContent(
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
|
.systemBarsPadding()
|
||||||
|
.imePadding()
|
||||||
) {
|
) {
|
||||||
val scrollState = rememberScrollState()
|
val scrollState = rememberScrollState()
|
||||||
Column(
|
Column(
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ import com.airbnb.mvrx.Loading
|
||||||
import com.airbnb.mvrx.Success
|
import com.airbnb.mvrx.Success
|
||||||
import com.airbnb.mvrx.compose.collectAsState
|
import com.airbnb.mvrx.compose.collectAsState
|
||||||
import com.airbnb.mvrx.compose.mavericksViewModel
|
import com.airbnb.mvrx.compose.mavericksViewModel
|
||||||
|
import io.element.android.x.designsystem.ElementXTheme
|
||||||
import io.element.android.x.designsystem.components.VectorIcon
|
import io.element.android.x.designsystem.components.VectorIcon
|
||||||
import io.element.android.x.features.login.R
|
import io.element.android.x.features.login.R
|
||||||
import io.element.android.x.features.login.error.changeServerError
|
import io.element.android.x.features.login.error.changeServerError
|
||||||
|
|
@ -53,14 +54,19 @@ fun ChangeServerContent(
|
||||||
onChangeServerSuccess: () -> Unit = {},
|
onChangeServerSuccess: () -> Unit = {},
|
||||||
) {
|
) {
|
||||||
Surface(color = MaterialTheme.colorScheme.background) {
|
Surface(color = MaterialTheme.colorScheme.background) {
|
||||||
Box(modifier = Modifier.fillMaxSize()) {
|
val scrollState = rememberScrollState()
|
||||||
val scrollState = rememberScrollState()
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxSize()
|
||||||
|
.systemBarsPadding()
|
||||||
|
.imePadding()
|
||||||
|
) {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.verticalScroll(
|
.verticalScroll(
|
||||||
state = scrollState,
|
state = scrollState,
|
||||||
)
|
)
|
||||||
.padding(horizontal = 16.dp),
|
.padding(horizontal = 16.dp)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
val isError = state.changeServerAction is Fail
|
val isError = state.changeServerAction is Fail
|
||||||
|
|
@ -158,7 +164,9 @@ fun ChangeServerContent(
|
||||||
@Composable
|
@Composable
|
||||||
@Preview
|
@Preview
|
||||||
fun ChangeServerContentPreview() {
|
fun ChangeServerContentPreview() {
|
||||||
ChangeServerContent(
|
ElementXTheme {
|
||||||
state = ChangeServerViewState(homeserver = "matrix.org"),
|
ChangeServerContent(
|
||||||
)
|
state = ChangeServerViewState(homeserver = "matrix.org"),
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue