Do not show nickname field for Note to Self.

This commit is contained in:
Nicholas Tinsley
2024-03-29 12:54:35 -04:00
parent 939024faff
commit 88f6ab915e
2 changed files with 34 additions and 2 deletions

View File

@@ -503,7 +503,7 @@ class ConversationSettingsFragment : DSLSettingsFragment(
)
}
if (FeatureFlags.nicknames() && state.recipient.isIndividual) {
if (FeatureFlags.nicknames() && state.recipient.isIndividual && !state.recipient.isSelf) {
clickPref(
title = DSLSettingsText.from(R.string.NicknameActivity__nickname),
icon = DSLSettingsIcon.from(R.drawable.symbol_edit_24),

View File

@@ -193,7 +193,7 @@ private fun Content(
AboutRow(
startIcon = painterResource(R.drawable.symbol_person_24),
text = if (model.hasUserSetDisplayName && model.displayName.isNotBlank() && model.profileName.isNotBlank()) {
text = if (!model.isSelf && model.hasUserSetDisplayName && model.displayName.isNotBlank() && model.profileName.isNotBlank()) {
stringResource(id = R.string.AboutSheet__user_set_display_name_and_profile_name, model.displayName, model.profileName)
} else {
model.displayName
@@ -428,6 +428,38 @@ private fun ContentPreviewWithUserSetDisplayName() {
}
}
@Preview(name = "Light Theme", group = "content", uiMode = Configuration.UI_MODE_NIGHT_NO)
@Preview(name = "Dark Theme", group = "content", uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable
private fun ContentPreviewForSelf() {
SignalTheme {
Surface {
Content(
model = AboutModel(
isSelf = true,
hasAvatar = true,
displayName = "Amazing Spider-man",
shortName = "Spiderman",
profileName = "Peter Parker",
hasUserSetDisplayName = true,
about = "Photographer for the Daily Bugle.",
verified = true,
recipientForAvatar = Recipient.UNKNOWN,
formattedE164 = "(123) 456-7890",
profileSharing = true,
systemContact = true,
groupsInCommon = 0,
note = "Weird Things Happen To Me All The Time."
),
onClickSignalConnections = {},
onAvatarClicked = {},
onNoteClicked = {}
)
}
}
}
@Preview(name = "Light Theme", group = "content", uiMode = Configuration.UI_MODE_NIGHT_NO)
@Preview(name = "Dark Theme", group = "content", uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable