mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Sticker management v2 – Improve list animations and state transitions.
- Uninstall selected packs in a single database transaction to avoid UI flickering. - Add section header keys to prevent them from animating wildly while scrolling.
This commit is contained in:
@@ -27,6 +27,7 @@ import org.thoughtcrime.securesms.crypto.AttachmentSecret
|
||||
import org.thoughtcrime.securesms.crypto.ModernDecryptingPartInputStream
|
||||
import org.thoughtcrime.securesms.crypto.ModernEncryptingPartOutputStream
|
||||
import org.thoughtcrime.securesms.database.model.IncomingSticker
|
||||
import org.thoughtcrime.securesms.database.model.StickerPackId
|
||||
import org.thoughtcrime.securesms.database.model.StickerPackRecord
|
||||
import org.thoughtcrime.securesms.database.model.StickerRecord
|
||||
import org.thoughtcrime.securesms.mms.DecryptableStreamUriLoader.DecryptableUri
|
||||
@@ -296,9 +297,15 @@ class StickerTable(
|
||||
}
|
||||
|
||||
fun uninstallPack(packId: String) {
|
||||
uninstallPacks(setOf(StickerPackId(packId)))
|
||||
}
|
||||
|
||||
fun uninstallPacks(packIds: Set<StickerPackId>) {
|
||||
writableDatabase.withinTransaction { db ->
|
||||
updatePackInstalled(db = db, packId = packId, installed = false, notify = false)
|
||||
deleteStickersInPackExceptCover(db, packId)
|
||||
packIds.forEach { packId ->
|
||||
updatePackInstalled(db = db, packId = packId.value, installed = false, notify = false)
|
||||
deleteStickersInPackExceptCover(db, packId.value)
|
||||
}
|
||||
}
|
||||
|
||||
notifyStickerPackListeners()
|
||||
|
||||
Reference in New Issue
Block a user