mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +01:00
Mi Band 2: Grey out "rotate wrist to switch info" when "activate display upon lift" in not enabled in preferences
Closes #1124
This commit is contained in:
parent
9d01989b27
commit
979a44a077
@ -151,7 +151,11 @@ public class MiBandPreferencesActivity extends AbstractSettingsActivity {
|
||||
}
|
||||
});
|
||||
|
||||
String displayOnLiftState = prefs.getString(MiBandConst.PREF_ACTIVATE_DISPLAY_ON_LIFT, PREF_MI2_DO_NOT_DISTURB_OFF);
|
||||
boolean displayOnLiftScheduled = displayOnLiftState.equals(PREF_MI2_DO_NOT_DISTURB_SCHEDULED);
|
||||
|
||||
final Preference rotateWristCycleInfo = findPreference(PREF_MI2_ROTATE_WRIST_TO_SWITCH_INFO);
|
||||
rotateWristCycleInfo.setEnabled(!PREF_MI2_DO_NOT_DISTURB_OFF.equals(displayOnLiftState));
|
||||
rotateWristCycleInfo.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newVal) {
|
||||
@ -315,9 +319,6 @@ public class MiBandPreferencesActivity extends AbstractSettingsActivity {
|
||||
}
|
||||
});
|
||||
|
||||
String displayOnLiftState = prefs.getString(MiBandConst.PREF_ACTIVATE_DISPLAY_ON_LIFT, PREF_MI2_DO_NOT_DISTURB_OFF);
|
||||
boolean displayOnLiftScheduled = displayOnLiftState.equals(PREF_MI2_DO_NOT_DISTURB_SCHEDULED);
|
||||
|
||||
final Preference displayOnLiftStart = findPreference(PREF_DISPLAY_ON_LIFT_START);
|
||||
displayOnLiftStart.setEnabled(displayOnLiftScheduled);
|
||||
displayOnLiftStart.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||
@ -358,7 +359,7 @@ public class MiBandPreferencesActivity extends AbstractSettingsActivity {
|
||||
|
||||
displayOnLiftStart.setEnabled(scheduled);
|
||||
displayOnLiftEnd.setEnabled(scheduled);
|
||||
|
||||
rotateWristCycleInfo.setEnabled(!PREF_MI2_DO_NOT_DISTURB_OFF.equals(newVal.toString()));
|
||||
invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
@ -139,20 +139,17 @@
|
||||
|
||||
<nodomain.freeyourgadget.gadgetbridge.util.TimePreference
|
||||
android:defaultValue="00:00"
|
||||
android:dependency="activate_display_on_lift_wrist"
|
||||
android:key="display_on_lift_start"
|
||||
android:title="@string/mi2_prefs_do_not_disturb_start" />
|
||||
|
||||
<nodomain.freeyourgadget.gadgetbridge.util.TimePreference
|
||||
android:defaultValue="00:00"
|
||||
android:dependency="activate_display_on_lift_wrist"
|
||||
android:key="display_on_lift_end"
|
||||
android:title="@string/mi2_prefs_do_not_disturb_end" />
|
||||
|
||||
</PreferenceScreen>
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:dependency="activate_display_on_lift_wrist"
|
||||
android:key="mi2_rotate_wrist_to_switch_info"
|
||||
android:title="@string/mi2_prefs_rotate_wrist_to_switch_info" />
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user