kopia lustrzana https://github.com/ryukoposting/Signal-Android
Show verified badge on Note to Self.
rodzic
19381342b3
commit
6a5f5f4ffa
|
@ -62,7 +62,7 @@ public class FromTextView extends SimpleEmojiTextView {
|
|||
builder.append(suffix);
|
||||
}
|
||||
|
||||
if (recipient.isReleaseNotes()) {
|
||||
if (recipient.showVerified()) {
|
||||
Drawable official = ContextUtil.requireDrawable(getContext(), R.drawable.ic_official_20);
|
||||
official.setBounds(0, 0, ViewUtil.dpToPx(20), ViewUtil.dpToPx(20));
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ object BioTextPreference {
|
|||
|
||||
override fun getHeadlineText(context: Context): CharSequence {
|
||||
val name = recipient.getDisplayNameOrUsername(context)
|
||||
return if (recipient.isReleaseNotes) {
|
||||
return if (recipient.showVerified()) {
|
||||
SpannableStringBuilder(name).apply {
|
||||
SpanUtil.appendCenteredImageSpan(this, ContextUtil.requireDrawable(context, R.drawable.ic_official_28), 28, 28)
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import android.widget.TextView
|
|||
import org.thoughtcrime.securesms.R
|
||||
import org.thoughtcrime.securesms.badges.BadgeImageView
|
||||
import org.thoughtcrime.securesms.components.AvatarImageView
|
||||
import org.thoughtcrime.securesms.components.FromTextView
|
||||
import org.thoughtcrime.securesms.recipients.Recipient
|
||||
import org.thoughtcrime.securesms.util.adapter.mapping.LayoutFactory
|
||||
import org.thoughtcrime.securesms.util.adapter.mapping.MappingAdapter
|
||||
|
@ -131,7 +132,7 @@ object ContactSearchItems {
|
|||
protected val avatar: AvatarImageView = itemView.findViewById(R.id.contact_photo_image)
|
||||
protected val badge: BadgeImageView = itemView.findViewById(R.id.contact_badge)
|
||||
protected val checkbox: CheckBox = itemView.findViewById(R.id.check_box)
|
||||
protected val name: TextView = itemView.findViewById(R.id.name)
|
||||
protected val name: FromTextView = itemView.findViewById(R.id.name)
|
||||
protected val number: TextView = itemView.findViewById(R.id.number)
|
||||
protected val label: TextView = itemView.findViewById(R.id.label)
|
||||
protected val smsTag: View = itemView.findViewById(R.id.sms_tag)
|
||||
|
@ -144,12 +145,7 @@ object ContactSearchItems {
|
|||
return
|
||||
}
|
||||
|
||||
if (getRecipient(model).isSelf) {
|
||||
name.setText(R.string.note_to_self)
|
||||
} else {
|
||||
name.text = getRecipient(model).getDisplayName(context)
|
||||
}
|
||||
|
||||
name.setText(getRecipient(model))
|
||||
avatar.setAvatar(getRecipient(model))
|
||||
badge.setBadgeFromRecipient(getRecipient(model))
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ public class ConversationBannerView extends ConstraintLayout {
|
|||
|
||||
public String setTitle(@NonNull Recipient recipient) {
|
||||
SpannableStringBuilder title = new SpannableStringBuilder(recipient.isSelf() ? getContext().getString(R.string.note_to_self) : recipient.getDisplayNameOrUsername(getContext()));
|
||||
if (recipient.isReleaseNotes()) {
|
||||
if (recipient.showVerified()) {
|
||||
SpanUtil.appendCenteredImageSpan(title, ContextUtil.requireDrawable(getContext(), R.drawable.ic_official_28), 28, 28);
|
||||
}
|
||||
contactTitle.setText(title);
|
||||
|
|
|
@ -105,7 +105,7 @@ public class ConversationTitleView extends RelativeLayout {
|
|||
endDrawable = DrawableUtil.tint(endDrawable, ContextCompat.getColor(getContext(), R.color.signal_inverse_transparent_80));
|
||||
}
|
||||
|
||||
if (recipient != null && recipient.isReleaseNotes()) {
|
||||
if (recipient != null && recipient.showVerified()) {
|
||||
endDrawable = ContextUtil.requireDrawable(getContext(), R.drawable.ic_official_24);
|
||||
}
|
||||
|
||||
|
|
|
@ -241,7 +241,7 @@ public final class ConversationListItem extends ConstraintLayout
|
|||
this.locale = locale;
|
||||
this.highlightSubstring = highlightSubstring;
|
||||
|
||||
fromView.setText(SearchUtil.getHighlightedSpan(locale, SpanUtil::getMediumBoldSpan, new SpannableString(contact.getDisplayName(getContext())), highlightSubstring, SearchUtil.MATCH_ALL));
|
||||
fromView.setText(contact, SearchUtil.getHighlightedSpan(locale, SpanUtil::getMediumBoldSpan, new SpannableString(contact.getDisplayName(getContext())), highlightSubstring, SearchUtil.MATCH_ALL), true, null);
|
||||
setSubjectViewText(SearchUtil.getHighlightedSpan(locale, SpanUtil::getBoldSpan, contact.getE164().orElse(""), highlightSubstring, SearchUtil.MATCH_ALL));
|
||||
dateView.setText("");
|
||||
archivedView.setVisibility(GONE);
|
||||
|
@ -449,7 +449,7 @@ public final class ConversationListItem extends ConstraintLayout
|
|||
|
||||
if (highlightSubstring != null) {
|
||||
String name = recipient.isSelf() ? getContext().getString(R.string.note_to_self) : recipient.getDisplayName(getContext());
|
||||
fromView.setText(SearchUtil.getHighlightedSpan(locale, SpanUtil::getMediumBoldSpan, new SpannableString(name), highlightSubstring, SearchUtil.MATCH_ALL));
|
||||
fromView.setText(recipient, SearchUtil.getHighlightedSpan(locale, SpanUtil::getMediumBoldSpan, new SpannableString(name), highlightSubstring, SearchUtil.MATCH_ALL), true, null);
|
||||
} else {
|
||||
fromView.setText(recipient, false);
|
||||
}
|
||||
|
|
|
@ -1149,6 +1149,10 @@ public class Recipient {
|
|||
return isReleaseNotesRecipient;
|
||||
}
|
||||
|
||||
public boolean showVerified() {
|
||||
return isReleaseNotesRecipient || isSelf;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
|
|
|
@ -181,7 +181,7 @@ public final class RecipientBottomSheetDialogFragment extends BottomSheetDialogF
|
|||
Drawable systemContact = DrawableUtil.tint(ContextUtil.requireDrawable(requireContext(), R.drawable.ic_profile_circle_outline_16),
|
||||
ContextCompat.getColor(requireContext(), R.color.signal_text_primary));
|
||||
SpanUtil.appendCenteredImageSpan(nameBuilder, systemContact, 16, 16);
|
||||
} else if (recipient.isReleaseNotes()) {
|
||||
} else if (recipient.showVerified()) {
|
||||
SpanUtil.appendCenteredImageSpan(nameBuilder, ContextUtil.requireDrawable(requireContext(), R.drawable.ic_official_28), 28, 28);
|
||||
}
|
||||
fullName.setText(nameBuilder);
|
||||
|
|
Ładowanie…
Reference in New Issue