/*
* Copyright (C) 2015 The CyanogenMod Project
- * Copyright (C) 2017-2022 The LineageOS Project
+ * Copyright (C) 2017-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.
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Bundle;
-import android.widget.Switch;
+import android.widget.CompoundButton;
+import android.widget.CompoundButton.OnCheckedChangeListener;
import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
import androidx.preference.SwitchPreference;
import com.android.settingslib.widget.MainSwitchPreference;
-import com.android.settingslib.widget.OnMainSwitchChangeListener;
public class DozePreferenceFragment extends PreferenceFragment
- implements Preference.OnPreferenceChangeListener, OnMainSwitchChangeListener {
+ implements Preference.OnPreferenceChangeListener, OnCheckedChangeListener {
private MainSwitchPreference mSwitchBar;
}
@Override
- public void onSwitchChanged(Switch switchView, boolean isChecked) {
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
MotoActionsSettings.enableDoze(getActivity(), isChecked);
mSwitchBar.setChecked(isChecked);