Migrate to CompoundButton
Switch and SwitchCompat are both CompoundButton. Using CompoundButton in Java will helps migration in the future. Bug: 306658427 Test: manual - on affected pages Change-Id: I7cdc2601879a85d33f77239e38263320d5a6984e
This commit is contained in:
@@ -22,7 +22,6 @@ import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.Switch;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.settings.R;
|
||||
@@ -32,7 +31,7 @@ import com.android.settings.R;
|
||||
*/
|
||||
public class FaceEnrollAccessibilityToggle extends LinearLayout {
|
||||
|
||||
private Switch mSwitch;
|
||||
private final CompoundButton mSwitch;
|
||||
|
||||
public FaceEnrollAccessibilityToggle(Context context) {
|
||||
this(context, null /* attrs */);
|
||||
@@ -76,7 +75,7 @@ public class FaceEnrollAccessibilityToggle extends LinearLayout {
|
||||
mSwitch.setOnCheckedChangeListener(listener);
|
||||
}
|
||||
|
||||
public Switch getSwitch() {
|
||||
public CompoundButton getSwitch() {
|
||||
return mSwitch;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user