fix: layout fixes for self user overview

Signed-off-by: Infi <wingit@geist.ga>
This commit is contained in:
Infi 2023-06-12 17:58:06 +02:00
parent b4f468132a
commit bf8acdcb05
2 changed files with 137 additions and 128 deletions

View File

@ -8,6 +8,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
@ -83,12 +84,13 @@ fun SelfUserOverview() {
userId = selfUser.id ?: ULID.makeSpecial(0),
avatar = selfUser.avatar,
size = 48.dp,
presence = presenceFromStatus(selfUser.status?.presence ?: "offline"),
presence = presenceFromStatus(selfUser.status?.presence ?: "Offline"),
)
Spacer(modifier = Modifier.width(12.dp))
Text(text = AnnotatedString.Builder().apply {
Text(
text = AnnotatedString.Builder().apply {
if (selfUser.displayName != null) {
pushStyle(SpanStyle(fontWeight = FontWeight.Bold))
append(selfUser.displayName)
@ -99,7 +101,9 @@ fun SelfUserOverview() {
pushStyle(SpanStyle(fontWeight = FontWeight.ExtraLight))
append("#${selfUser.discriminator}")
pop()
}.toAnnotatedString())
}.toAnnotatedString(),
color = if (profile?.background != null) Color.White else LocalContentColor.current,
)
}
}
}

View File

@ -44,13 +44,17 @@ fun SettingsScreen(
navController.popBackStack()
})
Column(
modifier = Modifier
.fillMaxSize()
.verticalScroll(rememberScrollState())
) {
SelfUserOverview()
Column(
modifier = Modifier
.fillMaxSize()
.padding(10.dp)
.verticalScroll(rememberScrollState())
) {
Text(
text = stringResource(id = R.string.settings_category_general),
@ -185,4 +189,5 @@ fun SettingsScreen(
}
}
}
}
}