android 信息验证动画效果

layout_check_pro

复制代码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/parent"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <ImageView
        android:id="@+id/line"
        android:layout_width="@dimen/dp_2"
        android:layout_height="@dimen/dp_20"
        android:layout_marginStart="@dimen/dp_9"
        android:background="#D3D3D3" />

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center_vertical"
        android:orientation="horizontal">

        <ImageView
            android:id="@+id/iv_pro"
            android:layout_width="@dimen/dp_20"
            android:layout_height="@dimen/dp_20"
            android:src="@mipmap/icon_proc" />

        <TextView
            android:id="@+id/tv_pro"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/dp_16"
            android:text="大额提现3000元税款缴纳成功"
            android:textColor="@color/_333333"
            android:textSize="@dimen/sp_14"
            android:textStyle="bold" />
    </LinearLayout>
</LinearLayout>

dialog_act_info_verify

复制代码
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">


    <ImageView
        android:id="@+id/iv_bg"
        android:layout_width="@dimen/dp_280"
        android:layout_height="@dimen/dp_350"
        android:background="@mipmap/bg_info_verify"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <LinearLayout
        android:layout_width="@dimen/dp_244"
        android:layout_height="@dimen/dp_228"
        android:layout_marginBottom="@dimen/dp_18"
        android:gravity="center_horizontal"
        android:orientation="vertical"
        app:layout_constraintBottom_toBottomOf="@id/iv_bg"
        app:layout_constraintEnd_toEndOf="@id/iv_bg"
        app:layout_constraintStart_toStartOf="@id/iv_bg">

        <LinearLayout
            android:layout_width="@dimen/dp_244"
            android:layout_height="@dimen/dp_228"
            android:layout_marginTop="@dimen/dp_20"
            android:orientation="vertical"
            android:paddingStart="@dimen/dp_22">

            <include
                android:id="@+id/ll_pro1"
                layout="@layout/layout_check_pro" />

            <include
                android:id="@+id/ll_pro2"
                layout="@layout/layout_check_pro" />

            <include
                android:id="@+id/ll_pro3"
                layout="@layout/layout_check_pro" />

            <include
                android:id="@+id/ll_pro4"
                layout="@layout/layout_check_pro" />

            <include
                android:id="@+id/ll_pro5"
                layout="@layout/layout_check_pro" />
        </LinearLayout>

    </LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>

package com.zhe.song.wo.will.zgwh.dialog

import android.content.Context
import android.view.LayoutInflater
import androidx.core.graphics.toColorInt
import com.zhe.song.wo.will.zgwh.R
import com.zhe.song.wo.will.zgwh.constans.DialogCon
import com.zhe.song.wo.will.zgwh.databinding.DialogActInfoVerifyBinding
import com.zhe.song.wo.will.zgwh.databinding.LayoutCheckProBinding
import com.zhe.song.wo.will.zgwh.spf.SPFUserInfo
import com.zhe.song.wo.will.zgwh.utils.animationRotate
import com.zhe.song.wo.will.zgwh.utils.gone
import com.zhe.song.wo.will.zgwh.utils.hide
import com.zhe.song.wo.will.zgwh.utils.show
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch

/**
 * 个人信息验证表格
 * @author zph
 * @date 2025/07/15
 * @constructor 创建DialogActInfoVerify
 * @param context 语境
 */
class DialogActInfoVerify(context: Context) : DialogBase<DialogActInfoVerifyBinding>(context) {


    override fun postDismiss() {
        iDialogActionListener?.onDialogActionListener(DialogCon.DIALOG_信息验证)
    }

