forked from upstream-mirrors/quik
changes to make scheduled messages activity ui compliant with the rest of the app message listing activities. now allows sending and deleting multiple scheduled messages at once
This commit is contained in:
@@ -132,17 +132,6 @@ class MessagesAdapter @Inject constructor(
|
||||
private val conversation: Conversation?
|
||||
get() = data?.first?.takeIf { it.isValid }
|
||||
|
||||
/**
|
||||
* Mark this message as highlighted
|
||||
*/
|
||||
var highlight: Long = -1L
|
||||
set(value) {
|
||||
if (field == value) return
|
||||
|
||||
field = value
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
private val contactCache = ContactCache()
|
||||
private val expanded = HashMap<Long, Boolean>()
|
||||
private val subs = subscriptionManager.activeSubscriptionInfoList
|
||||
@@ -405,30 +394,6 @@ class MessagesAdapter @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
fun toggleSelectAll() {
|
||||
var needToSelectAll = false
|
||||
|
||||
// if a non-selected item is found, then we need to select all, otherwise deselect all
|
||||
for (position in 0 until itemCount)
|
||||
if (!isSelected(getItemId(position))) {
|
||||
needToSelectAll = true
|
||||
break
|
||||
}
|
||||
|
||||
// select or deselect item based on if toggling all selected of deselected
|
||||
for (position in 0 until itemCount) {
|
||||
val messageId = getItemId(position)
|
||||
// if deselecting all then toggle selection (we know all items are selected)
|
||||
if (!needToSelectAll)
|
||||
toggleSelection(messageId)
|
||||
// else, selecting all, toggle if not already selected
|
||||
else if (!isSelected(messageId))
|
||||
toggleSelection(messageId)
|
||||
}
|
||||
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
fun expandMessages(messageIds: List<Long>, expand: Boolean) {
|
||||
messageIds.forEach { messageId -> expanded[messageId] = expand }
|
||||
notifyDataSetChanged()
|
||||
|
||||
Reference in New Issue
Block a user