From 6d60f6d39eea2f6b05d96b123c0165c1dcac718a Mon Sep 17 00:00:00 2001 From: tornaco Date: Tue, 30 May 2023 20:18:49 +0800 Subject: [PATCH] [app] hide XposedScope if xposed service is null --- .../android/thanos/settings/SettingsDashboardFragment.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/android/app/src/main/java/github/tornaco/android/thanos/settings/SettingsDashboardFragment.java b/android/app/src/main/java/github/tornaco/android/thanos/settings/SettingsDashboardFragment.java index f3507bed5..28165902f 100644 --- a/android/app/src/main/java/github/tornaco/android/thanos/settings/SettingsDashboardFragment.java +++ b/android/app/src/main/java/github/tornaco/android/thanos/settings/SettingsDashboardFragment.java @@ -45,6 +45,7 @@ import github.tornaco.android.thanos.BuildProp; import github.tornaco.android.thanos.R; import github.tornaco.android.thanos.ThanosApp; +import github.tornaco.android.thanos.XposedScope; import github.tornaco.android.thanos.app.donate.DonateActivity; import github.tornaco.android.thanos.app.donate.DonateSettings; import github.tornaco.android.thanos.apps.AppDetailsActivity; @@ -204,6 +205,7 @@ private void invalidateIconPack(IconPack pack) { protected void onBindStrategyPreferences() { SwitchPreferenceCompat autoXposedScope = findPreference(getString(R.string.key_new_auto_request_xposed_scope)); + Objects.requireNonNull(autoXposedScope).setVisible(XposedScope.INSTANCE.getService() != null); autoXposedScope.setChecked(AppPreference.isAutoRequestXposedScopeEnabled(requireContext())); autoXposedScope.setOnPreferenceChangeListener((preference, newValue) -> { AppPreference.setAutoRequestXposedScopeEnabled(requireContext(), (Boolean) newValue);