feat: Added duration info in Shared Voices tab

Co-authored-by: 23rd <23rd@vivaldi.net>
This commit is contained in:
xtaodada 2024-02-15 12:28:50 +08:00
parent b20013e555
commit 1acd794d7c
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659

View File

@ -198,8 +198,9 @@ public class SharedAudioCell extends FrameLayout implements DownloadController.F
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);