Add an option to filter files parsed as invalid
This commit is contained in:
parent
35fb874a42
commit
2cb7e82a94
|
@ -215,7 +215,10 @@ class MainActivity : AppCompatActivity() {
|
|||
|
||||
private fun sortGameList(gameList : List<AppEntry>) : List<AppEntry> {
|
||||
val sortedApps : MutableList<AppEntry> = mutableListOf()
|
||||
gameList.forEach { entry -> sortedApps.add(entry) }
|
||||
gameList.forEach { entry ->
|
||||
if (!appSettings.filterInvalidFiles || entry.loaderResult != LoaderResult.ParsingError)
|
||||
sortedApps.add(entry)
|
||||
}
|
||||
when (appSettings.sortAppsBy) {
|
||||
SortingOrder.AlphabeticalAsc.ordinal -> sortedApps.sortBy { it.name }
|
||||
SortingOrder.AlphabeticalDesc.ordinal -> sortedApps.sortByDescending { it.name }
|
||||
|
|
|
@ -25,6 +25,7 @@ class AppSettings @Inject constructor(@ApplicationContext private val context :
|
|||
var layoutType by sharedPreferences(context, 1)
|
||||
var sortAppsBy by sharedPreferences(context, 0)
|
||||
var selectAction by sharedPreferences(context, false)
|
||||
var filterInvalidFiles by sharedPreferences(context, false)
|
||||
|
||||
// Input
|
||||
var onScreenControl by sharedPreferences(context, true)
|
||||
|
|
|
@ -59,6 +59,8 @@
|
|||
<string name="select_action">Always Show Game Information</string>
|
||||
<string name="select_action_desc_on">Game information will be shown on clicking a game</string>
|
||||
<string name="select_action_desc_off">Game information will only be shown on long-clicking a game</string>
|
||||
<string name="filter_invalid_files_desc_off">Show files that have been parsed as invalid</string>
|
||||
<string name="filter_invalid_files_desc_on">Hide files that have been parsed as invalid</string>
|
||||
<!-- Settings - Game -->
|
||||
<string name="game">Game</string>
|
||||
<string name="use_custom_settings">Enable Custom Settings</string>
|
||||
|
|
|
@ -57,5 +57,10 @@
|
|||
android:summaryOn="@string/select_action_desc_on"
|
||||
app:key="select_action"
|
||||
app:title="@string/select_action" />
|
||||
<emu.skyline.preference.RefreshSwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:summaryOff="@string/filter_invalid_files_desc_off"
|
||||
android:summaryOn="@string/filter_invalid_files_desc_on"
|
||||
app:key="filter_invalid_files" />
|
||||
</PreferenceCategory>
|
||||
</androidx.preference.PreferenceScreen>
|
||||
|
|
Loading…
Reference in New Issue