Add slide animation to conversation list to archive.

This commit is contained in:
Alex Hart
2022-05-06 09:33:14 -03:00
parent e770241ed4
commit 756eafe3c8
4 changed files with 42 additions and 8 deletions

View File

@@ -0,0 +1,27 @@
package org.thoughtcrime.securesms.util
import android.view.View
import android.view.animation.AnimationUtils
import androidx.annotation.AnimRes
/**
* Runs the given animation on this view, assuming that the view is in an INVISIBLE or HIDDEN state.
*/
fun View.runRevealAnimation(@AnimRes anim: Int) {
animation = AnimationUtils.loadAnimation(context, anim)
visible = true
}
/**
* Runs the given animation on this view, assuming that the view is in a VISIBLE state and will
* hide on completion
*/
fun View.runHideAnimation(@AnimRes anim: Int) {
startAnimation(
AnimationUtils.loadAnimation(context, anim).apply {
setListeners(onAnimationEnd = {
visible = false
})
}
)
}