mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-24 02:25:19 +00:00
Making sure we bold appropriately
This commit is contained in:
parent
8e80ab08a9
commit
78a9ab7159
@ -32,6 +32,7 @@ import org.thoughtcrime.securesms.dependencies.DatabaseComponent
|
||||
import com.bumptech.glide.RequestManager
|
||||
import org.thoughtcrime.securesms.preferences.PrivacySettingsActivity
|
||||
import org.thoughtcrime.securesms.showSessionDialog
|
||||
import org.thoughtcrime.securesms.ui.getSubbedCharSequence
|
||||
import org.thoughtcrime.securesms.ui.getSubbedString
|
||||
|
||||
class ConversationAdapter(
|
||||
@ -159,7 +160,7 @@ class ConversationAdapter(
|
||||
val titleTxt = context.getSubbedString(R.string.callsMissedCallFrom, NAME_KEY to message.individualRecipient.name!!)
|
||||
title(titleTxt)
|
||||
|
||||
val bodyTxt = context.getSubbedString(R.string.callsYouMissedCallPermissions, NAME_KEY to message.individualRecipient.name!!)
|
||||
val bodyTxt = context.getSubbedCharSequence(R.string.callsYouMissedCallPermissions, NAME_KEY to message.individualRecipient.name!!)
|
||||
text(bodyTxt)
|
||||
|
||||
button(R.string.sessionSettings) {
|
||||
|
@ -78,21 +78,21 @@ class BlockedContactsViewModel @Inject constructor(private val storage: Storage)
|
||||
fun getTitle(context: Context): String = context.getString(R.string.blockUnblock)
|
||||
|
||||
// Method to get the appropriate text to display when unblocking 1, 2, or several contacts
|
||||
fun getText(context: Context, contactsToUnblock: Set<Recipient>): String {
|
||||
fun getText(context: Context, contactsToUnblock: Set<Recipient>): CharSequence {
|
||||
return when (contactsToUnblock.size) {
|
||||
// Note: We do not have to handle 0 because if no contacts are chosen then the unblock button is deactivated
|
||||
1 -> Phrase.from(context, R.string.blockUnblockName)
|
||||
.put(NAME_KEY, contactsToUnblock.elementAt(0).name)
|
||||
.format().toString()
|
||||
.format()
|
||||
2 -> Phrase.from(context, R.string.blockUnblockNameTwo)
|
||||
.put(NAME_KEY, contactsToUnblock.elementAt(0).name)
|
||||
.format().toString()
|
||||
.format()
|
||||
else -> {
|
||||
val othersCount = contactsToUnblock.size - 1
|
||||
Phrase.from(context, R.string.blockUnblockNameMultiple)
|
||||
.put(NAME_KEY, contactsToUnblock.elementAt(0).name)
|
||||
.put(COUNT_KEY, othersCount)
|
||||
.format().toString()
|
||||
.format()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,8 @@ import org.thoughtcrime.securesms.calls.WebRtcCallActivity
|
||||
import org.thoughtcrime.securesms.notifications.NotificationChannels
|
||||
import org.thoughtcrime.securesms.preferences.SettingsActivity
|
||||
import org.thoughtcrime.securesms.service.WebRtcCallService
|
||||
import org.thoughtcrime.securesms.ui.getSubbedCharSequence
|
||||
import org.thoughtcrime.securesms.ui.getSubbedString
|
||||
|
||||
class CallNotificationBuilder {
|
||||
|
||||
@ -41,12 +43,11 @@ class CallNotificationBuilder {
|
||||
|
||||
val pendingIntent = PendingIntent.getActivity(context, 0, contentIntent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE)
|
||||
|
||||
val titleTxt = Phrase.from(context, R.string.callsMissedCallFrom)
|
||||
.put(NAME_KEY, callerName)
|
||||
.format().toString()
|
||||
val bodyTxt = Phrase.from(context, R.string.callsYouMissedCallPermissions)
|
||||
.put(NAME_KEY, callerName)
|
||||
.format().toString()
|
||||
val titleTxt = context.getSubbedString(R.string.callsMissedCallFrom, NAME_KEY to callerName)
|
||||
val bodyTxt = context.getSubbedCharSequence(
|
||||
R.string.callsYouMissedCallPermissions,
|
||||
NAME_KEY to callerName
|
||||
)
|
||||
|
||||
val builder = NotificationCompat.Builder(context, NotificationChannels.CALLS)
|
||||
.setSound(null)
|
||||
|
Loading…
Reference in New Issue
Block a user