From 9c63910369abedceee402f8f3fbc55fc3475b168 Mon Sep 17 00:00:00 2001 From: pppscn <35696959@qq.com> Date: Tue, 14 Jun 2022 11:29:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E6=9C=AA=E5=BC=80?= =?UTF-8?q?=E5=90=AF=E5=BC=82=E6=AD=A5=E8=8E=B7=E5=8F=96=E5=B7=B2=E5=AE=89?= =?UTF-8?q?=E8=A3=85App=E4=BF=A1=E6=81=AF=E5=BC=80=E5=85=B3=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E8=A7=84=E5=88=99=E7=BC=96=E8=BE=91=E4=B8=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=B7=B2=E5=AE=89=E8=A3=85APP=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../idormy/sms/forwarder/fragment/RulesEditFragment.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/idormy/sms/forwarder/fragment/RulesEditFragment.kt b/app/src/main/java/com/idormy/sms/forwarder/fragment/RulesEditFragment.kt index 325c8126..37de0bf3 100644 --- a/app/src/main/java/com/idormy/sms/forwarder/fragment/RulesEditFragment.kt +++ b/app/src/main/java/com/idormy/sms/forwarder/fragment/RulesEditFragment.kt @@ -364,9 +364,12 @@ class RulesEditFragment : BaseFragment(), View.OnClic private fun initAppSpinner() { if (ruleType != "app") return + //未开启异步获取已安装App信息开关时,规则编辑不显示已安装APP下拉框 + if (!SettingUtils.enableLoadUserAppList && !SettingUtils.enableLoadSystemAppList) return + val get = GlobalScope.async(Dispatchers.IO) { if ((SettingUtils.enableLoadUserAppList && App.UserAppList.isEmpty()) - || SettingUtils.enableLoadSystemAppList && App.SystemAppList.isEmpty() + || (SettingUtils.enableLoadSystemAppList && App.SystemAppList.isEmpty()) ) { App.UserAppList.clear() App.SystemAppList.clear() @@ -399,6 +402,9 @@ class RulesEditFragment : BaseFragment(), View.OnClic } } + //列表为空也不显示下拉框 + if (appListSpinnerList.isEmpty()) return@runCatching + appListSpinnerAdapter = AppListSpinnerAdapter(appListSpinnerList) //.setTextColor(ResUtils.getColor(R.color.green)) //.setTextSize(12F)