fix: issue in which sheet headers have no padding
Signed-off-by: Infi <infi@infi.sh>
This commit is contained in:
parent
33abcf4cbb
commit
fe3775a154
|
|
@ -71,8 +71,8 @@ class InviteActivity : ComponentActivity() {
|
||||||
|
|
||||||
val inviteCode = intent.data?.lastPathSegment
|
val inviteCode = intent.data?.lastPathSegment
|
||||||
|
|
||||||
window.statusBarColor = Color.Transparent.toArgb()
|
|
||||||
WindowCompat.setDecorFitsSystemWindows(window, false)
|
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||||
|
window.statusBarColor = Color.Transparent.toArgb()
|
||||||
|
|
||||||
setContent {
|
setContent {
|
||||||
InviteScreen(
|
InviteScreen(
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
package chat.revolt.components.generic
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
|
import androidx.compose.foundation.layout.BoxScope
|
||||||
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun SheetHeaderPadding(content: @Composable BoxScope.() -> Unit) {
|
||||||
|
Box(
|
||||||
|
Modifier
|
||||||
|
.padding(start = 16.dp, end = 16.dp, top = 16.dp)
|
||||||
|
.fillMaxWidth(), content = content)
|
||||||
|
}
|
||||||
|
|
@ -32,6 +32,7 @@ import chat.revolt.R
|
||||||
import chat.revolt.activities.InviteActivity
|
import chat.revolt.activities.InviteActivity
|
||||||
import chat.revolt.api.REVOLT_APP
|
import chat.revolt.api.REVOLT_APP
|
||||||
import chat.revolt.components.generic.FormTextField
|
import chat.revolt.components.generic.FormTextField
|
||||||
|
import chat.revolt.components.generic.SheetHeaderPadding
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun AddServerSheet() {
|
fun AddServerSheet() {
|
||||||
|
|
@ -51,14 +52,14 @@ fun AddServerSheet() {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(4.dp))
|
SheetHeaderPadding {
|
||||||
|
Text(
|
||||||
|
text = stringResource(id = R.string.add_server_sheet_title),
|
||||||
|
style = MaterialTheme.typography.headlineSmall
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
Text(
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
text = stringResource(id = R.string.add_server_sheet_title),
|
|
||||||
style = MaterialTheme.typography.headlineMedium
|
|
||||||
)
|
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(4.dp))
|
|
||||||
|
|
||||||
ListItem(
|
ListItem(
|
||||||
headlineContent = {
|
headlineContent = {
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ import androidx.compose.ui.unit.dp
|
||||||
import androidx.hilt.navigation.compose.hiltViewModel
|
import androidx.hilt.navigation.compose.hiltViewModel
|
||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import chat.revolt.R
|
import chat.revolt.R
|
||||||
|
import chat.revolt.components.generic.SheetHeaderPadding
|
||||||
import chat.revolt.components.generic.WebMarkdown
|
import chat.revolt.components.generic.WebMarkdown
|
||||||
import chat.revolt.internals.Changelog
|
import chat.revolt.internals.Changelog
|
||||||
import chat.revolt.internals.Changelogs
|
import chat.revolt.internals.Changelogs
|
||||||
|
|
@ -68,18 +69,20 @@ fun ChangelogSheet(
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
Text(
|
SheetHeaderPadding {
|
||||||
text = if (new) {
|
Text(
|
||||||
stringResource(R.string.settings_changelogs_new_header)
|
text = if (new) {
|
||||||
} else {
|
stringResource(R.string.settings_changelogs_new_header)
|
||||||
stringResource(
|
} else {
|
||||||
R.string.settings_changelogs_historical_version_header,
|
stringResource(
|
||||||
viewModel.changelog?.version
|
R.string.settings_changelogs_historical_version_header,
|
||||||
?: stringResource(R.string.settings_changelogs_historical_version_header_placeholder)
|
viewModel.changelog?.version
|
||||||
)
|
?: stringResource(R.string.settings_changelogs_historical_version_header_placeholder)
|
||||||
},
|
)
|
||||||
style = MaterialTheme.typography.headlineMedium
|
},
|
||||||
)
|
style = MaterialTheme.typography.headlineSmall
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
if (viewModel.changelogContents == null) {
|
if (viewModel.changelogContents == null) {
|
||||||
Box(
|
Box(
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ import chat.revolt.api.schemas.User
|
||||||
import chat.revolt.components.chat.MemberListItem
|
import chat.revolt.components.chat.MemberListItem
|
||||||
import chat.revolt.components.generic.CountableListHeader
|
import chat.revolt.components.generic.CountableListHeader
|
||||||
import chat.revolt.components.generic.Presence
|
import chat.revolt.components.generic.Presence
|
||||||
|
import chat.revolt.components.generic.SheetHeaderPadding
|
||||||
import chat.revolt.components.generic.presenceFromStatus
|
import chat.revolt.components.generic.presenceFromStatus
|
||||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||||
|
|
@ -254,10 +255,12 @@ fun MemberListSheet(
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
Text(
|
SheetHeaderPadding {
|
||||||
text = stringResource(R.string.channel_info_sheet_options_members),
|
Text(
|
||||||
style = MaterialTheme.typography.headlineMedium
|
text = stringResource(R.string.channel_info_sheet_options_members),
|
||||||
)
|
style = MaterialTheme.typography.headlineSmall
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
LazyColumn {
|
LazyColumn {
|
||||||
viewModel.fullItemList.forEachIndexed { index, item ->
|
viewModel.fullItemList.forEachIndexed { index, item ->
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue