//package com.test.basd.quickclean.activity

//import android.graphics.Color
//import android.view.LayoutInflater
//import android.view.ViewGroup
//import android.widget.ImageView
//import android.widget.TextView
//import androidx.activity.OnBackPressedCallback
//import androidx.core.view.updatePadding
//import androidx.recyclerview.widget.LinearLayoutManager
//import androidx.recyclerview.widget.RecyclerView
//import com.blankj.utilcode.util.AppUtils
//import com.blankj.utilcode.util.BarUtils
//import com.test.basd.quickclean.R
//import com.test.basd.quickclean.databinding.ActivityLayoutVirusappBinding
//import com.test.basd.quickclean.helps.BaseActivity
//import com.test.basd.quickclean.helps.ConfigHelper
//import com.test.basd.quickclean.helps.ads.AdmobUtils
//import com.trustlook.sdk.data.AppInfo

//class VirusAppActivity : BaseActivity<ActivityLayoutVirusappBinding>() {
//
//    private val appList = mutableListOf<AppInfo>()
//    override val binding: ActivityLayoutVirusappBinding by lazy {
//        ActivityLayoutVirusappBinding.inflate(layoutInflater)
//    }
//
//    override fun initView() {
//        BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
//
//        binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
//        binding.idYdBack.setOnClickListener {
//            onBackPressedDispatcher.onBackPressed()
//        }
//        onBackPressedDispatcher.addCallback(object : OnBackPressedCallback(true) {
//            override fun handleOnBackPressed() {
//                finishToMain()
//            }
//
//        })
//        ConfigHelper.riskAppList?.let { appList.addAll(it) }
//        binding.idTvRisks.text = "${appList.size} application is a security risk"
//        binding.idRlApp.run {
//            layoutManager = LinearLayoutManager(context)
//            adapter = object : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
//                override fun onCreateViewHolder(
//                    parent: ViewGroup,
//                    viewType: Int
//                ): RecyclerView.ViewHolder {
//                    val view = LayoutInflater.from(parent.context)
//                        .inflate(R.layout.item_layout_risk_app, parent, false)
//                    return object : RecyclerView.ViewHolder(view) {}
//                }
//
//                override fun getItemCount() = appList.size
//
//                override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
//                    holder.itemView.run {
//                        val c = ConfigHelper.appList?.firstOrNull {
//                            it.packageName == appList[position].packageName
//                        }
//                        findViewById<ImageView>(R.id.id_app_icon).setImageDrawable(c?.icon)
//                        findViewById<TextView>(R.id.id_name).text = appList[position].appName
//                        holder.itemView.setOnClickListener {
//                            AdmobUtils.showInterstitialAd(this@VirusAppActivity) {
//                                AppUtils.launchAppDetailsSettings(appList[position].packageName)
//                            }
//                        }
//                    }
//                }
//            }
//        }
//    }
//
//
//}