mirror of
https://github.com/He4eT/yamf_launcher.git
synced 2026-05-05 01:47:24 +00:00
Appearance: tune animations
This commit is contained in:
parent
ba95df1e0f
commit
159a875f10
1 changed files with 1 additions and 3 deletions
|
|
@ -118,12 +118,10 @@ class Animations (context: Context) {
|
||||||
private fun View.fadeIn(duration: Long = sharedPreferenceManager.getAnimationSpeed()) {
|
private fun View.fadeIn(duration: Long = sharedPreferenceManager.getAnimationSpeed()) {
|
||||||
if (visibility != View.VISIBLE) {
|
if (visibility != View.VISIBLE) {
|
||||||
alpha = 0f
|
alpha = 0f
|
||||||
translationY = -height.toFloat()/100
|
|
||||||
visibility = View.VISIBLE
|
visibility = View.VISIBLE
|
||||||
|
|
||||||
animate()
|
animate()
|
||||||
.alpha(1f)
|
.alpha(1f)
|
||||||
.translationY(0f)
|
|
||||||
.setDuration(duration)
|
.setDuration(duration)
|
||||||
.setListener(null)
|
.setListener(null)
|
||||||
}
|
}
|
||||||
|
|
@ -131,12 +129,12 @@ class Animations (context: Context) {
|
||||||
|
|
||||||
private fun View.fadeOut() {
|
private fun View.fadeOut() {
|
||||||
if (visibility == View.VISIBLE) {
|
if (visibility == View.VISIBLE) {
|
||||||
|
alpha = 0f
|
||||||
isInAnim = true
|
isInAnim = true
|
||||||
val duration = sharedPreferenceManager.getAnimationSpeed()
|
val duration = sharedPreferenceManager.getAnimationSpeed()
|
||||||
|
|
||||||
animate()
|
animate()
|
||||||
.alpha(0f)
|
.alpha(0f)
|
||||||
.translationY(-height.toFloat()/100)
|
|
||||||
.setDuration(duration/2)
|
.setDuration(duration/2)
|
||||||
.setListener(object : AnimatorListenerAdapter() {
|
.setListener(object : AnimatorListenerAdapter() {
|
||||||
override fun onAnimationEnd(animation: Animator) {
|
override fun onAnimationEnd(animation: Animator) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue