Implemented suggested design changes - first attempt

Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
This commit is contained in:
Dariusz Olszewski 2022-05-16 22:52:37 +02:00 committed by Marcel Hibbe
parent cee5564f39
commit fcf2118008
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B
2 changed files with 8 additions and 9 deletions

View File

@ -26,7 +26,8 @@ import android.content.BroadcastReceiver
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Build import android.os.Build
import android.text.Html import android.text.SpannableStringBuilder
import android.text.style.ForegroundColorSpan
import android.util.Log import android.util.Log
import androidx.annotation.RequiresApi import androidx.annotation.RequiresApi
import androidx.core.app.NotificationCompat import androidx.core.app.NotificationCompat
@ -125,13 +126,11 @@ class DirectReplyReceiver : BroadcastReceiver() {
@RequiresApi(Build.VERSION_CODES.N) @RequiresApi(Build.VERSION_CODES.N)
private fun informReplyFailed() { private fun informReplyFailed() {
val errorMessage = val errorColor = ForegroundColorSpan(context.resources.getColor(R.color.medium_emphasis_text, context.theme))
Html.fromHtml( val errorMessageHeader = context.resources.getString(R.string.nc_message_failed_to_send)
"<font color='red'><em>" + val errorMessage = SpannableStringBuilder()
context.resources.getString(R.string.nc_message_failed_to_send) + .append("$errorMessageHeader\n$replyMessage", errorColor, 0)
"</em></font>", // .append("\n$replyMessage")
Html.FROM_HTML_MODE_COMPACT
)
appendMessageToNotification(errorMessage) appendMessageToNotification(errorMessage)
} }

View File

@ -325,7 +325,7 @@
<string name="nc_formatted_message_you">You: %1$s</string> <string name="nc_formatted_message_you">You: %1$s</string>
<string name="nc_message_read">Message read</string> <string name="nc_message_read">Message read</string>
<string name="nc_message_sent">Message sent</string> <string name="nc_message_sent">Message sent</string>
<string name="nc_message_failed_to_send">Failed to send message</string> <string name="nc_message_failed_to_send">Failed to send message:</string>
<string name="nc_remote_audio_off">Remote audio off</string> <string name="nc_remote_audio_off">Remote audio off</string>
<string name="nc_add_attachment">Add attachment</string> <string name="nc_add_attachment">Add attachment</string>