android: refine chats multi-select menu labels and state
This commit is contained in:
@@ -609,3 +609,8 @@
|
||||
- selected chat -> colored circle with check icon,
|
||||
- unselected chat -> empty outlined circle.
|
||||
- This matches the reference behavior and makes selected rows easier to scan.
|
||||
|
||||
### Step 96 - Selection menu labels and behavior polish
|
||||
- Updated multi-select top actions/menu to be closer to Telegram reference in wording.
|
||||
- Added dynamic `Закрепить/Открепить` label in selection overflow based on selected chats pinned state.
|
||||
- Kept non-supported actions explicit with user feedback (Toast), avoiding silent no-op behavior.
|
||||
|
||||
@@ -180,6 +180,10 @@ fun ChatListScreen(
|
||||
var manageRoleText by remember { mutableStateOf("member") }
|
||||
val isTabletLayout = LocalConfiguration.current.screenWidthDp >= 840
|
||||
val listState = rememberLazyListState()
|
||||
val selectedChats = remember(state.chats, selectedChatIds) {
|
||||
state.chats.filter { selectedChatIds.contains(it.id) }
|
||||
}
|
||||
val allSelectedPinned = selectedChats.isNotEmpty() && selectedChats.all { it.pinned }
|
||||
BackHandler(enabled = isSearchMode) {
|
||||
isSearchMode = false
|
||||
localSearchQuery = ""
|
||||
@@ -265,20 +269,19 @@ fun ChatListScreen(
|
||||
actions = {
|
||||
if (selectedChatIds.isNotEmpty()) {
|
||||
IconButton(onClick = {
|
||||
Toast.makeText(context, "Bulk mute will be added next.", Toast.LENGTH_SHORT).show()
|
||||
Toast.makeText(context, "Настройки звука для выбранных будут добавлены позже.", Toast.LENGTH_SHORT).show()
|
||||
}) {
|
||||
Icon(
|
||||
imageVector = Icons.Filled.NotificationsOff,
|
||||
contentDescription = "Mute selected",
|
||||
contentDescription = "Выключить уведомления",
|
||||
)
|
||||
}
|
||||
IconButton(onClick = {
|
||||
selectedChatIds = emptySet()
|
||||
onTabSelected(ChatTab.ARCHIVED)
|
||||
Toast.makeText(context, "Архивирование выбранных будет добавлено позже.", Toast.LENGTH_SHORT).show()
|
||||
}) {
|
||||
Icon(
|
||||
imageVector = Icons.Filled.FolderOpen,
|
||||
contentDescription = "Archive selected",
|
||||
contentDescription = "Архивировать",
|
||||
)
|
||||
}
|
||||
IconButton(onClick = {
|
||||
@@ -294,7 +297,7 @@ fun ChatListScreen(
|
||||
IconButton(onClick = { showSelectionMenu = true }) {
|
||||
Icon(
|
||||
imageVector = Icons.Filled.MoreVert,
|
||||
contentDescription = "Selection menu",
|
||||
contentDescription = "Меню выбранного",
|
||||
)
|
||||
}
|
||||
DropdownMenu(
|
||||
@@ -302,35 +305,35 @@ fun ChatListScreen(
|
||||
onDismissRequest = { showSelectionMenu = false },
|
||||
) {
|
||||
DropdownMenuItem(
|
||||
text = { Text("Unpin") },
|
||||
text = { Text(if (allSelectedPinned) "Открепить" else "Закрепить") },
|
||||
leadingIcon = { Icon(Icons.Filled.PushPin, contentDescription = null) },
|
||||
onClick = {
|
||||
showSelectionMenu = false
|
||||
Toast.makeText(context, "Bulk pin/unpin will be added next.", Toast.LENGTH_SHORT).show()
|
||||
Toast.makeText(context, "Закрепление будет добавлено после API поддержки.", Toast.LENGTH_SHORT).show()
|
||||
},
|
||||
)
|
||||
DropdownMenuItem(
|
||||
text = { Text("Add to folder") },
|
||||
text = { Text("Добавить в папку") },
|
||||
leadingIcon = { Icon(Icons.Filled.FolderOpen, contentDescription = null) },
|
||||
onClick = {
|
||||
showSelectionMenu = false
|
||||
Toast.makeText(context, "Folders UI will be added next.", Toast.LENGTH_SHORT).show()
|
||||
Toast.makeText(context, "Папки чатов будут добавлены позже.", Toast.LENGTH_SHORT).show()
|
||||
},
|
||||
)
|
||||
DropdownMenuItem(
|
||||
text = { Text("Mark unread") },
|
||||
text = { Text("Пометить непрочитанным") },
|
||||
leadingIcon = { Icon(Icons.Filled.DoneAll, contentDescription = null) },
|
||||
onClick = {
|
||||
showSelectionMenu = false
|
||||
Toast.makeText(context, "Mark unread action will be added next.", Toast.LENGTH_SHORT).show()
|
||||
Toast.makeText(context, "Отметка непрочитанным будет добавлена позже.", Toast.LENGTH_SHORT).show()
|
||||
},
|
||||
)
|
||||
DropdownMenuItem(
|
||||
text = { Text("Clear cache") },
|
||||
text = { Text("Удалить из кэша") },
|
||||
leadingIcon = { Icon(Icons.Filled.Delete, contentDescription = null) },
|
||||
onClick = {
|
||||
showSelectionMenu = false
|
||||
Toast.makeText(context, "Media cache clear will be added next.", Toast.LENGTH_SHORT).show()
|
||||
Toast.makeText(context, "Очистка кэша будет добавлена позже.", Toast.LENGTH_SHORT).show()
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user