Make text parts in bold.
This commit is contained in:
parent
effb1c57fe
commit
c878e9beb5
3 changed files with 34 additions and 10 deletions
|
|
@ -54,6 +54,7 @@ import io.element.android.libraries.designsystem.components.form.textFieldState
|
||||||
import io.element.android.libraries.designsystem.components.list.SwitchListItem
|
import io.element.android.libraries.designsystem.components.list.SwitchListItem
|
||||||
import io.element.android.libraries.designsystem.preview.ElementPreview
|
import io.element.android.libraries.designsystem.preview.ElementPreview
|
||||||
import io.element.android.libraries.designsystem.preview.PreviewsDayNight
|
import io.element.android.libraries.designsystem.preview.PreviewsDayNight
|
||||||
|
import io.element.android.libraries.designsystem.text.buildAnnotatedStringWithStyledPart
|
||||||
import io.element.android.libraries.designsystem.theme.aliasScreenTitle
|
import io.element.android.libraries.designsystem.theme.aliasScreenTitle
|
||||||
import io.element.android.libraries.designsystem.theme.components.Button
|
import io.element.android.libraries.designsystem.theme.components.Button
|
||||||
import io.element.android.libraries.designsystem.theme.components.Icon
|
import io.element.android.libraries.designsystem.theme.components.Icon
|
||||||
|
|
@ -168,14 +169,26 @@ private fun Content(
|
||||||
verticalArrangement = Arrangement.spacedBy(16.dp),
|
verticalArrangement = Arrangement.spacedBy(16.dp),
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.screen_deactivate_account_description),
|
text = buildAnnotatedStringWithStyledPart(
|
||||||
|
R.string.screen_deactivate_account_description,
|
||||||
|
R.string.screen_deactivate_account_description_bold_part,
|
||||||
|
color = ElementTheme.colors.textSecondary,
|
||||||
|
bold = true,
|
||||||
|
underline = false,
|
||||||
|
),
|
||||||
style = ElementTheme.typography.fontBodyMdRegular,
|
style = ElementTheme.typography.fontBodyMdRegular,
|
||||||
color = ElementTheme.colors.textSecondary,
|
color = ElementTheme.colors.textSecondary,
|
||||||
)
|
)
|
||||||
InfoListOrganism(
|
InfoListOrganism(
|
||||||
items = persistentListOf(
|
items = persistentListOf(
|
||||||
InfoListItem(
|
InfoListItem(
|
||||||
message = stringResource(R.string.screen_deactivate_account_list_item_1),
|
message = buildAnnotatedStringWithStyledPart(
|
||||||
|
R.string.screen_deactivate_account_list_item_1,
|
||||||
|
R.string.screen_deactivate_account_list_item_1_bold_part,
|
||||||
|
color = ElementTheme.colors.textSecondary,
|
||||||
|
bold = true,
|
||||||
|
underline = false,
|
||||||
|
),
|
||||||
iconComposable = {
|
iconComposable = {
|
||||||
Icon(
|
Icon(
|
||||||
modifier = Modifier.size(20.dp),
|
modifier = Modifier.size(20.dp),
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,10 @@
|
||||||
<string name="screen_deactivate_account_confirmation_dialog_content">"Please confirm that you want to deactivate your account. This action cannot be undone."</string>
|
<string name="screen_deactivate_account_confirmation_dialog_content">"Please confirm that you want to deactivate your account. This action cannot be undone."</string>
|
||||||
<string name="screen_deactivate_account_delete_all_messages">"Delete all my messages"</string>
|
<string name="screen_deactivate_account_delete_all_messages">"Delete all my messages"</string>
|
||||||
<string name="screen_deactivate_account_delete_all_messages_notice">"Warning: Future users may see incomplete conversations."</string>
|
<string name="screen_deactivate_account_delete_all_messages_notice">"Warning: Future users may see incomplete conversations."</string>
|
||||||
<string name="screen_deactivate_account_description">"Deactivating your account is irreversible, it will:"</string>
|
<string name="screen_deactivate_account_description">"Deactivating your account is %1$s, it will:"</string>
|
||||||
<string name="screen_deactivate_account_list_item_1">"Permanently disable your account (you can\'t log back in, and your ID can\'t be reused)."</string>
|
<string name="screen_deactivate_account_description_bold_part">"irreversible"</string>
|
||||||
|
<string name="screen_deactivate_account_list_item_1">"%1$s your account (you can\'t log back in, and your ID can\'t be reused)."</string>
|
||||||
|
<string name="screen_deactivate_account_list_item_1_bold_part">"Permanently disable"</string>
|
||||||
<string name="screen_deactivate_account_list_item_2">"Remove you from all chat rooms."</string>
|
<string name="screen_deactivate_account_list_item_2">"Remove you from all chat rooms."</string>
|
||||||
<string name="screen_deactivate_account_list_item_3">"Delete your account information from our identity server."</string>
|
<string name="screen_deactivate_account_list_item_3">"Delete your account information from our identity server."</string>
|
||||||
<string name="screen_deactivate_account_list_item_4">"Your messages will still be visible to registered users but won’t be available to new or unregistered users if you choose to delete them."</string>
|
<string name="screen_deactivate_account_list_item_4">"Your messages will still be visible to registered users but won’t be available to new or unregistered users if you choose to delete them."</string>
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.graphics.vector.ImageVector
|
import androidx.compose.ui.graphics.vector.ImageVector
|
||||||
|
import androidx.compose.ui.text.AnnotatedString
|
||||||
import androidx.compose.ui.text.TextStyle
|
import androidx.compose.ui.text.TextStyle
|
||||||
import androidx.compose.ui.unit.Dp
|
import androidx.compose.ui.unit.Dp
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
|
@ -54,11 +55,19 @@ fun InfoListOrganism(
|
||||||
}
|
}
|
||||||
InfoListItemMolecule(
|
InfoListItemMolecule(
|
||||||
message = {
|
message = {
|
||||||
Text(
|
if (item.message is AnnotatedString) {
|
||||||
text = item.message,
|
Text(
|
||||||
style = textStyle,
|
text = item.message,
|
||||||
color = textColor,
|
style = textStyle,
|
||||||
)
|
color = textColor,
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
Text(
|
||||||
|
text = item.message.toString(),
|
||||||
|
style = textStyle,
|
||||||
|
color = textColor,
|
||||||
|
)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
icon = {
|
icon = {
|
||||||
if (item.iconId != null) {
|
if (item.iconId != null) {
|
||||||
|
|
@ -87,7 +96,7 @@ fun InfoListOrganism(
|
||||||
}
|
}
|
||||||
|
|
||||||
data class InfoListItem(
|
data class InfoListItem(
|
||||||
val message: String,
|
val message: CharSequence,
|
||||||
@DrawableRes val iconId: Int? = null,
|
@DrawableRes val iconId: Int? = null,
|
||||||
val iconVector: ImageVector? = null,
|
val iconVector: ImageVector? = null,
|
||||||
val iconComposable: @Composable () -> Unit = {},
|
val iconComposable: @Composable () -> Unit = {},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue