package com.xunao.effectdemo.activity

import android.app.Activity
import android.os.Bundle
import com.xunao.effectdemo.R
import kotlinx.android.synthetic.main.activity_lottie.*
import kotlinx.android.synthetic.main.activity_lottie.view.*

/**
 * author : 程中强
 * e-mail : 740479946@qq.com
 * date : 2022/8/1816:23
 * desc :
 * version: 1.0
 */
class LottieActivity : Activity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_lottie)
//        animation_view.
        button.setOnClickListener{v->
            animation_view.clearAnimation()
            animation_view.setAnimation("walk.json")
            animation_view.repeatCount = 4
            animation_view.playAnimation()
        }

    }

    override fun onDestroy() {
        super.onDestroy()
        animation_view.clearAnimation()
    }
}