Allow adding and removing from context menu.

This commit is contained in:
Michelle Tang
2024-10-16 13:57:49 -07:00
committed by Greyson Parrelli
parent 94d6bfd9ad
commit 6fcfd8fdb1
13 changed files with 330 additions and 7 deletions

View File

@@ -1,17 +1,23 @@
package org.thoughtcrime.securesms.components.settings.app.chats.folders
import android.os.Parcelable
import kotlinx.parcelize.IgnoredOnParcel
import kotlinx.parcelize.Parcelize
import org.thoughtcrime.securesms.recipients.Recipient
/**
* Represents an entry in the [org.thoughtcrime.securesms.database.ChatFolderTables].
*/
@Parcelize
data class ChatFolderRecord(
val id: Long = -1,
val name: String = "",
val position: Int = -1,
val includedChats: List<Long> = emptyList(),
val excludedChats: List<Long> = emptyList(),
@IgnoredOnParcel
val includedRecipients: Set<Recipient> = emptySet(),
@IgnoredOnParcel
val excludedRecipients: Set<Recipient> = emptySet(),
val showUnread: Boolean = false,
val showMutedChats: Boolean = true,
@@ -20,7 +26,7 @@ data class ChatFolderRecord(
val isMuted: Boolean = false,
val folderType: FolderType = FolderType.CUSTOM,
val unreadCount: Int = 0
) {
) : Parcelable {
enum class FolderType(val value: Int) {
/** Folder containing all chats */
ALL(0),

View File

@@ -135,7 +135,7 @@ fun FoldersScreen(
val elevation = if (isDragging) 1.dp else 0.dp
val isAllChats = folder.folderType == ChatFolderRecord.FolderType.ALL
FolderRow(
icon = R.drawable.ic_chat_folder_24,
icon = R.drawable.symbol_folder_24,
title = if (isAllChats) stringResource(R.string.ChatFoldersFragment__all_chats) else folder.name,
subtitle = getFolderDescription(folder),
onClick = if (!isAllChats) {