Skip to content

Commit

Permalink
feat: Added duration info in Shared Voices tab
Browse files Browse the repository at this point in the history
Co-authored-by: 23rd <[email protected]>
  • Loading branch information
omg-xtao and 23rd committed Feb 15, 2024
1 parent b20013e commit 1acd794
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1acd794

Please sign in to comment.