    /**
     * 后续连续登录X天,且(6-x)*10关;提现条件为5-X天,且每天过(6-x)*10关;
     * 直到条件为:在登录0天,且过60关,即可进入第七个档位
     */
    override fun postShow() {
        SPFUserInfo.withDrawalState = true
        var day = SPFUserInfo.needLoginDay
        if (day <= 0) {
            day = 0
            SPFUserInfo.wxBannerLevel8 = 1
        }
        val needLevel = 60 - (day * 10)
        if (SPFUserInfo.needGameLevel == 0) {
            SPFUserInfo.needGameLevel = SPFUserInfo.gameLevel + needLevel
        }
        val finishLevel = SPFUserInfo.needGameLevel - SPFUserInfo.gameLevel
        viewBinding.llPro1.line.gone()
        viewBinding.llPro1.parent.hide()
        viewBinding.llPro2.parent.hide()
        viewBinding.llPro3.parent.hide()
        viewBinding.llPro4.parent.hide()
        viewBinding.llPro5.parent.hide()
        coroutineScope.launch {
            loadLayout(
                viewBinding.llPro1, "登陆验证中..."
            )
            delay(1500)
            loadLayoutSucccess(
                viewBinding.llPro1, "需要再登录(${6 - day}/6)天"
            )
            loadLayout(
                viewBinding.llPro2, "网络环境验证中..."
            )
            delay(1500)
            loadLayoutSucccess(
                viewBinding.llPro2, "网络环境安全验证通过"
            )
            loadLayout(
                viewBinding.llPro3, "游戏行为验证中..."
            )
            delay(1500)
            loadLayoutSucccess(
                viewBinding.llPro3, "游戏外挂行为验证通过"
            )
            loadLayout(
                viewBinding.llPro4, "小助手解锁验证中..."
            )
            delay(1500)
            loadLayoutSucccess(
                viewBinding.llPro4, "小助手解锁数量(${SPFUserInfo.assistantId})"
            )
            loadLayout(
                viewBinding.llPro5, "闯关关卡验证中..."
            )
            delay(1500)
            if (day == 0) {
                loadLayoutError(
                    viewBinding.llPro5, "今日需要通过最后一关"
                )
            } else {
                if (finishLevel <= 0) {
                    loadLayoutSucccess(
                        viewBinding.llPro5, "今日闯关已完成"
                    )
                } else {
                    loadLayoutError(
                        viewBinding.llPro5, "今日需要通过${needLevel - finishLevel}/${needLevel}关"
                    )
                }

            }

            delay(3000)
            dismiss()
        }
    }

    fun loadLayout(llPro: LayoutCheckProBinding, str: String) {
        llPro.parent.show()
        llPro.line.setBackgroundColor("#D3D3D3".toColorInt())
        llPro.ivPro.setImageResource(R.mipmap.icon_proc)
        llPro.ivPro.animationRotate()
        llPro.tvPro.setTextColor("#999999".toColorInt())
        llPro.tvPro.text = str
    }

    fun loadLayoutSucccess(llPro: LayoutCheckProBinding, str: String) {
        llPro.line.setBackgroundColor("#20C403".toColorInt())
        llPro.ivPro.clearAnimation()
        llPro.ivPro.setImageResource(R.mipmap.icon_suc)
        llPro.tvPro.setTextColor("#333333".toColorInt())
        llPro.tvPro.text = str
    }

    fun loadLayoutError(llPro: LayoutCheckProBinding, str: String) {
        llPro.line.setBackgroundColor("#FF0000".toColorInt())
        llPro.ivPro.clearAnimation()
        llPro.ivPro.setImageResource(R.mipmap.icon_error)
        llPro.tvPro.setTextColor("#FF0000".toColorInt())
        llPro.tvPro.text = str
    }

    override fun createViewBinding(): DialogActInfoVerifyBinding {
        return DialogActInfoVerifyBinding.inflate(LayoutInflater.from(context))
    }


}
相关推荐
安东尼肉店4 小时前
Android compose屏幕适配终极解决方案
android
2501_916007474 小时前
HTTPS 抓包乱码怎么办?原因剖析、排查步骤与实战工具对策(HTTPS 抓包乱码、gzipbrotli、TLS 解密、iOS 抓包)
android·ios·小程序·https·uni-app·iphone·webview
feiyangqingyun6 小时前
基于Qt和FFmpeg的安卓监控模拟器/手机摄像头模拟成onvif和28181设备
android·qt·ffmpeg
用户20187928316710 小时前
ANR之RenderThread不可中断睡眠state=D
android
煤球王子10 小时前
简单学:Android14中的Bluetooth—PBAP下载
android
小趴菜822710 小时前
安卓接入Max广告源
android
齊家治國平天下10 小时前
Android 14 系统 ANR (Application Not Responding) 深度分析与解决指南
android·anr
ZHANG13HAO10 小时前
Android 13.0 Framework 实现应用通知使用权默认开启的技术指南
android
【ql君】qlexcel10 小时前
Android 安卓RIL介绍
android·安卓·ril
写点啥呢10 小时前
android12解决非CarProperty接口深色模式设置后开机无法保持
android·车机·aosp·深色模式·座舱