直播app系统源码,图片Loading旋转动画效果

发布时间 2023-11-10 14:06:51作者: 云豹科技-苏凌霄

直播app系统源码,图片Loading旋转动画效果

anim文件下的动画xml:

 


<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
    android:fromDegrees="0"//旋转的起始角度
    android:toDegrees="359"//旋转的终点角度
    android:pivotX="50%"//旋转的X中心,50%就是中间
    android:pivotY="50%"//旋转的y中心,50%就是中间
    android:duration="1000"//每次动画执行的时间,越小转的越快
    android:repeatCount="-1"//执行次数,-1就是无限次
 />
url = "www.baidu.com"
        url?.let { webView.loadUrl(it) }
        context?.let {
            val a = AnimationUtils.loadAnimation(it, R.anim.blv_loading_white_policy)
            a.interpolator = LinearInterpolator()//匀速执行
            webViewLoading.startAnimation(a)//view.startAnimation 执行动画
        }
        webView.onLoading = { _, isFinish ->//只是个回调面,进度达到100%就结束动画,图片隐藏
            if (isFinish) {
                webViewLoading.clearAnimation()
                webViewLoading.visibility = View.GONE
            }
        }

 以上就是 直播app系统源码,图片Loading旋转动画效果,更多内容欢迎关注之后的文章