Split preferences to multiple files for reusability

This commit is contained in:
lynxnb 2023-02-15 12:21:20 +01:00 committed by Niccolò Betto
parent e7c176a8e5
commit a683978e8c
8 changed files with 433 additions and 416 deletions

View File

@ -23,7 +23,6 @@ import androidx.core.view.WindowCompat
import androidx.core.view.isInvisible import androidx.core.view.isInvisible
import androidx.core.view.isVisible import androidx.core.view.isVisible
import androidx.documentfile.provider.DocumentFile import androidx.documentfile.provider.DocumentFile
import androidx.preference.PreferenceManager
import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.snackbar.Snackbar import com.google.android.material.snackbar.Snackbar
@ -37,9 +36,9 @@ import emu.skyline.loader.AppEntry
import emu.skyline.loader.LoaderResult import emu.skyline.loader.LoaderResult
import emu.skyline.loader.RomFormat import emu.skyline.loader.RomFormat
import emu.skyline.provider.DocumentsProvider import emu.skyline.provider.DocumentsProvider
import emu.skyline.utils.GpuDriverHelper
import emu.skyline.settings.PreferenceSettings import emu.skyline.settings.PreferenceSettings
import emu.skyline.settings.SettingsActivity import emu.skyline.settings.SettingsActivity
import emu.skyline.utils.GpuDriverHelper
import emu.skyline.utils.WindowInsetsHelper import emu.skyline.utils.WindowInsetsHelper
import javax.inject.Inject import javax.inject.Inject
import kotlin.math.ceil import kotlin.math.ceil
@ -113,7 +112,7 @@ class MainActivity : AppCompatActivity() {
WindowCompat.setDecorFitsSystemWindows(window, false) WindowCompat.setDecorFitsSystemWindows(window, false)
WindowInsetsHelper.applyToActivity(binding.root, binding.appList) WindowInsetsHelper.applyToActivity(binding.root, binding.appList)
PreferenceManager.setDefaultValues(this, R.xml.preferences, false) PreferenceSettings.setDefaultValues(this)
adapter.apply { adapter.apply {
setHeaderItems(listOf(HeaderRomFilterItem(formatOrder, if (preferenceSettings.romFormatFilter == 0) null else formatOrder[preferenceSettings.romFormatFilter - 1]) { romFormat -> setHeaderItems(listOf(HeaderRomFilterItem(formatOrder, if (preferenceSettings.romFormatFilter == 0) null else formatOrder[preferenceSettings.romFormatFilter - 1]) { romFormat ->

View File

@ -7,6 +7,7 @@ package emu.skyline.settings
import android.content.Context import android.content.Context
import android.content.pm.ActivityInfo import android.content.pm.ActivityInfo
import androidx.preference.PreferenceManager
import dagger.hilt.android.qualifiers.ApplicationContext import dagger.hilt.android.qualifiers.ApplicationContext
import emu.skyline.R import emu.skyline.R
import emu.skyline.utils.sharedPreferences import emu.skyline.utils.sharedPreferences
@ -70,5 +71,13 @@ class PreferenceSettings @Inject constructor(@ApplicationContext private val con
companion object { companion object {
const val SYSTEM_GPU_DRIVER = "system" const val SYSTEM_GPU_DRIVER = "system"
/**
* Sets the default values for global preferences
*/
fun setDefaultValues(context : Context) {
PreferenceManager.setDefaultValues(context, R.xml.app_preferences, false)
PreferenceManager.setDefaultValues(context, R.xml.emulation_preferences, false)
}
} }
} }

View File

@ -10,10 +10,7 @@ import android.view.*
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.coordinatorlayout.widget.CoordinatorLayout import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.core.view.* import androidx.core.view.*
import androidx.preference.CheckBoxPreference import androidx.preference.*
import androidx.preference.Preference
import androidx.preference.PreferenceCategory
import androidx.preference.PreferenceFragmentCompat
import emu.skyline.BuildConfig import emu.skyline.BuildConfig
import emu.skyline.R import emu.skyline.R
import emu.skyline.databinding.SettingsActivityBinding import emu.skyline.databinding.SettingsActivityBinding
@ -92,10 +89,13 @@ class SettingsActivity : AppCompatActivity() {
} }
/** /**
* This constructs the preferences from [R.xml.preferences] * This constructs the preferences from XML preference resources
*/ */
override fun onCreatePreferences(savedInstanceState : Bundle?, rootKey : String?) { override fun onCreatePreferences(savedInstanceState : Bundle?, rootKey : String?) {
setPreferencesFromResource(R.xml.preferences, rootKey) addPreferencesFromResource(R.xml.app_preferences)
addPreferencesFromResource(R.xml.game_preferences)
addPreferencesFromResource(R.xml.input_preferences)
addPreferencesFromResource(R.xml.credits_preferences)
// Uncheck `disable_frame_throttling` if `force_triple_buffering` gets disabled // Uncheck `disable_frame_throttling` if `force_triple_buffering` gets disabled
val disableFrameThrottlingPref = findPreference<CheckBoxPreference>("disable_frame_throttling")!! val disableFrameThrottlingPref = findPreference<CheckBoxPreference>("disable_frame_throttling")!!

View File

@ -0,0 +1,75 @@
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory
android:key="category_emulator"
android:title="@string/emulator">
<emu.skyline.preference.DocumentsProviderPreference
app:key="document_provider"
app:summary="@string/open_data_directory_summary"
app:title="@string/open_data_directory" />
<emu.skyline.preference.ThemePreference
android:defaultValue="2"
android:entries="@array/app_theme"
app:key="app_theme"
app:title="@string/theme"
app:useSimpleSummaryProvider="true" />
<CheckBoxPreference
android:defaultValue="false"
android:summaryOff="@string/perf_stats_desc_off"
android:summaryOn="@string/perf_stats_desc_on"
app:key="perf_stats"
app:title="@string/perf_stats" />
<emu.skyline.preference.LogLevelPreference
android:defaultValue="2"
android:entries="@array/log_level"
app:key="log_level"
app:title="@string/log_level"
app:useSimpleSummaryProvider="true" />
</PreferenceCategory>
<PreferenceCategory
android:key="category_applist"
android:title="@string/app_list"
app:initialExpandedChildrenCount="3">
<emu.skyline.preference.FolderPickerPreference
app:key="search_location"
app:title="@string/search_location" />
<emu.skyline.preference.IntegerListPreference
android:defaultValue="1"
android:entries="@array/layout_type"
app:key="layout_type"
app:title="@string/layout_type"
app:useSimpleSummaryProvider="true" />
<emu.skyline.preference.IntegerListPreference
android:defaultValue="0"
android:entries="@array/sort_apps_by"
app:key="sort_apps_by"
app:refreshRequired="true"
app:title="@string/sort_apps_by"
app:useSimpleSummaryProvider="true" />
<emu.skyline.preference.RefreshCheckBoxPreference
android:defaultValue="true"
android:summaryOff="@string/group_by_format_desc_off"
android:summaryOn="@string/group_by_format_desc_on"
app:key="group_by_format"
app:refreshRequired="true"
app:title="@string/group_by_format" />
<CheckBoxPreference
android:defaultValue="false"
android:summaryOff="@string/select_action_desc_off"
android:summaryOn="@string/select_action_desc_on"
app:key="select_action"
app:title="@string/select_action" />
</PreferenceCategory>
<PreferenceCategory
android:key="category_keys"
android:title="@string/keys">
<emu.skyline.preference.KeyPickerPreference
app:key="prod_keys"
app:title="@string/prod_keys"
app:useSimpleSummaryProvider="true" />
<emu.skyline.preference.KeyPickerPreference
app:key="title_keys"
app:title="@string/title_keys"
app:useSimpleSummaryProvider="true" />
</PreferenceCategory>
</androidx.preference.PreferenceScreen>

View File

@ -0,0 +1,163 @@
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory
android:key="category_credits"
android:title="@string/credits" />
<PreferenceCategory
android:key="category_licenses"
android:title="@string/licenses"
app:initialExpandedChildrenCount="5">
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright © 2019-2021\nSkyline Team and Contributors"
app:libraryLicense="@string/mpl2_license"
app:libraryUrl="https://github.com/skyline-emu/skyline"
app:summary="@string/skyline_license_description"
app:title="@string/app_name" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright (c) Ryujinx Team and Contributors"
app:libraryLicense="@string/mit_license"
app:libraryUrl="https://github.com/Ryujinx/Ryujinx"
app:summary="@string/ryujinx_description"
app:title="Ryujinx" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright 2021 yuzu Emulator Project\nCopyright © 2021 Skyline Team and Contributors"
app:libraryLicense="@string/mpl2_license"
app:libraryUrl="https://github.com/skyline-emu/shader-compiler"
app:summary="@string/shader_compiler_description"
app:title="yuzu Shader Compiler" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright (c) 2019, sirit\nAll rights reserved."
app:libraryLicense="@string/bsd_3_clause_license"
app:libraryUrl="https://github.com/ReinUsesLisp/sirit"
app:summary="@string/sirit_description"
app:title="Sirit" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright 2015-2020 The Khronos Group Inc."
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://github.com/KhronosGroup/Vulkan-Hpp"
app:summary="@string/vkhpp_description"
app:title="Vulkan-Hpp" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright (c) 2017-2021 Advanced Micro Devices, Inc. All rights reserved."
app:libraryLicense="@string/mit_license"
app:libraryUrl="https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator"
app:summary="@string/vkma_description"
app:title="Vulkan Memory Allocator" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright (c) 2015-2019 The Khronos Group Inc.\nCopyright (c) 2015-2019 Valve Corporation\nCopyright (c) 2015-2019 LunarG, Inc."
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://github.com/KhronosGroup/Vulkan-ValidationLayers"
app:summary="@string/khvkval_description"
app:title="Khronos Vulkan Validation Layer" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright 2021 The Android Open Source Project"
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://github.com/google/oboe"
app:summary="@string/oboe_description"
app:title="Oboe" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright (c) 2017, The Android Open Source Project"
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://github.com/google/perfetto"
app:summary="@string/perfetto_description"
app:title="Perfetto" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright © 2012 - present, Victor Zverovich"
app:libraryLicense="@string/libfmt_mit_license"
app:libraryUrl="https://github.com/fmtlib/fmt"
app:summary="@string/fmtlib_description"
app:title="{fmt}" />
<emu.skyline.preference.LicensePreference
app:libraryLicense="@string/boost_software_license"
app:libraryUrl="https://www.boost.org"
app:summary="@string/boost_description"
app:title="Boost" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright Eric Niebler 2019-present"
app:libraryLicense="@string/boost_software_license"
app:libraryUrl="https://github.com/ericniebler/range-v3"
app:summary="@string/rangev3_description"
app:title="Range v3" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright 2016 QuarksLab"
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://github.com/serge-sans-paille/frozen"
app:summary="@string/frozen_description"
app:title="Frozen" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright (c) 2006-2019 Arseny Kapoulkine"
app:libraryLicense="@string/mit_license"
app:libraryUrl="https://github.com/zeux/pugixml"
app:summary="@string/pugixml_description"
app:title="pugixml" />
<emu.skyline.preference.LicensePreference
app:libraryLicense="@string/opus_bsd_3_clause_license"
app:libraryUrl="https://github.com/xiph/opus"
app:summary="@string/opus_description"
app:title="Opus Audio Codec" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright The Mbed TLS Contributors"
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://github.com/ARMmbed/mbedtls"
app:summary="@string/mbedtls_description"
app:title="Mbed TLS" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright (c) 2011-2020, Yann Collet\nAll rights reserved."
app:libraryLicense="@string/bsd_2_clause_license"
app:libraryUrl="https://github.com/lz4/lz4"
app:summary="@string/lz4_description"
app:title="LZ4 Library" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright 1985, 1987, 1988 The Regents of the University of California.\nAll rights reserved."
app:libraryLicense="@string/bsd_3_clause_license"
app:libraryUrl="https://github.com/skyline-emu/tz"
app:summary="@string/tzcode_description"
app:title="tzcode" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright 2016 Thibault Debatty"
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://github.com/tdebatty/java-string-similarity"
app:summary="@string/jssim_description"
app:title="Java String Similarity" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright (C) 2021 The Android Open Source Project"
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://developer.android.com/jetpack/androidx"
app:summary="@string/andx_description"
app:title="AndroidX" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright (C) 2021 The Android Open Source Project"
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://github.com/material-components/material-components-android"
app:summary="@string/amat_description"
app:title="Android Material Components" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors"
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://kotlinlang.org/api/latest/jvm/stdlib"
app:summary="@string/ktstd_description"
app:title="Kotlin Standard Library" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright 2012-2021 The Dagger Authors"
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://github.com/google/dagger"
app:summary="@string/dagger_description"
app:title="Dagger" />
<emu.skyline.preference.LicensePreference
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://material.io/resources/icons"
app:summary="@string/mtico_description"
app:title="Material Design Icons" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright 2018 The Noto Project Authors (github.com/googlei18n/noto-fonts)"
app:libraryLicense="@string/sil_open_font_license"
app:libraryUrl="https://github.com/googlefonts/noto-cjk"
app:summary="@string/noto_sans_description"
app:title="Noto Sans" />
<emu.skyline.preference.LicensePreference
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://fonts.google.com/specimen/Roboto"
app:summary="@string/roboto_description"
app:title="Roboto" />
</PreferenceCategory>
</androidx.preference.PreferenceScreen>

View File

@ -0,0 +1,162 @@
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory
android:key="category_system"
android:title="@string/system">
<CheckBoxPreference
android:defaultValue="true"
android:summaryOff="@string/handheld_enabled"
android:summaryOn="@string/docked_enabled"
app:key="is_docked"
app:title="@string/use_docked" />
<emu.skyline.preference.CustomEditTextPreference
android:defaultValue="@string/username_default"
app:key="username_value"
app:limit="31"
app:title="@string/username" />
<emu.skyline.preference.ProfilePicturePreference
app:key="profile_picture_value"
app:title="@string/profile_picture" />
<emu.skyline.preference.IntegerListPreference
android:defaultValue="1"
android:entries="@array/system_languages"
android:entryValues="@array/system_languages_val"
app:key="system_language"
app:refreshRequired="true"
app:title="@string/system_language"
app:useSimpleSummaryProvider="true" />
<emu.skyline.preference.IntegerListPreference
android:defaultValue="-1"
android:entries="@array/system_region"
android:entryValues="@array/system_region_val"
app:key="system_region"
app:title="@string/system_region"
app:useSimpleSummaryProvider="true" />
</PreferenceCategory>
<PreferenceCategory
android:key="category_presentation"
android:title="@string/display">
<emu.skyline.preference.IntegerListPreference
android:defaultValue="6"
android:entries="@array/orientation_entries"
android:entryValues="@array/orientation_values"
app:key="orientation"
app:title="@string/screen_orientation"
app:useSimpleSummaryProvider="true" />
<emu.skyline.preference.IntegerListPreference
android:defaultValue="0"
android:entries="@array/aspect_ratios"
app:key="aspect_ratio"
app:title="@string/aspect_ratio"
app:useSimpleSummaryProvider="true" />
<CheckBoxPreference
android:defaultValue="false"
android:summaryOff="@string/respect_display_cutout_disabled"
android:summaryOn="@string/respect_display_cutout_enabled"
app:key="respect_display_cutout"
app:title="@string/respect_display_cutout" />
<CheckBoxPreference
android:defaultValue="true"
android:summaryOff="@string/triple_buffering_disabled"
android:summaryOn="@string/triple_buffering_enabled"
app:key="force_triple_buffering"
app:title="@string/force_triple_buffering" />
<CheckBoxPreference
android:defaultValue="false"
android:dependency="force_triple_buffering"
android:summaryOff="@string/disable_frame_throttling_disabled"
android:summaryOn="@string/disable_frame_throttling_enabled"
app:key="disable_frame_throttling"
app:title="@string/disable_frame_throttling" />
<CheckBoxPreference
android:defaultValue="false"
android:summaryOff="@string/max_refresh_rate_disabled"
android:summaryOn="@string/max_refresh_rate_enabled"
app:key="max_refresh_rate"
app:title="@string/max_refresh_rate" />
</PreferenceCategory>
<PreferenceCategory
android:key="category_gpu"
android:title="@string/gpu">
<emu.skyline.preference.GpuDriverPreference
app:key="gpu_driver"
app:title="@string/gpu_driver_config" />
<SeekBarPreference
android:defaultValue="4"
android:max="6"
android:min="1"
android:summary="@string/executor_slot_count_scale_desc"
app:key="executor_slot_count_scale"
app:showSeekBarValue="true"
app:title="@string/executor_slot_count_scale" />
<SeekBarPreference
android:defaultValue="256"
android:max="1024"
android:min="0"
android:summary="@string/executor_flush_threshold_desc"
app:key="executor_flush_threshold"
app:showSeekBarValue="true"
app:title="@string/executor_flush_threshold" />
<CheckBoxPreference
android:defaultValue="false"
android:summary="@string/use_direct_memory_import_desc"
app:key="use_direct_memory_import"
app:title="@string/use_direct_memory_import" />
<CheckBoxPreference
android:defaultValue="false"
android:summary="@string/force_max_gpu_clocks_desc"
app:key="force_max_gpu_clocks"
app:title="@string/force_max_gpu_clocks" />
<CheckBoxPreference
android:defaultValue="false"
android:summaryOff="@string/shader_cache_enabled"
android:summaryOn="@string/shader_cache_disabled"
app:key="disable_shader_cache"
app:title="@string/shader_cache" />
</PreferenceCategory>
<PreferenceCategory
android:key="category_hacks"
android:title="@string/hacks">
<CheckBoxPreference
android:defaultValue="false"
android:summaryOff="@string/enable_fast_gpu_readback_disabled"
android:summaryOn="@string/enable_fast_gpu_readback_enabled"
app:key="enable_fast_gpu_readback_hack"
app:title="@string/enable_fast_gpu_readback" />
<CheckBoxPreference
android:defaultValue="false"
android:dependency="enable_fast_gpu_readback_hack"
android:summaryOff="@string/enable_fast_readback_writes_disabled"
android:summaryOn="@string/enable_fast_readback_writes_enabled"
app:key="enable_fast_readback_writes"
app:title="@string/enable_fast_readback_writes" />
<CheckBoxPreference
android:defaultValue="false"
android:summaryOff="@string/disable_subgroup_shuffle_disabled"
android:summaryOn="@string/disable_subgroup_shuffle_enabled"
app:key="disable_subgroup_shuffle"
app:title="@string/disable_subgroup_shuffle" />
</PreferenceCategory>
<PreferenceCategory
android:key="category_audio"
android:title="@string/audio"
app:isPreferenceVisible="true">
<CheckBoxPreference
android:defaultValue="false"
android:summaryOff="@string/disable_audio_output_disabled"
android:summaryOn="@string/disable_audio_output_enabled"
app:key="is_audio_output_disabled"
app:title="@string/disable_audio_output" />
</PreferenceCategory>
<PreferenceCategory
android:key="category_debug"
android:title="@string/debug"
app:isPreferenceVisible="false">
<CheckBoxPreference
android:defaultValue="false"
android:summaryOff="@string/validation_layer_disabled"
android:summaryOn="@string/validation_layer_enabled"
app:key="validation_layer"
app:title="@string/validation_layer" />
</PreferenceCategory>
</androidx.preference.PreferenceScreen>

View File

@ -0,0 +1,16 @@
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory
android:key="category_input"
android:title="@string/input"
app:initialExpandedChildrenCount="4">
<emu.skyline.preference.ControllerPreference index="0" />
<emu.skyline.preference.ControllerPreference index="1" />
<emu.skyline.preference.ControllerPreference index="2" />
<emu.skyline.preference.ControllerPreference index="3" />
<emu.skyline.preference.ControllerPreference index="4" />
<emu.skyline.preference.ControllerPreference index="5" />
<emu.skyline.preference.ControllerPreference index="6" />
<emu.skyline.preference.ControllerPreference index="7" />
</PreferenceCategory>
</androidx.preference.PreferenceScreen>

View File

@ -1,407 +0,0 @@
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory
android:key="category_emulator"
android:title="@string/emulator">
<emu.skyline.preference.DocumentsProviderPreference
app:key="document_provider"
app:summary="@string/open_data_directory_summary"
app:title="@string/open_data_directory" />
<emu.skyline.preference.ThemePreference
android:defaultValue="2"
android:entries="@array/app_theme"
app:key="app_theme"
app:title="@string/theme"
app:useSimpleSummaryProvider="true" />
<CheckBoxPreference
android:defaultValue="false"
android:summaryOff="@string/perf_stats_desc_off"
android:summaryOn="@string/perf_stats_desc_on"
app:key="perf_stats"
app:title="@string/perf_stats" />
<emu.skyline.preference.LogLevelPreference
android:defaultValue="2"
android:entries="@array/log_level"
app:key="log_level"
app:title="@string/log_level"
app:useSimpleSummaryProvider="true" />
</PreferenceCategory>
<PreferenceCategory
android:key="category_applist"
android:title="@string/app_list"
app:initialExpandedChildrenCount="3">
<emu.skyline.preference.FolderPickerPreference
app:key="search_location"
app:title="@string/search_location" />
<emu.skyline.preference.IntegerListPreference
android:defaultValue="1"
android:entries="@array/layout_type"
app:key="layout_type"
app:title="@string/layout_type"
app:useSimpleSummaryProvider="true" />
<emu.skyline.preference.IntegerListPreference
android:defaultValue="0"
android:entries="@array/sort_apps_by"
app:key="sort_apps_by"
app:refreshRequired="true"
app:title="@string/sort_apps_by"
app:useSimpleSummaryProvider="true" />
<emu.skyline.preference.RefreshCheckBoxPreference
android:defaultValue="true"
android:summaryOff="@string/group_by_format_desc_off"
android:summaryOn="@string/group_by_format_desc_on"
app:key="group_by_format"
app:refreshRequired="true"
app:title="@string/group_by_format" />
<CheckBoxPreference
android:defaultValue="false"
android:summaryOff="@string/select_action_desc_off"
android:summaryOn="@string/select_action_desc_on"
app:key="select_action"
app:title="@string/select_action" />
</PreferenceCategory>
<PreferenceCategory
android:key="category_keys"
android:title="@string/keys">
<emu.skyline.preference.KeyPickerPreference
app:key="prod_keys"
app:title="@string/prod_keys"
app:useSimpleSummaryProvider="true" />
<emu.skyline.preference.KeyPickerPreference
app:key="title_keys"
app:title="@string/title_keys"
app:useSimpleSummaryProvider="true" />
</PreferenceCategory>
<PreferenceCategory
android:key="category_system"
android:title="@string/system">
<CheckBoxPreference
android:defaultValue="true"
android:summaryOff="@string/handheld_enabled"
android:summaryOn="@string/docked_enabled"
app:key="is_docked"
app:title="@string/use_docked" />
<emu.skyline.preference.CustomEditTextPreference
android:defaultValue="@string/username_default"
app:key="username_value"
app:limit="31"
app:title="@string/username" />
<emu.skyline.preference.ProfilePicturePreference
app:key="profile_picture_value"
app:title="@string/profile_picture" />
<emu.skyline.preference.IntegerListPreference
android:defaultValue="1"
android:entries="@array/system_languages"
android:entryValues="@array/system_languages_val"
app:key="system_language"
app:refreshRequired="true"
app:title="@string/system_language"
app:useSimpleSummaryProvider="true" />
<emu.skyline.preference.IntegerListPreference
android:defaultValue="-1"
android:entries="@array/system_region"
android:entryValues="@array/system_region_val"
app:key="system_region"
app:title="@string/system_region"
app:useSimpleSummaryProvider="true" />
</PreferenceCategory>
<PreferenceCategory
android:key="category_presentation"
android:title="@string/display">
<emu.skyline.preference.IntegerListPreference
android:defaultValue="6"
android:entries="@array/orientation_entries"
android:entryValues="@array/orientation_values"
app:key="orientation"
app:title="@string/screen_orientation"
app:useSimpleSummaryProvider="true" />
<emu.skyline.preference.IntegerListPreference
android:defaultValue="0"
android:entries="@array/aspect_ratios"
app:key="aspect_ratio"
app:title="@string/aspect_ratio"
app:useSimpleSummaryProvider="true" />
<CheckBoxPreference
android:defaultValue="false"
android:summaryOff="@string/respect_display_cutout_disabled"
android:summaryOn="@string/respect_display_cutout_enabled"
app:key="respect_display_cutout"
app:title="@string/respect_display_cutout" />
<CheckBoxPreference
android:defaultValue="true"
android:summaryOff="@string/triple_buffering_disabled"
android:summaryOn="@string/triple_buffering_enabled"
app:key="force_triple_buffering"
app:title="@string/force_triple_buffering" />
<CheckBoxPreference
android:defaultValue="false"
android:dependency="force_triple_buffering"
android:summaryOff="@string/disable_frame_throttling_disabled"
android:summaryOn="@string/disable_frame_throttling_enabled"
app:key="disable_frame_throttling"
app:title="@string/disable_frame_throttling" />
<CheckBoxPreference
android:defaultValue="false"
android:summaryOff="@string/max_refresh_rate_disabled"
android:summaryOn="@string/max_refresh_rate_enabled"
app:key="max_refresh_rate"
app:title="@string/max_refresh_rate" />
</PreferenceCategory>
<PreferenceCategory
android:key="category_gpu"
android:title="@string/gpu">
<emu.skyline.preference.GpuDriverPreference
app:key="gpu_driver"
app:title="@string/gpu_driver_config" />
<SeekBarPreference
android:defaultValue="4"
android:max="6"
android:min="1"
android:summary="@string/executor_slot_count_scale_desc"
app:key="executor_slot_count_scale"
app:showSeekBarValue="true"
app:title="@string/executor_slot_count_scale" />
<SeekBarPreference
android:defaultValue="256"
android:max="1024"
android:min="0"
android:summary="@string/executor_flush_threshold_desc"
app:key="executor_flush_threshold"
app:showSeekBarValue="true"
app:title="@string/executor_flush_threshold" />
<CheckBoxPreference
android:defaultValue="false"
android:summary="@string/use_direct_memory_import_desc"
app:key="use_direct_memory_import"
app:title="@string/use_direct_memory_import" />
<CheckBoxPreference
android:defaultValue="false"
android:summary="@string/force_max_gpu_clocks_desc"
app:key="force_max_gpu_clocks"
app:title="@string/force_max_gpu_clocks" />
<CheckBoxPreference
android:defaultValue="false"
android:summaryOff="@string/shader_cache_enabled"
android:summaryOn="@string/shader_cache_disabled"
app:key="disable_shader_cache"
app:title="@string/shader_cache" />
</PreferenceCategory>
<PreferenceCategory
android:key="category_hacks"
android:title="@string/hacks">
<CheckBoxPreference
android:defaultValue="false"
android:summaryOff="@string/enable_fast_gpu_readback_disabled"
android:summaryOn="@string/enable_fast_gpu_readback_enabled"
app:key="enable_fast_gpu_readback_hack"
app:title="@string/enable_fast_gpu_readback" />
<CheckBoxPreference
android:defaultValue="false"
android:dependency="enable_fast_gpu_readback_hack"
android:summaryOff="@string/enable_fast_readback_writes_disabled"
android:summaryOn="@string/enable_fast_readback_writes_enabled"
app:key="enable_fast_readback_writes"
app:title="@string/enable_fast_readback_writes" />
<CheckBoxPreference
android:defaultValue="false"
android:summaryOff="@string/disable_subgroup_shuffle_disabled"
android:summaryOn="@string/disable_subgroup_shuffle_enabled"
app:key="disable_subgroup_shuffle"
app:title="@string/disable_subgroup_shuffle" />
</PreferenceCategory>
<PreferenceCategory
android:key="category_audio"
android:title="@string/audio"
app:isPreferenceVisible="true">
<CheckBoxPreference
android:defaultValue="false"
android:summaryOff="@string/disable_audio_output_disabled"
android:summaryOn="@string/disable_audio_output_enabled"
app:key="is_audio_output_disabled"
app:title="@string/disable_audio_output" />
</PreferenceCategory>
<PreferenceCategory
android:key="category_debug"
android:title="@string/debug"
app:isPreferenceVisible="false">
<CheckBoxPreference
android:defaultValue="false"
android:summaryOff="@string/validation_layer_disabled"
android:summaryOn="@string/validation_layer_enabled"
app:key="validation_layer"
app:title="@string/validation_layer" />
</PreferenceCategory>
<PreferenceCategory
android:key="category_input"
android:title="@string/input"
app:initialExpandedChildrenCount="4">
<emu.skyline.preference.ControllerPreference index="0" />
<emu.skyline.preference.ControllerPreference index="1" />
<emu.skyline.preference.ControllerPreference index="2" />
<emu.skyline.preference.ControllerPreference index="3" />
<emu.skyline.preference.ControllerPreference index="4" />
<emu.skyline.preference.ControllerPreference index="5" />
<emu.skyline.preference.ControllerPreference index="6" />
<emu.skyline.preference.ControllerPreference index="7" />
</PreferenceCategory>
<PreferenceCategory
android:key="category_credits"
android:title="@string/credits" />
<PreferenceCategory
android:key="category_licenses"
android:title="@string/licenses"
app:initialExpandedChildrenCount="5">
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright © 2019-2021\nSkyline Team and Contributors"
app:libraryLicense="@string/mpl2_license"
app:libraryUrl="https://github.com/skyline-emu/skyline"
app:summary="@string/skyline_license_description"
app:title="@string/app_name" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright (c) Ryujinx Team and Contributors"
app:libraryLicense="@string/mit_license"
app:libraryUrl="https://github.com/Ryujinx/Ryujinx"
app:summary="@string/ryujinx_description"
app:title="Ryujinx" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright 2021 yuzu Emulator Project\nCopyright © 2021 Skyline Team and Contributors"
app:libraryLicense="@string/mpl2_license"
app:libraryUrl="https://github.com/skyline-emu/shader-compiler"
app:summary="@string/shader_compiler_description"
app:title="yuzu Shader Compiler" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright (c) 2019, sirit\nAll rights reserved."
app:libraryLicense="@string/bsd_3_clause_license"
app:libraryUrl="https://github.com/ReinUsesLisp/sirit"
app:summary="@string/sirit_description"
app:title="Sirit" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright 2015-2020 The Khronos Group Inc."
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://github.com/KhronosGroup/Vulkan-Hpp"
app:summary="@string/vkhpp_description"
app:title="Vulkan-Hpp" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright (c) 2017-2021 Advanced Micro Devices, Inc. All rights reserved."
app:libraryLicense="@string/mit_license"
app:libraryUrl="https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator"
app:summary="@string/vkma_description"
app:title="Vulkan Memory Allocator" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright (c) 2015-2019 The Khronos Group Inc.\nCopyright (c) 2015-2019 Valve Corporation\nCopyright (c) 2015-2019 LunarG, Inc."
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://github.com/KhronosGroup/Vulkan-ValidationLayers"
app:summary="@string/khvkval_description"
app:title="Khronos Vulkan Validation Layer" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright 2021 The Android Open Source Project"
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://github.com/google/oboe"
app:summary="@string/oboe_description"
app:title="Oboe" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright (c) 2017, The Android Open Source Project"
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://github.com/google/perfetto"
app:summary="@string/perfetto_description"
app:title="Perfetto" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright © 2012 - present, Victor Zverovich"
app:libraryLicense="@string/libfmt_mit_license"
app:libraryUrl="https://github.com/fmtlib/fmt"
app:summary="@string/fmtlib_description"
app:title="{fmt}" />
<emu.skyline.preference.LicensePreference
app:libraryLicense="@string/boost_software_license"
app:libraryUrl="https://www.boost.org"
app:summary="@string/boost_description"
app:title="Boost" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright Eric Niebler 2019-present"
app:libraryLicense="@string/boost_software_license"
app:libraryUrl="https://github.com/ericniebler/range-v3"
app:summary="@string/rangev3_description"
app:title="Range v3" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright 2016 QuarksLab"
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://github.com/serge-sans-paille/frozen"
app:summary="@string/frozen_description"
app:title="Frozen" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright (c) 2006-2019 Arseny Kapoulkine"
app:libraryLicense="@string/mit_license"
app:libraryUrl="https://github.com/zeux/pugixml"
app:summary="@string/pugixml_description"
app:title="pugixml" />
<emu.skyline.preference.LicensePreference
app:libraryLicense="@string/opus_bsd_3_clause_license"
app:libraryUrl="https://github.com/xiph/opus"
app:summary="@string/opus_description"
app:title="Opus Audio Codec" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright The Mbed TLS Contributors"
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://github.com/ARMmbed/mbedtls"
app:summary="@string/mbedtls_description"
app:title="Mbed TLS" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright (c) 2011-2020, Yann Collet\nAll rights reserved."
app:libraryLicense="@string/bsd_2_clause_license"
app:libraryUrl="https://github.com/lz4/lz4"
app:summary="@string/lz4_description"
app:title="LZ4 Library" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright 1985, 1987, 1988 The Regents of the University of California.\nAll rights reserved."
app:libraryLicense="@string/bsd_3_clause_license"
app:libraryUrl="https://github.com/skyline-emu/tz"
app:summary="@string/tzcode_description"
app:title="tzcode" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright 2016 Thibault Debatty"
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://github.com/tdebatty/java-string-similarity"
app:summary="@string/jssim_description"
app:title="Java String Similarity" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright (C) 2021 The Android Open Source Project"
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://developer.android.com/jetpack/androidx"
app:summary="@string/andx_description"
app:title="AndroidX" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright (C) 2021 The Android Open Source Project"
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://github.com/material-components/material-components-android"
app:summary="@string/amat_description"
app:title="Android Material Components" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors"
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://kotlinlang.org/api/latest/jvm/stdlib"
app:summary="@string/ktstd_description"
app:title="Kotlin Standard Library" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright 2012-2021 The Dagger Authors"
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://github.com/google/dagger"
app:summary="@string/dagger_description"
app:title="Dagger" />
<emu.skyline.preference.LicensePreference
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://material.io/resources/icons"
app:summary="@string/mtico_description"
app:title="Material Design Icons" />
<emu.skyline.preference.LicensePreference
app:libraryCopyright="Copyright 2018 The Noto Project Authors (github.com/googlei18n/noto-fonts)"
app:libraryLicense="@string/sil_open_font_license"
app:libraryUrl="https://github.com/googlefonts/noto-cjk"
app:summary="@string/noto_sans_description"
app:title="Noto Sans" />
<emu.skyline.preference.LicensePreference
app:libraryLicense="@string/apache2_license"
app:libraryUrl="https://fonts.google.com/specimen/Roboto"
app:summary="@string/roboto_description"
app:title="Roboto" />
</PreferenceCategory>
</androidx.preference.PreferenceScreen>