Merge pull request #309 from ouchadam/bug-allow-profile-to-scroll
Fix profile page not scrolling when the screen is small
This commit is contained in:
commit
2a17f9d165
|
@ -6,7 +6,9 @@ import androidx.compose.foundation.background
|
|||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.CameraAlt
|
||||
import androidx.compose.material.icons.filled.Settings
|
||||
|
@ -68,15 +70,15 @@ private fun ProfilePage(context: Context, viewModel: ProfileState, profile: Page
|
|||
IconButton(onClick = { context.startActivity(Intent(context, SettingsActivity::class.java)) }) {
|
||||
Icon(imageVector = Icons.Filled.Settings, contentDescription = "Settings")
|
||||
}
|
||||
}
|
||||
|
||||
val scrollState = rememberScrollState()
|
||||
when (val state = profile.content) {
|
||||
is Lce.Loading -> CenteredLoading()
|
||||
is Lce.Error -> GenericError { viewModel.dispatch(ProfileAction.ComponentLifecycle.Visible) }
|
||||
is Lce.Content -> {
|
||||
val configuration = LocalConfiguration.current
|
||||
val content = state.value
|
||||
Column {
|
||||
Column(modifier = Modifier.verticalScroll(scrollState).padding(top = 32.dp)) {
|
||||
Spacer(modifier = Modifier.fillMaxHeight(0.05f))
|
||||
Box(modifier = Modifier.fillMaxWidth(), contentAlignment = Alignment.Center) {
|
||||
val fallbackLabel = content.me.displayName ?: content.me.userId.value
|
||||
|
@ -121,6 +123,7 @@ private fun ProfilePage(context: Context, viewModel: ProfileState, profile: Page
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
|
Loading…
Reference in New Issue