mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 00:37:47 +00:00
enable silent per recipient ringtone preference
Closes #4957 // FREEBIE
This commit is contained in:
parent
143fb1fe21
commit
1aa2d546d2
@ -14,7 +14,7 @@
|
||||
android:key="pref_key_recipient_ringtone"
|
||||
android:title="@string/recipient_preferences__notification_sound"
|
||||
android:ringtoneType="notification"
|
||||
android:showSilent="false"
|
||||
android:showSilent="true"
|
||||
android:showDefault="true"
|
||||
android:persistent="false"/>
|
||||
|
||||
|
@ -21,7 +21,6 @@ import android.support.v4.app.Fragment;
|
||||
import android.support.v4.preference.PreferenceFragment;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.text.TextUtils;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
@ -264,15 +263,21 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi
|
||||
|
||||
mutePreference.setChecked(recipients.isMuted());
|
||||
|
||||
if (recipients.getRingtone() != null) {
|
||||
Ringtone tone = RingtoneManager.getRingtone(getActivity(), recipients.getRingtone());
|
||||
final Uri toneUri = recipients.getRingtone();
|
||||
|
||||
if (toneUri == null) {
|
||||
ringtonePreference.setSummary(R.string.preferences__default);
|
||||
ringtonePreference.setCurrentRingtone(Settings.System.DEFAULT_NOTIFICATION_URI);
|
||||
} else if (toneUri.toString().isEmpty()) {
|
||||
ringtonePreference.setSummary(R.string.preferences__silent);
|
||||
ringtonePreference.setCurrentRingtone(null);
|
||||
} else {
|
||||
Ringtone tone = RingtoneManager.getRingtone(getActivity(), toneUri);
|
||||
|
||||
if (tone != null) {
|
||||
ringtonePreference.setSummary(tone.getTitle(getActivity()));
|
||||
ringtonePreference.setCurrentRingtone(recipients.getRingtone());
|
||||
ringtonePreference.setCurrentRingtone(toneUri);
|
||||
}
|
||||
} else {
|
||||
ringtonePreference.setSummary(R.string.preferences__default);
|
||||
}
|
||||
|
||||
if (recipients.getVibrate() == VibrateState.DEFAULT) {
|
||||
@ -336,7 +341,7 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi
|
||||
|
||||
final Uri uri;
|
||||
|
||||
if (TextUtils.isEmpty(value) || Settings.System.DEFAULT_NOTIFICATION_URI.toString().equals(value)) {
|
||||
if (Settings.System.DEFAULT_NOTIFICATION_URI.toString().equals(value)) {
|
||||
uri = null;
|
||||
} else {
|
||||
uri = Uri.parse(value);
|
||||
|
Loading…
x
Reference in New Issue
Block a user