Ensure callback is registered for shaking gifts.

fork-5.53.8
Alex Hart 2022-05-16 13:12:33 -03:00 zatwierdzone przez Cody Henthorne
rodzic a0b89051cf
commit 307be5c75e
1 zmienionych plików z 9 dodań i 9 usunięć

Wyświetl plik

@ -72,17 +72,17 @@ class OpenableGiftItemDecoration(context: Context) : RecyclerView.ItemDecoration
notAnimated.filterNot { messageIdsOpenedThisSession.contains(it.getGiftId()) }.forEach { child -> notAnimated.filterNot { messageIdsOpenedThisSession.contains(it.getGiftId()) }.forEach { child ->
val projection = child.getOpenableGiftProjection(false) val projection = child.getOpenableGiftProjection(false)
if (projection != null) { if (projection != null) {
if (messageIdsShakenThisSession.contains(child.getGiftId())) { child.setOpenGiftCallback {
child.setOpenGiftCallback { child.clearOpenGiftCallback()
child.clearOpenGiftCallback() val proj = it.getOpenableGiftProjection(true)
val proj = it.getOpenableGiftProjection(true) if (proj != null) {
if (proj != null) { messageIdsOpenedThisSession.add(it.getGiftId())
messageIdsOpenedThisSession.add(it.getGiftId()) startOpenAnimation(it)
startOpenAnimation(it) parent.invalidate()
parent.invalidate()
}
} }
}
if (messageIdsShakenThisSession.contains(child.getGiftId())) {
drawGiftBox(c, projection) drawGiftBox(c, projection)
drawGiftBow(c, projection) drawGiftBow(c, projection)
} else { } else {