From 219ef4583218b0403445a6dbb8a638143dc4c78c Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Wed, 20 Mar 2024 09:21:59 +0100 Subject: [PATCH] dap: Migrate to SelectorWithWidgetPreference Change-Id: Ie4aaa1fff836a407c1d8f5b919b7b0051748f5d3 --- dap/res/xml/dolby_settings.xml | 18 +++++++++--------- dap/src/org/lineageos/dap/DolbyFragment.kt | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/dap/res/xml/dolby_settings.xml b/dap/res/xml/dolby_settings.xml index a494eb6f..94f829c2 100644 --- a/dap/res/xml/dolby_settings.xml +++ b/dap/res/xml/dolby_settings.xml @@ -12,40 +12,40 @@ android:key="dolby_top_intro" android:title="@string/dolby_top_intro_summary" /> - - - - - - - - - diff --git a/dap/src/org/lineageos/dap/DolbyFragment.kt b/dap/src/org/lineageos/dap/DolbyFragment.kt index 29834343..ff68a90a 100644 --- a/dap/src/org/lineageos/dap/DolbyFragment.kt +++ b/dap/src/org/lineageos/dap/DolbyFragment.kt @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 The LineageOS Project + * Copyright (C) 2022-2024 The LineageOS Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ import android.widget.CompoundButton.OnCheckedChangeListener import androidx.preference.PreferenceFragment import com.android.settingslib.widget.MainSwitchPreference -import com.android.settingslib.widget.RadioButtonPreference +import com.android.settingslib.widget.SelectorWithWidgetPreference import org.lineageos.dap.R @@ -39,7 +39,7 @@ class DolbyFragment : PreferenceFragment(), OnCheckedChangeListener { switchBar.isChecked = DolbyCore.isEnabled() for ((key, value) in PREF_DOLBY_MODES) { - val preference = findPreference(key)!! + val preference = findPreference(key)!! preference.setOnPreferenceClickListener { setProfile(value) true @@ -55,7 +55,7 @@ class DolbyFragment : PreferenceFragment(), OnCheckedChangeListener { DolbyCore.setProfile(profile) for ((key, value) in PREF_DOLBY_MODES) { - val preference = findPreference(key)!! + val preference = findPreference(key)!! preference.isChecked = value == profile } }