diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/PerAppProxyAdapter.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/PerAppProxyAdapter.kt index 7e5dcddd..deb585fe 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/PerAppProxyAdapter.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/PerAppProxyAdapter.kt @@ -59,22 +59,23 @@ class PerAppProxyAdapter(val activity: BaseActivity, val apps: List, bl fun bind(appInfo: AppInfo) { this.appInfo = appInfo + // Set app icon and name itemBypassBinding.icon.setImageDrawable(appInfo.appIcon) -// name.text = appInfo.appName - - itemBypassBinding.checkBox.isChecked = inBlacklist - itemBypassBinding.packageName.text = appInfo.packageName - if (appInfo.isSystemApp) { - itemBypassBinding.name.text = String.format("** %1s", appInfo.appName) - //name.textColor = Color.RED + itemBypassBinding.name.text = if (appInfo.isSystemApp) { + String.format("** %s", appInfo.appName) } else { - itemBypassBinding.name.text = appInfo.appName - //name.textColor = Color.DKGRAY + appInfo.appName } + // Set package name and checkbox state + itemBypassBinding.packageName.text = appInfo.packageName + itemBypassBinding.checkBox.isChecked = inBlacklist + + // Handle item click to toggle blacklist status itemView.setOnClickListener(this) } + override fun onClick(v: View?) { if (inBlacklist) { blacklist.remove(appInfo.packageName)