Avoid crash when one of the swipe actions is "None"
@@ -107,6 +107,7 @@ class MessageListSwipeCallback(
val isViewAnimatingBack = !isCurrentlyActive
+ if (dX != 0F) {
canvas.withTranslation(x = view.left.toFloat(), y = view.top.toFloat()) {
if (isViewAnimatingBack) {
drawBackground(dX, viewWidth, viewHeight)
@@ -115,6 +116,7 @@ class MessageListSwipeCallback(
drawLayout(dX, viewWidth, viewHeight, holder)
}
}
+ }
super.onChildDraw(canvas, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive)
}
