Fix power button pref UI

This commit is contained in:
Vitaliy 2020-06-01 13:07:54 +03:00
parent 12a4bd1056
commit 09082bbda7

View file

@ -97,7 +97,7 @@ public class TurnScreenOnFragment extends BaseSettingsFragment implements OnPref
private void setupTurnScreenOnPowerButtonPref() {
ApplicationMode appMode = getSelectedAppMode();
boolean enabled = settings.TURN_SCREEN_ON_TIME_INT.get() == 0 || settings.USE_SYSTEM_SCREEN_TIMEOUT.get();
boolean enabled = settings.TURN_SCREEN_ON_TIME_INT.getModeValue(appMode) == 0 || settings.USE_SYSTEM_SCREEN_TIMEOUT.getModeValue(appMode);
SwitchPreferenceEx turnScreenOnPowerButton = (SwitchPreferenceEx) findPreference(settings.TURN_SCREEN_ON_POWER_BUTTON.getId());
turnScreenOnPowerButton.setEnabled(enabled);
turnScreenOnPowerButton.setDescription(R.string.turn_screen_on_power_button_descr);