Make recipient vibrate preference reflect current state.

Fixes #3396
// FREEBIE
pull/1/head
Moxie Marlinspike 10 years ago
parent a11f6ea1e6
commit 23b274c472

@ -9,7 +9,9 @@ import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.preference.CheckBoxPreference; import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.Preference; import android.preference.Preference;
import android.preference.RingtonePreference;
import android.provider.Settings; import android.provider.Settings;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
@ -164,8 +166,8 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi
private void setSummaries(Recipients recipients) { private void setSummaries(Recipients recipients) {
CheckBoxPreference mutePreference = (CheckBoxPreference) this.findPreference(PREFERENCE_MUTED); CheckBoxPreference mutePreference = (CheckBoxPreference) this.findPreference(PREFERENCE_MUTED);
Preference ringtonePreference = this.findPreference(PREFERENCE_TONE); RingtonePreference ringtonePreference = (RingtonePreference) this.findPreference(PREFERENCE_TONE);
Preference vibratePreference = this.findPreference(PREFERENCE_VIBRATE); ListPreference vibratePreference = (ListPreference) this.findPreference(PREFERENCE_VIBRATE);
Preference blockPreference = this.findPreference(PREFERENCE_BLOCK); Preference blockPreference = this.findPreference(PREFERENCE_BLOCK);
mutePreference.setChecked(recipients.isMuted()); mutePreference.setChecked(recipients.isMuted());
@ -182,10 +184,13 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi
if (recipients.getVibrate() == VibrateState.DEFAULT) { if (recipients.getVibrate() == VibrateState.DEFAULT) {
vibratePreference.setSummary(R.string.preferences__default); vibratePreference.setSummary(R.string.preferences__default);
vibratePreference.setValueIndex(0);
} else if (recipients.getVibrate() == VibrateState.ENABLED) { } else if (recipients.getVibrate() == VibrateState.ENABLED) {
vibratePreference.setSummary("Enabled"); vibratePreference.setSummary("Enabled");
vibratePreference.setValueIndex(1);
} else { } else {
vibratePreference.setSummary("Disabled"); vibratePreference.setSummary("Disabled");
vibratePreference.setValueIndex(2);
} }
if (!recipients.isSingleRecipient() || recipients.isGroupRecipient()) { if (!recipients.isSingleRecipient() || recipients.isGroupRecipient()) {

Loading…
Cancel
Save