[app] Make app filter menu clearer

This commit is contained in:
tehcneko 2021-04-25 15:14:31 +08:00
parent 4feb66be91
commit 84ea30d3ac
3 changed files with 35 additions and 29 deletions

View File

@ -269,15 +269,15 @@ public class ScopeAdapter extends RecyclerView.Adapter<ScopeAdapter.ViewHolder>
notifyDataSetChanged();
}
return true;
} else if (itemId == R.id.item_show_system) {
} else if (itemId == R.id.item_filter_system) {
item.setChecked(!item.isChecked());
preferences.edit().putBoolean("show_system_apps", item.isChecked()).apply();
} else if (itemId == R.id.item_show_games) {
preferences.edit().putBoolean("filter_system_apps", item.isChecked()).apply();
} else if (itemId == R.id.item_filter_games) {
item.setChecked(!item.isChecked());
preferences.edit().putBoolean("show_games", item.isChecked()).apply();
} else if (itemId == R.id.item_show_modules) {
preferences.edit().putBoolean("filter_games", item.isChecked()).apply();
} else if (itemId == R.id.item_filter_modules) {
item.setChecked(!item.isChecked());
preferences.edit().putBoolean("show_modules", item.isChecked()).apply();
preferences.edit().putBoolean("filter_modules", item.isChecked()).apply();
} else if (itemId == R.id.menu_launch) {
Intent launchIntent = AppHelper.getSettingsIntent(modulePackageName, pm);
if (launchIntent != null) {
@ -356,9 +356,9 @@ public class ScopeAdapter extends RecyclerView.Adapter<ScopeAdapter.ViewHolder>
if (scopeList == null || scopeList.isEmpty()) {
menu.removeItem(R.id.use_recommended);
}
menu.findItem(R.id.item_show_system).setChecked(preferences.getBoolean("show_system_apps", false));
menu.findItem(R.id.item_show_games).setChecked(preferences.getBoolean("show_games", false));
menu.findItem(R.id.item_show_modules).setChecked(preferences.getBoolean("show_modules", false));
menu.findItem(R.id.item_filter_system).setChecked(preferences.getBoolean("filter_system_apps", true));
menu.findItem(R.id.item_filter_games).setChecked(preferences.getBoolean("filter_games", true));
menu.findItem(R.id.item_filter_modules).setChecked(preferences.getBoolean("filter_modules", true));
switch (preferences.getInt("list_sort", 0)) {
case 7:
menu.findItem(R.id.item_sort_by_update_time_reverse).setChecked(true);

View File

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ This file is part of LSPosed.
~
~ LSPosed is free software: you can redistribute it and/or modify
@ -38,25 +37,31 @@
android:title="@string/use_recommended" />
<item
android:id="@+id/item_show_games"
android:checkable="true"
android:checked="true"
android:title="@string/menu_show_games" />
android:title="@string/menu_filter"
app:showAsAction="never">
<menu>
<item
android:id="@+id/item_filter_games"
android:checkable="true"
android:checked="true"
android:title="@string/menu_show_games" />
<item
android:id="@+id/item_filter_modules"
android:checkable="true"
android:checked="true"
android:title="@string/menu_show_modules" />
<item
android:id="@+id/item_filter_system"
android:checkable="true"
android:checked="true"
android:title="@string/menu_show_system_apps" />
</menu>
</item>
<item
android:id="@+id/item_show_modules"
android:checkable="true"
android:checked="true"
android:title="@string/menu_show_modules" />
<item
android:id="@+id/item_show_system"
android:checkable="true"
android:checked="true"
android:title="@string/menu_show_system_apps" />
<item
android:id="@+id/item_list_sort"
android:title="@string/menu_sort"
app:showAsAction="never">
<menu>
@ -108,4 +113,4 @@
android:title="@string/menu_restore" />
</menu>
</item>
</menu>
</menu>

View File

@ -125,6 +125,7 @@
<string name="force_stop_dlg_text">If you force stop an app, it may misbehave.</string>
<string name="reboot_required">Reboot is required for this change to apply</string>
<string name="reboot">Reboot</string>
<string name="menu_filter">Filter…</string>
<!-- ModulesActivity and AppListActivity -->
<string name="modules_app_store">View in App Store</string>