mirror of
https://github.com/jrpie/Launcher.git
synced 2025-02-23 06:21:31 +01:00
Fix SwitchOnTouchs
They needed to be onChangeListener kind of callbacks, as else, only touches would toggle the values but not sliding the switches.
This commit is contained in:
parent
096abc2c61
commit
93fdf19d46
1 changed files with 12 additions and 19 deletions
|
@ -119,29 +119,29 @@ class SettingsFragmentLauncher : Fragment(), UIObject {
|
||||||
|
|
||||||
override fun setOnClicks() {
|
override fun setOnClicks() {
|
||||||
|
|
||||||
settings_theme_custom_button_select.setOnClickListener {
|
settings_theme_custom_button_select.setOnClickListener { resetToCustomTheme(activity!!) }
|
||||||
resetToCustomTheme(activity!!)
|
|
||||||
}
|
settings_launcher_switch_screen_timeout.isChecked = launcherPreferences.getBoolean(PREF_SCREEN_TIMEOUT_DISABLED, false)
|
||||||
settings_launcher_switch_screen_timeout.setOnClickListener { // Toggle screen timeout
|
settings_launcher_switch_screen_timeout.setOnCheckedChangeListener { _, isChecked -> // Toggle screen timeout
|
||||||
launcherPreferences.edit()
|
launcherPreferences.edit()
|
||||||
.putBoolean(PREF_SCREEN_TIMEOUT_DISABLED,
|
.putBoolean(PREF_SCREEN_TIMEOUT_DISABLED, isChecked)
|
||||||
!launcherPreferences.getBoolean(PREF_SCREEN_TIMEOUT_DISABLED, false))
|
|
||||||
.apply()
|
.apply()
|
||||||
|
|
||||||
setWindowFlags(activity!!.window)
|
setWindowFlags(activity!!.window)
|
||||||
}
|
}
|
||||||
settings_launcher_switch_screen_full.setOnClickListener { // Toggle fullscreen
|
settings_launcher_switch_screen_full.isChecked = launcherPreferences.getBoolean(PREF_SCREEN_FULLSCREEN, true)
|
||||||
|
settings_launcher_switch_screen_full.setOnCheckedChangeListener { _, isChecked -> // Toggle fullscreen
|
||||||
launcherPreferences.edit()
|
launcherPreferences.edit()
|
||||||
.putBoolean(PREF_SCREEN_FULLSCREEN,
|
.putBoolean(PREF_SCREEN_FULLSCREEN, isChecked)
|
||||||
!launcherPreferences.getBoolean(PREF_SCREEN_FULLSCREEN, true))
|
|
||||||
.apply()
|
.apply()
|
||||||
|
|
||||||
setWindowFlags(activity!!.window)
|
setWindowFlags(activity!!.window)
|
||||||
}
|
}
|
||||||
settings_launcher_switch_enable_double.setOnClickListener { // Toggle double actions
|
|
||||||
|
settings_launcher_switch_enable_double.isChecked = launcherPreferences.getBoolean(PREF_DOUBLE_ACTIONS_ENABLED, false)
|
||||||
|
settings_launcher_switch_enable_double.setOnCheckedChangeListener { _, isChecked -> // Toggle double actions
|
||||||
launcherPreferences.edit()
|
launcherPreferences.edit()
|
||||||
.putBoolean(PREF_DOUBLE_ACTIONS_ENABLED,
|
.putBoolean(PREF_DOUBLE_ACTIONS_ENABLED, isChecked)
|
||||||
!launcherPreferences.getBoolean(PREF_DOUBLE_ACTIONS_ENABLED, true))
|
|
||||||
.apply()
|
.apply()
|
||||||
|
|
||||||
intendedSettingsPause = true
|
intendedSettingsPause = true
|
||||||
|
@ -175,13 +175,6 @@ class SettingsFragmentLauncher : Fragment(), UIObject {
|
||||||
R.string.settings_launcher_change_wallpaper
|
R.string.settings_launcher_change_wallpaper
|
||||||
)
|
)
|
||||||
|
|
||||||
settings_launcher_switch_screen_timeout.isChecked =
|
|
||||||
launcherPreferences.getBoolean(PREF_SCREEN_TIMEOUT_DISABLED, false)
|
|
||||||
settings_launcher_switch_screen_full.isChecked =
|
|
||||||
launcherPreferences.getBoolean(PREF_SCREEN_FULLSCREEN, true)
|
|
||||||
settings_launcher_switch_enable_double.isChecked =
|
|
||||||
launcherPreferences.getBoolean(PREF_DOUBLE_ACTIONS_ENABLED, false)
|
|
||||||
|
|
||||||
// Load values into the date-format spinner
|
// Load values into the date-format spinner
|
||||||
val staticAdapter = ArrayAdapter.createFromResource(
|
val staticAdapter = ArrayAdapter.createFromResource(
|
||||||
activity!!, R.array.settings_launcher_time_format_spinner_items,
|
activity!!, R.array.settings_launcher_time_format_spinner_items,
|
||||||
|
|
Loading…
Add table
Reference in a new issue