support: MasterSwitchPreference: isChecked doesn't rely on existence of switch
When checking for isChecked in e.g. a preferenceFragment, we want to know the setting value, independent of whether the preference already has been inflated or not Change-Id: Ie3e777388805d329fea6f56ef306a4c941993938 Signed-off-by: spezi77 <spezi7713@gmx.net>
This commit is contained in:
@@ -87,7 +87,7 @@ public class MasterSwitchPreference extends TwoTargetPreference {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isChecked() {
|
public boolean isChecked() {
|
||||||
return mSwitch != null && mSwitch.isEnabled() && mChecked;
|
return mChecked;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setChecked(boolean checked) {
|
public void setChecked(boolean checked) {
|
||||||
|
|||||||
Reference in New Issue
Block a user