mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 18:00:02 +01:00
Add slide animation to conversation list to archive.
This commit is contained in:
27
app/src/main/java/org/thoughtcrime/securesms/util/Views.kt
Normal file
27
app/src/main/java/org/thoughtcrime/securesms/util/Views.kt
Normal 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
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user