show "No sound" at silent ringtones
This commit is contained in:
parent
c6a2f2c14b
commit
43e8dd3303
|
@ -499,8 +499,12 @@ class EditContactActivity : ContactActivity() {
|
||||||
|
|
||||||
val ringtone = contact!!.ringtone
|
val ringtone = contact!!.ringtone
|
||||||
if (ringtone != null && ringtone.isNotEmpty()) {
|
if (ringtone != null && ringtone.isNotEmpty()) {
|
||||||
val contactRingtone = RingtoneManager.getRingtone(this, Uri.parse(ringtone))
|
if (ringtone == SILENT) {
|
||||||
contact_ringtone.text = contactRingtone.getTitle(this)
|
contact_ringtone.text = getString(R.string.no_sound)
|
||||||
|
} else {
|
||||||
|
val contactRingtone = RingtoneManager.getRingtone(this, Uri.parse(ringtone))
|
||||||
|
contact_ringtone.text = contactRingtone.getTitle(this)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
val default = getDefaultAlarmSound(RingtoneManager.TYPE_RINGTONE)
|
val default = getDefaultAlarmSound(RingtoneManager.TYPE_RINGTONE)
|
||||||
contact_ringtone.text = default.title
|
contact_ringtone.text = default.title
|
||||||
|
|
|
@ -576,9 +576,13 @@ class ViewContactActivity : ContactActivity() {
|
||||||
|
|
||||||
val ringtone = contact!!.ringtone
|
val ringtone = contact!!.ringtone
|
||||||
if (ringtone != null && ringtone.isNotEmpty()) {
|
if (ringtone != null && ringtone.isNotEmpty()) {
|
||||||
val contactRingtone = RingtoneManager.getRingtone(this, Uri.parse(ringtone))
|
if (ringtone == SILENT) {
|
||||||
val ringtoneTitle = contactRingtone.getTitle(this)
|
contact_ringtone.text = getString(R.string.no_sound)
|
||||||
contact_ringtone.text = ringtoneTitle
|
} else {
|
||||||
|
val contactRingtone = RingtoneManager.getRingtone(this, Uri.parse(ringtone))
|
||||||
|
val ringtoneTitle = contactRingtone.getTitle(this)
|
||||||
|
contact_ringtone.text = ringtoneTitle
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
val default = getDefaultAlarmSound(RingtoneManager.TYPE_RINGTONE)
|
val default = getDefaultAlarmSound(RingtoneManager.TYPE_RINGTONE)
|
||||||
contact_ringtone.text = default.title
|
contact_ringtone.text = default.title
|
||||||
|
|
Loading…
Reference in New Issue