@ -75,47 +75,13 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
private fun addConfigSettings ( sl : ArrayList < SettingsItem > ) {
settingsActivity . setToolbarTitle ( settingsActivity . getString ( R . string . advanced _settings ) )
sl . apply {
add ( SubmenuSetting ( R . string . preferences _general , 0 , Settings . SECTION _GENERAL ) )
add ( SubmenuSetting ( R . string . preferences _system , 0 , Settings . SECTION _SYSTEM ) )
add ( SubmenuSetting ( R . string . preferences _graphics , 0 , Settings . SECTION _RENDERER ) )
add ( SubmenuSetting ( R . string . preferences _audio , 0 , Settings . SECTION _AUDIO ) )
add ( SubmenuSetting ( R . string . preferences _debug , 0 , Settings . SECTION _DEBUG ) )
add (
SubmenuSetting (
R . string . preferences _general ,
0 ,
Settings . SECTION _GENERAL
)
)
add (
SubmenuSetting (
R . string . preferences _system ,
0 ,
Settings . SECTION _SYSTEM
)
)
add (
SubmenuSetting (
R . string . preferences _graphics ,
0 ,
Settings . SECTION _RENDERER
)
)
add (
SubmenuSetting (
R . string . preferences _audio ,
0 ,
Settings . SECTION _AUDIO
)
)
add (
SubmenuSetting (
R . string . preferences _debug ,
0 ,
Settings . SECTION _DEBUG
)
)
add (
RunnableSetting (
R . string . reset _to _default ,
0 ,
false
) {
RunnableSetting ( R . string . reset _to _default , 0 , false ) {
ResetSettingsDialogFragment ( ) . show (
settingsActivity . supportFragmentManager ,
ResetSettingsDialogFragment . TAG
@ -132,9 +98,7 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
SwitchSetting (
BooleanSetting . RENDERER _USE _SPEED _LIMIT ,
R . string . frame _limit _enable ,
R . string . frame _limit _enable _description ,
BooleanSetting . RENDERER_USE_SPEED_LIMIT . key ,
BooleanSetting . RENDERER_USE_SPEED_LIMIT . defaultValue
R . string . frame _limit _enable _description
)
)
add (
@ -144,9 +108,7 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
R . string . frame _limit _slider _description ,
1 ,
200 ,
" % " ,
ShortSetting . RENDERER_SPEED_LIMIT . key ,
ShortSetting . RENDERER_SPEED_LIMIT . defaultValue
" % "
)
)
add (
@ -155,18 +117,14 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
R . string . cpu _accuracy ,
0 ,
R . array . cpuAccuracyNames ,
R . array . cpuAccuracyValues ,
IntSetting . CPU_ACCURACY . key ,
IntSetting . CPU_ACCURACY . defaultValue
R . array . cpuAccuracyValues
)
)
add (
SwitchSetting (
BooleanSetting . PICTURE _IN _PICTURE ,
R . string . picture _in _picture ,
R . string . picture _in _picture _description ,
BooleanSetting . PICTURE_IN_PICTURE . key ,
BooleanSetting . PICTURE_IN_PICTURE . defaultValue
R . string . picture _in _picture _description
)
)
}
@ -179,9 +137,7 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
SwitchSetting (
BooleanSetting . USE _DOCKED _MODE ,
R . string . use _docked _mode ,
R . string . use _docked _mode _description ,
BooleanSetting . USE_DOCKED_MODE . key ,
BooleanSetting . USE_DOCKED_MODE . defaultValue
R . string . use _docked _mode _description
)
)
add (
@ -190,9 +146,7 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
R . string . emulated _region ,
0 ,
R . array . regionNames ,
R . array . regionValues ,
IntSetting . REGION_INDEX . key ,
IntSetting . REGION_INDEX . defaultValue
R . array . regionValues
)
)
add (
@ -201,29 +155,17 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
R . string . emulated _language ,
0 ,
R . array . languageNames ,
R . array . languageValues ,
IntSetting . LANGUAGE_INDEX . key ,
IntSetting . LANGUAGE_INDEX . defaultValue
R . array . languageValues
)
)
add (
SwitchSetting (
BooleanSetting . USE _CUSTOM _RTC ,
R . string . use _custom _rtc ,
R . string . use _custom _rtc _description ,
BooleanSetting . USE_CUSTOM_RTC . key ,
BooleanSetting . USE_CUSTOM_RTC . defaultValue
)
)
add (
DateTimeSetting (
LongSetting . CUSTOM _RTC ,
R . string . set _custom _rtc ,
0 ,
LongSetting . CUSTOM_RTC . key ,
LongSetting . CUSTOM_RTC . defaultValue
R . string . use _custom _rtc _description
)
)
add ( DateTimeSetting ( LongSetting . CUSTOM _RTC , R . string . set _custom _rtc , 0 ) )
}
}
@ -236,9 +178,7 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
R . string . renderer _accuracy ,
0 ,
R . array . rendererAccuracyNames ,
R . array . rendererAccuracyValues ,
IntSetting . RENDERER_ACCURACY . key ,
IntSetting . RENDERER_ACCURACY . defaultValue
R . array . rendererAccuracyValues
)
)
add (
@ -247,9 +187,7 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
R . string . renderer _resolution ,
0 ,
R . array . rendererResolutionNames ,
R . array . rendererResolutionValues ,
IntSetting . RENDERER_RESOLUTION . key ,
IntSetting . RENDERER_RESOLUTION . defaultValue
R . array . rendererResolutionValues
)
)
add (
@ -258,9 +196,7 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
R . string . renderer _vsync ,
0 ,
R . array . rendererVSyncNames ,
R . array . rendererVSyncValues ,
IntSetting . RENDERER_VSYNC . key ,
IntSetting . RENDERER_VSYNC . defaultValue
R . array . rendererVSyncValues
)
)
add (
@ -269,9 +205,7 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
R . string . renderer _scaling _filter ,
0 ,
R . array . rendererScalingFilterNames ,
R . array . rendererScalingFilterValues ,
IntSetting . RENDERER_SCALING_FILTER . key ,
IntSetting . RENDERER_SCALING_FILTER . defaultValue
R . array . rendererScalingFilterValues
)
)
add (
@ -280,9 +214,7 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
R . string . renderer _anti _aliasing ,
0 ,
R . array . rendererAntiAliasingNames ,
R . array . rendererAntiAliasingValues ,
IntSetting . RENDERER_ANTI_ALIASING . key ,
IntSetting . RENDERER_ANTI_ALIASING . defaultValue
R . array . rendererAntiAliasingValues
)
)
add (
@ -291,9 +223,7 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
R . string . renderer _screen _layout ,
0 ,
R . array . rendererScreenLayoutNames ,
R . array . rendererScreenLayoutValues ,
IntSetting . RENDERER_SCREEN_LAYOUT . key ,
IntSetting . RENDERER_SCREEN_LAYOUT . defaultValue
R . array . rendererScreenLayoutValues
)
)
add (
@ -302,45 +232,35 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
R . string . renderer _aspect _ratio ,
0 ,
R . array . rendererAspectRatioNames ,
R . array . rendererAspectRatioValues ,
IntSetting . RENDERER_ASPECT_RATIO . key ,
IntSetting . RENDERER_ASPECT_RATIO . defaultValue
R . array . rendererAspectRatioValues
)
)
add (
SwitchSetting (
BooleanSetting . RENDERER _USE _DISK _SHADER _CACHE ,
R . string . use _disk _shader _cache ,
R . string . use _disk _shader _cache _description ,
BooleanSetting . RENDERER_USE_DISK_SHADER_CACHE . key ,
BooleanSetting . RENDERER_USE_DISK_SHADER_CACHE . defaultValue
R . string . use _disk _shader _cache _description
)
)
add (
SwitchSetting (
BooleanSetting . RENDERER _FORCE _MAX _CLOCK ,
R . string . renderer _force _max _clock ,
R . string . renderer _force _max _clock _description ,
BooleanSetting . RENDERER_FORCE_MAX_CLOCK . key ,
BooleanSetting . RENDERER_FORCE_MAX_CLOCK . defaultValue
R . string . renderer _force _max _clock _description
)
)
add (
SwitchSetting (
BooleanSetting . RENDERER _ASYNCHRONOUS _SHADERS ,
R . string . renderer _asynchronous _shaders ,
R . string . renderer _asynchronous _shaders _description ,
BooleanSetting . RENDERER_ASYNCHRONOUS_SHADERS . key ,
BooleanSetting . RENDERER_ASYNCHRONOUS_SHADERS . defaultValue
R . string . renderer _asynchronous _shaders _description
)
)
add (
SwitchSetting (
BooleanSetting . RENDERER _REACTIVE _FLUSHING ,
R . string . renderer _reactive _flushing ,
R . string . renderer _reactive _flushing _description ,
BooleanSetting . RENDERER_REACTIVE_FLUSHING . key ,
BooleanSetting . RENDERER_REACTIVE_FLUSHING . defaultValue
R . string . renderer _reactive _flushing _description
)
)
}
@ -355,9 +275,7 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
R . string . audio _output _engine ,
0 ,
R . array . outputEngineEntries ,
R . array . outputEngineValues ,
IntSetting . AUDIO_OUTPUT_ENGINE . key ,
IntSetting . AUDIO_OUTPUT_ENGINE . defaultValue
R . array . outputEngineValues
)
)
add (
@ -367,9 +285,7 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
R . string . audio _volume _description ,
0 ,
100 ,
" % " ,
ByteSetting . AUDIO_VOLUME . key ,
ByteSetting . AUDIO_VOLUME . defaultValue
" % "
)
)
}
@ -392,7 +308,12 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
override val key : String ? = null
override val category = Settings . Category . UiGeneral
override val isRuntimeModifiable : Boolean = false
override val defaultValue : Any = 0
override val defaultValue : Int = 0
override fun reset ( ) {
preferences . edit ( )
. putInt ( Settings . PREF _THEME , defaultValue )
. apply ( )
}
}
if ( Build . VERSION . SDK _INT >= Build . VERSION_CODES . S ) {
@ -431,7 +352,12 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
override val key : String ? = null
override val category = Settings . Category . UiGeneral
override val isRuntimeModifiable : Boolean = false
override val defaultValue : Any = - 1
override val defaultValue : Int = - 1
override fun reset ( ) {
preferences . edit ( )
. putInt ( Settings . PREF _BLACK _BACKGROUNDS , defaultValue )
. apply ( )
}
}
add (
@ -458,7 +384,12 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
override val key : String ? = null
override val category = Settings . Category . UiGeneral
override val isRuntimeModifiable : Boolean = false
override val defaultValue : Any = false
override val defaultValue : Boolean = false
override fun reset ( ) {
preferences . edit ( )
. putBoolean ( Settings . PREF _BLACK _BACKGROUNDS , defaultValue )
. apply ( )
}
}
add (
@ -481,18 +412,14 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
R . string . renderer _api ,
0 ,
R . array . rendererApiNames ,
R . array . rendererApiValues ,
IntSetting . RENDERER_BACKEND . key ,
IntSetting . RENDERER_BACKEND . defaultValue
R . array . rendererApiValues
)
)
add (
SwitchSetting (
BooleanSetting . RENDERER _DEBUG ,
R . string . renderer _debug ,
R . string . renderer _debug _description ,
BooleanSetting . RENDERER_DEBUG . key ,
BooleanSetting . RENDERER_DEBUG . defaultValue
R . string . renderer _debug _description
)
)
@ -501,9 +428,7 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
SwitchSetting (
BooleanSetting . CPU _DEBUG _MODE ,
R . string . cpu _debug _mode ,
R . string . cpu _debug _mode _description ,
BooleanSetting . CPU_DEBUG_MODE . key ,
BooleanSetting . CPU_DEBUG_MODE . defaultValue
R . string . cpu _debug _mode _description
)
)
@ -520,15 +445,10 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
override val key : String ? = null
override val category = Settings . Category . Cpu
override val isRuntimeModifiable : Boolean = false
override val defaultValue : Any = true
override val defaultValue : Boolean = true
override fun reset ( ) = setBoolean ( defaultValue )
}
add (
SwitchSetting (
fastmem ,
R . string . fastmem ,
0
)
)
add ( SwitchSetting ( fastmem , R . string . fastmem , 0 ) )
}
}
}