diff --git a/apps/android/app/src/main/java/chat/simplex/app/views/chatlist/UserPicker.kt b/apps/android/app/src/main/java/chat/simplex/app/views/chatlist/UserPicker.kt index 51ac86eab..9b10062d3 100644 --- a/apps/android/app/src/main/java/chat/simplex/app/views/chatlist/UserPicker.kt +++ b/apps/android/app/src/main/java/chat/simplex/app/views/chatlist/UserPicker.kt @@ -97,8 +97,11 @@ fun UserPicker(chatModel: ChatModel, userPickerState: MutableStateFlow - UserProfilePickerItem(u.user, u.unreadCount) { + users.forEach { u -> + UserProfilePickerItem(u.user, u.unreadCount, openSettings = { + openSettings() + userPickerState.value = AnimatedViewState.GONE + }) { userPickerState.value = AnimatedViewState.HIDING if (!u.user.activeUser) { chatModel.chats.clear() @@ -113,12 +116,10 @@ fun UserPicker(chatModel: ChatModel, userPickerState: MutableStateFlow Unit = {}, onClick: () -> Unit) { +fun UserProfilePickerItem(u: User, unreadCount: Int = 0, onLongClick: () -> Unit = {}, openSettings: () -> Unit = {}, onClick: () -> Unit) { Row( Modifier .fillMaxWidth() .sizeIn(minHeight = 46.dp) .combinedClickable( - onClick = if (!u.activeUser) onClick else { {} }, + onClick = if (u.activeUser) openSettings else onClick, onLongClick = onLongClick, interactionSource = remember { MutableInteractionSource() }, indication = if (!u.activeUser) LocalIndication.current else null diff --git a/apps/ios/Shared/Views/ChatList/UserPicker.swift b/apps/ios/Shared/Views/ChatList/UserPicker.swift index c0b246265..b9f3c3bc4 100644 --- a/apps/ios/Shared/Views/ChatList/UserPicker.swift +++ b/apps/ios/Shared/Views/ChatList/UserPicker.swift @@ -34,6 +34,7 @@ struct UserPicker: View { ForEach(users) { u in userView(u) Divider() + if u.user.activeUser { Divider() } } } .overlay { @@ -90,7 +91,12 @@ struct UserPicker: View { private func userView(_ u: UserInfo) -> some View { let user = u.user return Button(action: { - if !user.activeUser { + if user.activeUser { + showSettings = true + withAnimation { + userPickerVisible.toggle() + } + } else { do { try changeActiveUser_(user.userId) userPickerVisible = false @@ -120,7 +126,6 @@ struct UserPicker: View { .padding(.trailing) .padding([.leading, .vertical], 12) }) - .disabled(user.activeUser) .buttonStyle(PressedButtonStyle(defaultColor: fillColor, pressedColor: Color(uiColor: .secondarySystemFill))) }