show "No sound" at silent ringtones

This commit is contained in:
tibbi 2021-02-14 17:58:30 +01:00
parent c6a2f2c14b
commit 43e8dd3303
2 changed files with 13 additions and 5 deletions

View File

@ -499,8 +499,12 @@ class EditContactActivity : ContactActivity() {
val ringtone = contact!!.ringtone
if (ringtone != null && ringtone.isNotEmpty()) {
val contactRingtone = RingtoneManager.getRingtone(this, Uri.parse(ringtone))
contact_ringtone.text = contactRingtone.getTitle(this)
if (ringtone == SILENT) {
contact_ringtone.text = getString(R.string.no_sound)
} else {
val contactRingtone = RingtoneManager.getRingtone(this, Uri.parse(ringtone))
contact_ringtone.text = contactRingtone.getTitle(this)
}
} else {
val default = getDefaultAlarmSound(RingtoneManager.TYPE_RINGTONE)
contact_ringtone.text = default.title

View File

@ -576,9 +576,13 @@ class ViewContactActivity : ContactActivity() {
val ringtone = contact!!.ringtone
if (ringtone != null && ringtone.isNotEmpty()) {
val contactRingtone = RingtoneManager.getRingtone(this, Uri.parse(ringtone))
val ringtoneTitle = contactRingtone.getTitle(this)
contact_ringtone.text = ringtoneTitle
if (ringtone == SILENT) {
contact_ringtone.text = getString(R.string.no_sound)
} else {
val contactRingtone = RingtoneManager.getRingtone(this, Uri.parse(ringtone))
val ringtoneTitle = contactRingtone.getTitle(this)
contact_ringtone.text = ringtoneTitle
}
} else {
val default = getDefaultAlarmSound(RingtoneManager.TYPE_RINGTONE)
contact_ringtone.text = default.title