menegatti
03/27/2017, 11:31 AMval oldAnim = changeAnimations[oldHolder]
oldAnim?.removeAllListeners()
if (oldAnim?.isRunning ?: false) {
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
}