Fix Global Settings compound buttons color
This commit is contained in:
parent
b9d217e675
commit
159e5dc319
1 changed files with 8 additions and 6 deletions
|
@ -387,14 +387,16 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
|
||||||
titleView.setSingleLine(false);
|
titleView.setSingleLine(false);
|
||||||
}
|
}
|
||||||
boolean enabled = preference.isEnabled();
|
boolean enabled = preference.isEnabled();
|
||||||
if (isProfileDependent()) {
|
View cb = holder.itemView.findViewById(R.id.switchWidget);
|
||||||
View cb = holder.itemView.findViewById(R.id.switchWidget);
|
if (cb == null) {
|
||||||
if (cb == null) {
|
cb = holder.findViewById(android.R.id.checkbox);
|
||||||
cb = holder.findViewById(android.R.id.checkbox);
|
}
|
||||||
}
|
if (cb instanceof CompoundButton) {
|
||||||
if (cb instanceof CompoundButton) {
|
if (isProfileDependent()) {
|
||||||
int color = enabled ? getActiveProfileColor() : getDisabledTextColor();
|
int color = enabled ? getActiveProfileColor() : getDisabledTextColor();
|
||||||
UiUtilities.setupCompoundButton(isNightMode(), color, (CompoundButton) cb);
|
UiUtilities.setupCompoundButton(isNightMode(), color, (CompoundButton) cb);
|
||||||
|
} else {
|
||||||
|
UiUtilities.setupCompoundButton((CompoundButton) cb, isNightMode(), UiUtilities.CompoundButtonType.GLOBAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((preference.isPersistent() || preference instanceof TwoStatePreference) && !(preference instanceof PreferenceCategory)) {
|
if ((preference.isPersistent() || preference instanceof TwoStatePreference) && !(preference instanceof PreferenceCategory)) {
|
||||||
|
|
Loading…
Reference in a new issue