From 7d6b72e40f2b6c7f3446486125c9b598a30bc3cd Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 20 May 2021 16:20:40 +0200 Subject: [PATCH] Added missing underline to download label in chat + removed file icon orange while pressed --- .../main/chat/data/ChatMessageContentData.kt | 10 ++++++++-- app/src/main/res/drawable/file.xml | 4 ---- app/src/main/res/drawable/file_audio.xml | 4 ---- app/src/main/res/drawable/file_pdf.xml | 4 ---- app/src/main/res/drawable/file_picture.xml | 4 ---- app/src/main/res/drawable/file_video.xml | 4 ---- 6 files changed, 8 insertions(+), 22 deletions(-) diff --git a/app/src/main/java/org/linphone/activities/main/chat/data/ChatMessageContentData.kt b/app/src/main/java/org/linphone/activities/main/chat/data/ChatMessageContentData.kt index 6870f1069..4bbe61061 100644 --- a/app/src/main/java/org/linphone/activities/main/chat/data/ChatMessageContentData.kt +++ b/app/src/main/java/org/linphone/activities/main/chat/data/ChatMessageContentData.kt @@ -20,6 +20,10 @@ package org.linphone.activities.main.chat.data import android.graphics.Bitmap +import android.text.Spannable +import android.text.SpannableString +import android.text.Spanned +import android.text.style.UnderlineSpan import androidx.lifecycle.MutableLiveData import kotlinx.coroutines.* import org.linphone.R @@ -51,7 +55,7 @@ class ChatMessageContentData( val downloadEnabled = MutableLiveData() val downloadProgress = MutableLiveData() val downloadProgressString = MutableLiveData() - val downloadLabel = MutableLiveData() + val downloadLabel = MutableLiveData() val isAlone: Boolean get() { @@ -99,7 +103,9 @@ class ChatMessageContentData( content.name } fileSize.value = AppUtils.bytesToDisplayableSize(content.fileSize.toLong()) - downloadLabel.value = "${AppUtils.getString(R.string.chat_message_download_file)} (${fileSize.value})" + var spannable = SpannableString("${AppUtils.getString(R.string.chat_message_download_file)} (${fileSize.value})") + spannable.setSpan(UnderlineSpan(), 0, spannable.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) + downloadLabel.value = spannable if (content.isFile || (content.isFileTransfer && chatMessage.isOutgoing)) { val path = if (content.isFileEncrypted) content.plainFilePath else content.filePath ?: "" diff --git a/app/src/main/res/drawable/file.xml b/app/src/main/res/drawable/file.xml index 662649d38..f874e16f6 100644 --- a/app/src/main/res/drawable/file.xml +++ b/app/src/main/res/drawable/file.xml @@ -1,9 +1,5 @@ - - - diff --git a/app/src/main/res/drawable/file_audio.xml b/app/src/main/res/drawable/file_audio.xml index cd8223c10..2adba2380 100644 --- a/app/src/main/res/drawable/file_audio.xml +++ b/app/src/main/res/drawable/file_audio.xml @@ -1,9 +1,5 @@ - - - diff --git a/app/src/main/res/drawable/file_pdf.xml b/app/src/main/res/drawable/file_pdf.xml index 63c2db532..a932850e1 100644 --- a/app/src/main/res/drawable/file_pdf.xml +++ b/app/src/main/res/drawable/file_pdf.xml @@ -1,9 +1,5 @@ - - - diff --git a/app/src/main/res/drawable/file_picture.xml b/app/src/main/res/drawable/file_picture.xml index 9fa961da4..6f49ac200 100644 --- a/app/src/main/res/drawable/file_picture.xml +++ b/app/src/main/res/drawable/file_picture.xml @@ -1,9 +1,5 @@ - - - diff --git a/app/src/main/res/drawable/file_video.xml b/app/src/main/res/drawable/file_video.xml index 215d086a3..1b178b560 100644 --- a/app/src/main/res/drawable/file_video.xml +++ b/app/src/main/res/drawable/file_video.xml @@ -1,9 +1,5 @@ - - -