Add vertical translation to the bottom actionbar animation.

This commit is contained in:
Greyson Parrelli
2021-10-22 16:24:43 -04:00
parent 947f59e81b
commit 7d49c77d1a
5 changed files with 25 additions and 5 deletions

View File

@@ -1,7 +1,6 @@
package org.thoughtcrime.securesms.components.menu
import androidx.annotation.DrawableRes
import androidx.annotation.StringRes
/**
* Represents an action to be rendered via [SignalContextMenu] or [SignalBottomActionBar]

View File

@@ -6,9 +6,12 @@ import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.animation.Animation
import android.view.animation.AnimationUtils
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import androidx.interpolator.view.animation.FastOutSlowInInterpolator
import org.thoughtcrime.securesms.R
import org.thoughtcrime.securesms.util.ViewUtil
@@ -22,6 +25,20 @@ class SignalBottomActionBar(context: Context, attributeSet: AttributeSet) : Line
val items: MutableList<ActionItem> = mutableListOf()
val enterAnimation: Animation by lazy {
AnimationUtils.loadAnimation(context, R.anim.slide_fade_from_bottom).apply {
duration = 250
interpolator = FastOutSlowInInterpolator()
}
}
val exitAnimation: Animation by lazy {
AnimationUtils.loadAnimation(context, R.anim.slide_fade_to_bottom).apply {
duration = 250
interpolator = FastOutSlowInInterpolator()
}
}
init {
orientation = HORIZONTAL
setBackgroundResource(R.drawable.signal_bottom_action_bar_background)