val oldAnim = changeAnimations[oldHolder] if(oldAnim != null) { oldAnim.removeAllListeners() if(oldAnim.isRunning) { try { currentAnim = oldItem.animateChange(newItem, oldAnim) oldAnim.cancel() changeAnimations[oldHolder] = currentAnim } catch(e: NotImplementedError) { currentAnim = oldItem.animateChange(newItem) oldAnim.addOnEndListener { currentAnim.start() changeAnimations[oldHolder] = currentAnim } } } else { currentAnim = oldItem.animateChange(newItem) changeAnimations[oldHolder] = currentAnim } } else { currentAnim = oldItem.animateChange(newItem) changeAnimations[oldHolder] = currentAnim }