AnimUtils.kt 1.06 KB
Newer Older
1
package com.ydl.ydlcommon.utils
konghaorui committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39

import android.view.View
import android.view.animation.Animation
import android.view.animation.TranslateAnimation

/**
 * @author yuanWai
 * @描述:
 * @Copyright Copyright (c) 2018
 * @Company 壹点灵
 * @date 2019/2/19
 */
class AnimUtils {
    companion object {
        fun slideToUp(view : View){
            val slide = TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f,
                    Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
                    1.0f, Animation.RELATIVE_TO_SELF, 0.0f)
            slide.duration = 400
            slide.fillAfter = true
            slide.isFillEnabled = true
            view.startAnimation(slide)
            slide.setAnimationListener(object : Animation.AnimationListener {
                override fun onAnimationRepeat(animation: Animation?) {

                }

                override fun onAnimationEnd(animation: Animation?) {

                }

                override fun onAnimationStart(animation: Animation?) {

                }
            })
        }
    }
}