mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-29 07:38:54 +00:00
fix indentation
This commit is contained in:
+91
-91
@@ -192,109 +192,109 @@ fun GroupLinkLayout(
|
||||
}
|
||||
|
||||
Box(Modifier.fillMaxSize().background(MaterialTheme.colors.surface)) {
|
||||
ColumnWithScrollBar {
|
||||
AppBarTitle(stringResource(if (isChannel) MR.strings.channel_link else MR.strings.group_link))
|
||||
Text(
|
||||
stringResource(if (isChannel) MR.strings.you_can_share_channel_link_anybody_will_be_able_to_connect else MR.strings.you_can_share_group_link_anybody_will_be_able_to_connect),
|
||||
Modifier.padding(start = DEFAULT_PADDING, end = DEFAULT_PADDING, bottom = 12.dp),
|
||||
lineHeight = 22.sp
|
||||
)
|
||||
Column(
|
||||
Modifier.fillMaxWidth(),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.SpaceEvenly
|
||||
) {
|
||||
if (groupLink == null) {
|
||||
Row(
|
||||
horizontalArrangement = Arrangement.spacedBy(10.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = Modifier.padding(horizontal = DEFAULT_PADDING, vertical = 10.dp)
|
||||
) {
|
||||
SimpleButton(stringResource(MR.strings.button_create_group_link), icon = painterResource(MR.images.ic_add_link), disabled = creatingLink, click = createLink)
|
||||
if (creatingGroup && close != null) {
|
||||
ContinueButton(close)
|
||||
ColumnWithScrollBar {
|
||||
AppBarTitle(stringResource(if (isChannel) MR.strings.channel_link else MR.strings.group_link))
|
||||
Text(
|
||||
stringResource(if (isChannel) MR.strings.you_can_share_channel_link_anybody_will_be_able_to_connect else MR.strings.you_can_share_group_link_anybody_will_be_able_to_connect),
|
||||
Modifier.padding(start = DEFAULT_PADDING, end = DEFAULT_PADDING, bottom = 12.dp),
|
||||
lineHeight = 22.sp
|
||||
)
|
||||
Column(
|
||||
Modifier.fillMaxWidth(),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.SpaceEvenly
|
||||
) {
|
||||
if (groupLink == null) {
|
||||
Row(
|
||||
horizontalArrangement = Arrangement.spacedBy(10.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = Modifier.padding(horizontal = DEFAULT_PADDING, vertical = 10.dp)
|
||||
) {
|
||||
SimpleButton(stringResource(MR.strings.button_create_group_link), icon = painterResource(MR.images.ic_add_link), disabled = creatingLink, click = createLink)
|
||||
if (creatingGroup && close != null) {
|
||||
ContinueButton(close)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!isChannel) {
|
||||
RoleSelectionRow(groupInfo, groupLinkMemberRole)
|
||||
}
|
||||
var initialLaunch by remember { mutableStateOf(true) }
|
||||
LaunchedEffect(groupLinkMemberRole.value) {
|
||||
if (!initialLaunch) {
|
||||
updateLink()
|
||||
} else {
|
||||
if (!isChannel) {
|
||||
RoleSelectionRow(groupInfo, groupLinkMemberRole)
|
||||
}
|
||||
initialLaunch = false
|
||||
}
|
||||
val showShortLink = remember { mutableStateOf(true) }
|
||||
Spacer(Modifier.height(DEFAULT_PADDING_HALF))
|
||||
SectionViewWithButton(
|
||||
titleButton =
|
||||
if (!isChannel && groupLink.connLinkContact.connShortLink != null) {
|
||||
{ ToggleShortLinkButton(showShortLink) }
|
||||
} else null) {
|
||||
SimpleXCreatedLinkQRCode(groupLink.connLinkContact, short = showShortLink.value)
|
||||
}
|
||||
if (!isChannel && groupLink.shouldBeUpgraded) {
|
||||
var initialLaunch by remember { mutableStateOf(true) }
|
||||
LaunchedEffect(groupLinkMemberRole.value) {
|
||||
if (!initialLaunch) {
|
||||
updateLink()
|
||||
}
|
||||
initialLaunch = false
|
||||
}
|
||||
val showShortLink = remember { mutableStateOf(true) }
|
||||
Spacer(Modifier.height(DEFAULT_PADDING_HALF))
|
||||
SectionViewWithButton(
|
||||
titleButton =
|
||||
if (!isChannel && groupLink.connLinkContact.connShortLink != null) {
|
||||
{ ToggleShortLinkButton(showShortLink) }
|
||||
} else null) {
|
||||
SimpleXCreatedLinkQRCode(groupLink.connLinkContact, short = showShortLink.value)
|
||||
}
|
||||
if (!isChannel && groupLink.shouldBeUpgraded) {
|
||||
SettingsActionItem(
|
||||
painterResource(MR.images.ic_add),
|
||||
stringResource(MR.strings.upgrade_group_link),
|
||||
click = { showAddShortLinkAlert(null) },
|
||||
iconColor = MaterialTheme.colors.primary,
|
||||
textColor = MaterialTheme.colors.primary,
|
||||
)
|
||||
}
|
||||
val clipboard = LocalClipboardManager.current
|
||||
SettingsActionItem(
|
||||
painterResource(MR.images.ic_add),
|
||||
stringResource(MR.strings.upgrade_group_link),
|
||||
click = { showAddShortLinkAlert(null) },
|
||||
iconColor = MaterialTheme.colors.primary,
|
||||
textColor = MaterialTheme.colors.primary,
|
||||
)
|
||||
}
|
||||
val clipboard = LocalClipboardManager.current
|
||||
SettingsActionItem(
|
||||
painterResource(MR.images.ic_share),
|
||||
stringResource(MR.strings.share_link),
|
||||
click = {
|
||||
if (!isChannel && groupLink.shouldBeUpgraded) {
|
||||
showAddShortLinkAlert {
|
||||
painterResource(MR.images.ic_share),
|
||||
stringResource(MR.strings.share_link),
|
||||
click = {
|
||||
if (!isChannel && groupLink.shouldBeUpgraded) {
|
||||
showAddShortLinkAlert {
|
||||
clipboard.shareText(groupLink.connLinkContact.simplexChatUri(short = showShortLink.value))
|
||||
}
|
||||
} else {
|
||||
clipboard.shareText(groupLink.connLinkContact.simplexChatUri(short = showShortLink.value))
|
||||
}
|
||||
} else {
|
||||
clipboard.shareText(groupLink.connLinkContact.simplexChatUri(short = showShortLink.value))
|
||||
}
|
||||
},
|
||||
iconColor = MaterialTheme.colors.primary,
|
||||
textColor = MaterialTheme.colors.primary,
|
||||
)
|
||||
if (shareGroupInfo != null && isChannel) {
|
||||
SettingsActionItem(
|
||||
painterResource(MR.images.ic_forward),
|
||||
stringResource(MR.strings.share_via_chat),
|
||||
click = {
|
||||
chatModel.sharedContent.value = SharedContent.ChatLink(shareGroupInfo)
|
||||
chatModel.chatId.value = null
|
||||
ModalManager.closeAllModalsEverywhere()
|
||||
},
|
||||
iconColor = MaterialTheme.colors.primary,
|
||||
textColor = MaterialTheme.colors.primary,
|
||||
)
|
||||
}
|
||||
if (!creatingGroup && !isChannel) {
|
||||
SettingsActionItem(
|
||||
painterResource(MR.images.ic_delete),
|
||||
stringResource(MR.strings.delete_link),
|
||||
click = deleteLink,
|
||||
iconColor = Color.Red,
|
||||
textColor = Color.Red,
|
||||
)
|
||||
}
|
||||
if (creatingGroup && close != null) {
|
||||
SettingsActionItem(
|
||||
painterResource(MR.images.ic_check),
|
||||
stringResource(MR.strings.continue_to_next_step),
|
||||
click = close,
|
||||
iconColor = MaterialTheme.colors.primary,
|
||||
textColor = MaterialTheme.colors.primary,
|
||||
)
|
||||
if (shareGroupInfo != null && isChannel) {
|
||||
SettingsActionItem(
|
||||
painterResource(MR.images.ic_forward),
|
||||
stringResource(MR.strings.share_via_chat),
|
||||
click = {
|
||||
chatModel.sharedContent.value = SharedContent.ChatLink(shareGroupInfo)
|
||||
chatModel.chatId.value = null
|
||||
ModalManager.closeAllModalsEverywhere()
|
||||
},
|
||||
iconColor = MaterialTheme.colors.primary,
|
||||
textColor = MaterialTheme.colors.primary,
|
||||
)
|
||||
}
|
||||
if (!creatingGroup && !isChannel) {
|
||||
SettingsActionItem(
|
||||
painterResource(MR.images.ic_delete),
|
||||
stringResource(MR.strings.delete_link),
|
||||
click = deleteLink,
|
||||
iconColor = Color.Red,
|
||||
textColor = Color.Red,
|
||||
)
|
||||
}
|
||||
if (creatingGroup && close != null) {
|
||||
SettingsActionItem(
|
||||
painterResource(MR.images.ic_check),
|
||||
stringResource(MR.strings.continue_to_next_step),
|
||||
click = close,
|
||||
iconColor = MaterialTheme.colors.primary,
|
||||
textColor = MaterialTheme.colors.primary,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
SectionBottomSpacer()
|
||||
}
|
||||
SectionBottomSpacer()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+81
-81
@@ -73,103 +73,103 @@ fun TagListView(rhId: Long?, chat: Chat? = null, close: () -> Unit, reorderMode:
|
||||
val topPaddingToContent = topPaddingToContent(false)
|
||||
|
||||
Box(Modifier.fillMaxSize().background(MaterialTheme.colors.surface)) {
|
||||
LazyColumnWithScrollBar(
|
||||
modifier = if (reorderMode) Modifier.dragContainer(dragDropState) else Modifier,
|
||||
state = listState,
|
||||
contentPadding = PaddingValues(
|
||||
top = if (oneHandUI.value) WindowInsets.statusBars.asPaddingValues().calculateTopPadding() else topPaddingToContent,
|
||||
bottom = if (oneHandUI.value) WindowInsets.navigationBars.asPaddingValues().calculateBottomPadding() + AppBarHeight * fontSizeSqrtMultiplier else 0.dp
|
||||
),
|
||||
verticalArrangement = if (oneHandUI.value) Arrangement.Bottom else Arrangement.Top,
|
||||
) {
|
||||
@Composable fun CreateList() {
|
||||
SectionItemView({
|
||||
ModalManager.start.showModalCloseable { close ->
|
||||
TagListEditor(rhId = rhId, close = close, chat = chat)
|
||||
LazyColumnWithScrollBar(
|
||||
modifier = if (reorderMode) Modifier.dragContainer(dragDropState) else Modifier,
|
||||
state = listState,
|
||||
contentPadding = PaddingValues(
|
||||
top = if (oneHandUI.value) WindowInsets.statusBars.asPaddingValues().calculateTopPadding() else topPaddingToContent,
|
||||
bottom = if (oneHandUI.value) WindowInsets.navigationBars.asPaddingValues().calculateBottomPadding() + AppBarHeight * fontSizeSqrtMultiplier else 0.dp
|
||||
),
|
||||
verticalArrangement = if (oneHandUI.value) Arrangement.Bottom else Arrangement.Top,
|
||||
) {
|
||||
@Composable fun CreateList() {
|
||||
SectionItemView({
|
||||
ModalManager.start.showModalCloseable { close ->
|
||||
TagListEditor(rhId = rhId, close = close, chat = chat)
|
||||
}
|
||||
}) {
|
||||
Icon(painterResource(MR.images.ic_add), stringResource(MR.strings.create_list), tint = MaterialTheme.colors.primary)
|
||||
Spacer(Modifier.padding(horizontal = 4.dp))
|
||||
Text(stringResource(MR.strings.create_list), color = MaterialTheme.colors.primary)
|
||||
}
|
||||
}) {
|
||||
Icon(painterResource(MR.images.ic_add), stringResource(MR.strings.create_list), tint = MaterialTheme.colors.primary)
|
||||
Spacer(Modifier.padding(horizontal = 4.dp))
|
||||
Text(stringResource(MR.strings.create_list), color = MaterialTheme.colors.primary)
|
||||
}
|
||||
}
|
||||
|
||||
if (oneHandUI.value && !reorderMode) {
|
||||
item {
|
||||
CreateList()
|
||||
if (oneHandUI.value && !reorderMode) {
|
||||
item {
|
||||
CreateList()
|
||||
}
|
||||
}
|
||||
}
|
||||
itemsIndexed(userTags.value, key = { _, item -> item.chatTagId }) { index, tag ->
|
||||
DraggableItem(dragDropState, index) { isDragging ->
|
||||
val elevation by animateDpAsState(if (isDragging) 4.dp else 0.dp)
|
||||
itemsIndexed(userTags.value, key = { _, item -> item.chatTagId }) { index, tag ->
|
||||
DraggableItem(dragDropState, index) { isDragging ->
|
||||
val elevation by animateDpAsState(if (isDragging) 4.dp else 0.dp)
|
||||
|
||||
Card(
|
||||
elevation = elevation,
|
||||
backgroundColor = if (isDragging) colors.surface else Color.Unspecified
|
||||
) {
|
||||
Column {
|
||||
val selected = chatTagIds.value.contains(tag.chatTagId)
|
||||
Card(
|
||||
elevation = elevation,
|
||||
backgroundColor = if (isDragging) colors.surface else Color.Unspecified
|
||||
) {
|
||||
Column {
|
||||
val selected = chatTagIds.value.contains(tag.chatTagId)
|
||||
|
||||
Row(
|
||||
Modifier
|
||||
.fillMaxWidth()
|
||||
.sizeIn(minHeight = DEFAULT_MIN_SECTION_ITEM_HEIGHT)
|
||||
.clickable(
|
||||
enabled = !saving.value && !reorderMode,
|
||||
onClick = {
|
||||
if (chat == null) {
|
||||
ModalManager.start.showModalCloseable { close ->
|
||||
TagListEditor(
|
||||
rhId = rhId,
|
||||
tagId = tag.chatTagId,
|
||||
close = close,
|
||||
emoji = tag.chatTagEmoji,
|
||||
name = tag.chatTagText,
|
||||
)
|
||||
Row(
|
||||
Modifier
|
||||
.fillMaxWidth()
|
||||
.sizeIn(minHeight = DEFAULT_MIN_SECTION_ITEM_HEIGHT)
|
||||
.clickable(
|
||||
enabled = !saving.value && !reorderMode,
|
||||
onClick = {
|
||||
if (chat == null) {
|
||||
ModalManager.start.showModalCloseable { close ->
|
||||
TagListEditor(
|
||||
rhId = rhId,
|
||||
tagId = tag.chatTagId,
|
||||
close = close,
|
||||
emoji = tag.chatTagEmoji,
|
||||
name = tag.chatTagText,
|
||||
)
|
||||
}
|
||||
} else {
|
||||
saving.value = true
|
||||
setTag(rhId = rhId, tagId = if (selected) null else tag.chatTagId, chat = chat, close = {
|
||||
saving.value = false
|
||||
close()
|
||||
})
|
||||
}
|
||||
} else {
|
||||
saving.value = true
|
||||
setTag(rhId = rhId, tagId = if (selected) null else tag.chatTagId, chat = chat, close = {
|
||||
saving.value = false
|
||||
close()
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
)
|
||||
.padding(PaddingValues(horizontal = DEFAULT_PADDING, vertical = DEFAULT_MIN_SECTION_ITEM_PADDING_VERTICAL)),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
if (tag.chatTagEmoji != null) {
|
||||
ReactionIcon(tag.chatTagEmoji, fontSize = 14.sp)
|
||||
} else {
|
||||
Icon(painterResource(MR.images.ic_label), null, Modifier.size(18.sp.toDp()), tint = MaterialTheme.colors.onBackground)
|
||||
}
|
||||
Spacer(Modifier.padding(horizontal = 4.dp))
|
||||
Text(
|
||||
tag.chatTagText,
|
||||
color = MenuTextColor,
|
||||
fontWeight = if (selected) FontWeight.Medium else FontWeight.Normal
|
||||
)
|
||||
.padding(PaddingValues(horizontal = DEFAULT_PADDING, vertical = DEFAULT_MIN_SECTION_ITEM_PADDING_VERTICAL)),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
if (tag.chatTagEmoji != null) {
|
||||
ReactionIcon(tag.chatTagEmoji, fontSize = 14.sp)
|
||||
} else {
|
||||
Icon(painterResource(MR.images.ic_label), null, Modifier.size(18.sp.toDp()), tint = MaterialTheme.colors.onBackground)
|
||||
}
|
||||
Spacer(Modifier.padding(horizontal = 4.dp))
|
||||
Text(
|
||||
tag.chatTagText,
|
||||
color = MenuTextColor,
|
||||
fontWeight = if (selected) FontWeight.Medium else FontWeight.Normal
|
||||
)
|
||||
if (selected) {
|
||||
Spacer(Modifier.weight(1f))
|
||||
Icon(painterResource(MR.images.ic_done_filled), null, Modifier.size(20.dp), tint = MaterialTheme.colors.onBackground)
|
||||
} else if (reorderMode) {
|
||||
Spacer(Modifier.weight(1f))
|
||||
Icon(painterResource(MR.images.ic_drag_handle), null, Modifier.size(20.dp), tint = MaterialTheme.colors.secondary)
|
||||
if (selected) {
|
||||
Spacer(Modifier.weight(1f))
|
||||
Icon(painterResource(MR.images.ic_done_filled), null, Modifier.size(20.dp), tint = MaterialTheme.colors.onBackground)
|
||||
} else if (reorderMode) {
|
||||
Spacer(Modifier.weight(1f))
|
||||
Icon(painterResource(MR.images.ic_drag_handle), null, Modifier.size(20.dp), tint = MaterialTheme.colors.secondary)
|
||||
}
|
||||
}
|
||||
SectionDivider()
|
||||
}
|
||||
SectionDivider()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!oneHandUI.value && !reorderMode) {
|
||||
item {
|
||||
CreateList()
|
||||
if (!oneHandUI.value && !reorderMode) {
|
||||
item {
|
||||
CreateList()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
+23
-23
@@ -58,31 +58,31 @@ private fun HiddenProfileLayout(
|
||||
saveProfilePassword: (String) -> Unit
|
||||
) {
|
||||
Box(Modifier.fillMaxSize().background(MaterialTheme.colors.surface)) {
|
||||
ColumnWithScrollBar {
|
||||
AppBarTitle(stringResource(MR.strings.hide_profile))
|
||||
SectionView(contentPadding = PaddingValues(start = 8.dp, end = DEFAULT_PADDING)) {
|
||||
UserProfileRow(user)
|
||||
}
|
||||
SectionSpacer()
|
||||
ColumnWithScrollBar {
|
||||
AppBarTitle(stringResource(MR.strings.hide_profile))
|
||||
SectionView(contentPadding = PaddingValues(start = 8.dp, end = DEFAULT_PADDING)) {
|
||||
UserProfileRow(user)
|
||||
}
|
||||
SectionSpacer()
|
||||
|
||||
val hidePassword = rememberSaveable { mutableStateOf("") }
|
||||
val confirmHidePassword = rememberSaveable { mutableStateOf("") }
|
||||
val passwordValid by remember { derivedStateOf { hidePassword.value == hidePassword.value.trim() } }
|
||||
val confirmValid by remember { derivedStateOf { confirmHidePassword.value == "" || hidePassword.value == confirmHidePassword.value } }
|
||||
val saveDisabled by remember { derivedStateOf { hidePassword.value == "" || !passwordValid || confirmHidePassword.value == "" || !confirmValid } }
|
||||
SectionView(stringResource(MR.strings.hidden_profile_password)) {
|
||||
SectionItemViewWithoutMinPadding {
|
||||
PassphraseField(hidePassword, generalGetString(MR.strings.password_to_show), isValid = { passwordValid }, showStrength = true)
|
||||
}
|
||||
SectionItemViewWithoutMinPadding {
|
||||
PassphraseField(confirmHidePassword, stringResource(MR.strings.confirm_password), isValid = { confirmValid }, dependsOn = hidePassword)
|
||||
}
|
||||
SectionItemViewSpaceBetween({ saveProfilePassword(hidePassword.value) }, disabled = saveDisabled, minHeight = TextFieldDefaults.MinHeight) {
|
||||
Text(generalGetString(MR.strings.save_profile_password), color = if (saveDisabled) MaterialTheme.colors.secondary else MaterialTheme.colors.primary)
|
||||
val hidePassword = rememberSaveable { mutableStateOf("") }
|
||||
val confirmHidePassword = rememberSaveable { mutableStateOf("") }
|
||||
val passwordValid by remember { derivedStateOf { hidePassword.value == hidePassword.value.trim() } }
|
||||
val confirmValid by remember { derivedStateOf { confirmHidePassword.value == "" || hidePassword.value == confirmHidePassword.value } }
|
||||
val saveDisabled by remember { derivedStateOf { hidePassword.value == "" || !passwordValid || confirmHidePassword.value == "" || !confirmValid } }
|
||||
SectionView(stringResource(MR.strings.hidden_profile_password)) {
|
||||
SectionItemViewWithoutMinPadding {
|
||||
PassphraseField(hidePassword, generalGetString(MR.strings.password_to_show), isValid = { passwordValid }, showStrength = true)
|
||||
}
|
||||
SectionItemViewWithoutMinPadding {
|
||||
PassphraseField(confirmHidePassword, stringResource(MR.strings.confirm_password), isValid = { confirmValid }, dependsOn = hidePassword)
|
||||
}
|
||||
SectionItemViewSpaceBetween({ saveProfilePassword(hidePassword.value) }, disabled = saveDisabled, minHeight = TextFieldDefaults.MinHeight) {
|
||||
Text(generalGetString(MR.strings.save_profile_password), color = if (saveDisabled) MaterialTheme.colors.secondary else MaterialTheme.colors.primary)
|
||||
}
|
||||
}
|
||||
SectionTextFooter(stringResource(MR.strings.to_reveal_profile_enter_password))
|
||||
SectionBottomSpacer()
|
||||
}
|
||||
SectionTextFooter(stringResource(MR.strings.to_reveal_profile_enter_password))
|
||||
SectionBottomSpacer()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+32
-32
@@ -165,42 +165,42 @@ private fun UserProfilesLayout(
|
||||
showHiddenProfile: (User) -> Unit,
|
||||
) {
|
||||
Box(Modifier.fillMaxSize().background(MaterialTheme.colors.surface)) {
|
||||
ColumnWithScrollBar {
|
||||
if (profileHidden.value) {
|
||||
SettingsActionItem(painterResource(MR.images.ic_lock_open_right), stringResource(MR.strings.enter_password_to_show), click = {
|
||||
profileHidden.value = false
|
||||
})
|
||||
SectionSpacer()
|
||||
}
|
||||
AppBarTitle(stringResource(MR.strings.your_chat_profiles), hostDevice(remember { chatModel.remoteHostId() }))
|
||||
ColumnWithScrollBar {
|
||||
if (profileHidden.value) {
|
||||
SettingsActionItem(painterResource(MR.images.ic_lock_open_right), stringResource(MR.strings.enter_password_to_show), click = {
|
||||
profileHidden.value = false
|
||||
})
|
||||
SectionSpacer()
|
||||
}
|
||||
AppBarTitle(stringResource(MR.strings.your_chat_profiles), hostDevice(remember { chatModel.remoteHostId() }))
|
||||
|
||||
for (user in filteredUsers) {
|
||||
UserView(user, visibleUsersCount, activateUser, removeUser, unhideUser, muteUser, unmuteUser, showHiddenProfile)
|
||||
Divider(Modifier.padding(horizontal = 8.dp))
|
||||
}
|
||||
if (searchTextOrPassword.value.trim().isEmpty()) {
|
||||
SectionItemView(addUser, minHeight = 68.dp) {
|
||||
Icon(painterResource(MR.images.ic_add), stringResource(MR.strings.users_add), tint = MaterialTheme.colors.primary)
|
||||
Spacer(Modifier.padding(horizontal = 4.dp))
|
||||
Text(stringResource(MR.strings.users_add), color = MaterialTheme.colors.primary)
|
||||
for (user in filteredUsers) {
|
||||
UserView(user, visibleUsersCount, activateUser, removeUser, unhideUser, muteUser, unmuteUser, showHiddenProfile)
|
||||
Divider(Modifier.padding(horizontal = 8.dp))
|
||||
}
|
||||
}
|
||||
SectionTextFooter(stringResource(MR.strings.tap_to_activate_profile))
|
||||
LaunchedEffect(Unit) {
|
||||
if (showHiddenProfilesNotice.state.value && users.size > 1) {
|
||||
AlertManager.shared.showAlertDialog(
|
||||
title = generalGetString(MR.strings.make_profile_private),
|
||||
text = generalGetString(MR.strings.you_can_hide_or_mute_user_profile),
|
||||
confirmText = generalGetString(MR.strings.ok),
|
||||
dismissText = generalGetString(MR.strings.dont_show_again),
|
||||
onDismiss = {
|
||||
showHiddenProfilesNotice.set(false)
|
||||
},
|
||||
)
|
||||
if (searchTextOrPassword.value.trim().isEmpty()) {
|
||||
SectionItemView(addUser, minHeight = 68.dp) {
|
||||
Icon(painterResource(MR.images.ic_add), stringResource(MR.strings.users_add), tint = MaterialTheme.colors.primary)
|
||||
Spacer(Modifier.padding(horizontal = 4.dp))
|
||||
Text(stringResource(MR.strings.users_add), color = MaterialTheme.colors.primary)
|
||||
}
|
||||
}
|
||||
SectionTextFooter(stringResource(MR.strings.tap_to_activate_profile))
|
||||
LaunchedEffect(Unit) {
|
||||
if (showHiddenProfilesNotice.state.value && users.size > 1) {
|
||||
AlertManager.shared.showAlertDialog(
|
||||
title = generalGetString(MR.strings.make_profile_private),
|
||||
text = generalGetString(MR.strings.you_can_hide_or_mute_user_profile),
|
||||
confirmText = generalGetString(MR.strings.ok),
|
||||
dismissText = generalGetString(MR.strings.dont_show_again),
|
||||
onDismiss = {
|
||||
showHiddenProfilesNotice.set(false)
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
SectionBottomSpacer()
|
||||
}
|
||||
SectionBottomSpacer()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user