mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 13:08:46 +00:00
Only update text fields if contents changed.
This commit is contained in:
@@ -887,19 +887,24 @@ class StoryViewerPageFragment :
|
||||
storyPost.sender.getDisplayName(requireContext())
|
||||
}
|
||||
|
||||
if (storyPost.group != null) {
|
||||
from.text = getString(R.string.StoryViewerPageFragment__s_to_s, name, storyPost.group.getDisplayName(requireContext()))
|
||||
val text = if (storyPost.group != null) {
|
||||
getString(R.string.StoryViewerPageFragment__s_to_s, name, storyPost.group.getDisplayName(requireContext()))
|
||||
} else {
|
||||
from.text = name
|
||||
name
|
||||
}
|
||||
|
||||
if (from.text != text) {
|
||||
from.text = text
|
||||
}
|
||||
|
||||
from.setOnClickListener { onSenderClicked(storyPost.sender.id) }
|
||||
from.requestLayout()
|
||||
}
|
||||
|
||||
private fun presentDate(date: TextView, storyPost: StoryPost) {
|
||||
date.text = DateUtils.getBriefRelativeTimeSpanString(context, Locale.getDefault(), storyPost.dateInMilliseconds)
|
||||
date.requestLayout()
|
||||
val formattedDate = DateUtils.getBriefRelativeTimeSpanString(context, Locale.getDefault(), storyPost.dateInMilliseconds)
|
||||
if (date.text != formattedDate) {
|
||||
date.text = formattedDate
|
||||
}
|
||||
}
|
||||
|
||||
private fun presentSenderAvatar(senderAvatar: AvatarImageView, post: StoryPost) {
|
||||
|
||||
Reference in New Issue
Block a user