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);
|
||||
}
|
||||
boolean enabled = preference.isEnabled();
|
||||
if (isProfileDependent()) {
|
||||
View cb = holder.itemView.findViewById(R.id.switchWidget);
|
||||
if (cb == null) {
|
||||
cb = holder.findViewById(android.R.id.checkbox);
|
||||
}
|
||||
if (cb instanceof CompoundButton) {
|
||||
View cb = holder.itemView.findViewById(R.id.switchWidget);
|
||||
if (cb == null) {
|
||||
cb = holder.findViewById(android.R.id.checkbox);
|
||||
}
|
||||
if (cb instanceof CompoundButton) {
|
||||
if (isProfileDependent()) {
|
||||
int color = enabled ? getActiveProfileColor() : getDisabledTextColor();
|
||||
UiUtilities.setupCompoundButton(isNightMode(), color, (CompoundButton) cb);
|
||||
} else {
|
||||
UiUtilities.setupCompoundButton((CompoundButton) cb, isNightMode(), UiUtilities.CompoundButtonType.GLOBAL);
|
||||
}
|
||||
}
|
||||
if ((preference.isPersistent() || preference instanceof TwoStatePreference) && !(preference instanceof PreferenceCategory)) {
|
||||
|
|
Loading…
Reference in a new issue