package org.lineageos.dap
import android.os.Bundle
-import android.widget.Switch
+import android.widget.CompoundButton
+import android.widget.CompoundButton.OnCheckedChangeListener
import androidx.preference.PreferenceFragment
import com.android.settingslib.widget.MainSwitchPreference
-import com.android.settingslib.widget.OnMainSwitchChangeListener
import com.android.settingslib.widget.RadioButtonPreference
import org.lineageos.dap.R
-class DolbyFragment : PreferenceFragment(), OnMainSwitchChangeListener {
+class DolbyFragment : PreferenceFragment(), OnCheckedChangeListener {
private lateinit var switchBar: MainSwitchPreference
}
}
- override fun onSwitchChanged(switchView: Switch, isChecked: Boolean) {
+ override fun onCheckedChanged(buttonView: CompoundButton, isChecked: Boolean) {
DolbyCore.setEnabled(isChecked)
}
import android.os.Bundle;
import android.os.Handler;
-import android.widget.Switch;
+import android.widget.CompoundButton;
+import android.widget.CompoundButton.OnCheckedChangeListener;
import androidx.preference.Preference;
import androidx.preference.Preference.OnPreferenceChangeListener;
import androidx.preference.SwitchPreference;
import com.android.settingslib.widget.MainSwitchPreference;
-import com.android.settingslib.widget.OnMainSwitchChangeListener;
import org.lineageos.internal.util.ScreenType;
public class SamsungDozeSettings extends PreferenceFragment
- implements OnPreferenceChangeListener, OnMainSwitchChangeListener {
+ implements OnPreferenceChangeListener, OnCheckedChangeListener {
private MainSwitchPreference mSwitchBar;
}
@Override
- public void onSwitchChanged(Switch switchView, boolean isChecked) {
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
Utils.enableDoze(getActivity(), isChecked);
Utils.checkDozeService(getActivity());