Migrate to CompoundButton.OnCheckedChangeListener
Switch and SwitchCompat are both CompoundButton. Using CompoundButton in Java will helps migration in the future. Bug: 306658427 Test: manual - check Settings pages Change-Id: If2e08a9a9557ec66a3b31ef18cd2e15943098a59
This commit is contained in:
@@ -17,18 +17,18 @@
|
||||
package com.android.settings.display;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.Switch;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.CompoundButton.OnCheckedChangeListener;
|
||||
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.widget.SettingsMainSwitchPreference;
|
||||
import com.android.settingslib.widget.OnMainSwitchChangeListener;
|
||||
|
||||
/**
|
||||
* Controller that updates the adaptive brightness.
|
||||
*/
|
||||
public class AutoBrightnessDetailPreferenceController extends
|
||||
AutoBrightnessPreferenceController implements OnMainSwitchChangeListener {
|
||||
AutoBrightnessPreferenceController implements OnCheckedChangeListener {
|
||||
|
||||
public AutoBrightnessDetailPreferenceController(Context context, String key) {
|
||||
super(context, key);
|
||||
@@ -58,7 +58,7 @@ public class AutoBrightnessDetailPreferenceController extends
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSwitchChanged(Switch switchView, boolean isChecked) {
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
if (isChecked != isChecked()) {
|
||||
setChecked(isChecked);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user