From 1acd794d7c5f5ad14f1136f80b51893430e4bcc0 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Thu, 15 Feb 2024 12:28:50 +0800 Subject: [PATCH] feat: Added duration info in Shared Voices tab Co-authored-by: 23rd <23rd@vivaldi.net> --- .../src/main/java/org/telegram/ui/Cells/SharedAudioCell.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/SharedAudioCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/SharedAudioCell.java index 3e73f3a8ab..1188786613 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/SharedAudioCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/SharedAudioCell.java @@ -198,8 +198,9 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { captionLayoutEmojis = AnimatedEmojiSpan.update(AnimatedEmojiDrawable.CACHE_TYPE_MESSAGES, this, captionLayoutEmojis, captionLayout); } try { - if (viewType == VIEW_TYPE_GLOBAL_SEARCH && (currentMessageObject.isVoice() || currentMessageObject.isRoundVideo())) { + if (/*viewType == VIEW_TYPE_GLOBAL_SEARCH && */(currentMessageObject.isVoice() || currentMessageObject.isRoundVideo())) { CharSequence duration = AndroidUtilities.formatDuration((int) currentMessageObject.getDuration(), false); + duration = duration + " / " + currentMessageObject.getMusicAuthor().replace('\n', ' '); TextPaint paint = viewType == VIEW_TYPE_GLOBAL_SEARCH ? description2TextPaint : Theme.chat_contextResult_descriptionTextPaint; duration = TextUtils.ellipsize(duration, paint, maxWidth, TextUtils.TruncateAt.END); descriptionLayout = new StaticLayout(duration, paint, maxWidth + AndroidUtilities.dp(4), Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);