From c75a9b577d02d3a67a9a348022e737d1d9ebf312 Mon Sep 17 00:00:00 2001 From: Alex Hart Date: Wed, 15 Feb 2023 16:30:16 -0400 Subject: [PATCH] Prefer about over phone number. --- .../securesms/ContactSelectionListAdapter.kt | 4 +- .../ContactSelectionListFragment.java | 6 +- .../securesms/NewConversationActivity.java | 6 - .../contacts/ContactSelectionListItem.java | 298 ------------------ .../contacts/paged/ContactSearchAdapter.kt | 17 +- .../contacts/paged/ContactSearchMediator.kt | 12 +- .../forward/MultiselectForwardFragment.kt | 2 +- .../ConversationListFragment.java | 6 +- .../ConversationListSearchAdapter.kt | 4 +- .../v2/stories/ChooseGroupStoryBottomSheet.kt | 2 +- .../ViewAllSignalConnectionsFragment.kt | 2 +- 11 files changed, 29 insertions(+), 330 deletions(-) delete mode 100644 app/src/main/java/org/thoughtcrime/securesms/contacts/ContactSelectionListItem.java diff --git a/app/src/main/java/org/thoughtcrime/securesms/ContactSelectionListAdapter.kt b/app/src/main/java/org/thoughtcrime/securesms/ContactSelectionListAdapter.kt index a0e924b9c..f0a61266c 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ContactSelectionListAdapter.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/ContactSelectionListAdapter.kt @@ -13,11 +13,11 @@ class ContactSelectionListAdapter( context: Context, displayCheckBox: Boolean, displaySmsTag: DisplaySmsTag, - displayPhoneNumber: DisplayPhoneNumber, + displaySecondaryInformation: DisplaySecondaryInformation, onClickCallbacks: OnContactSelectionClick, longClickCallbacks: LongClickCallbacks, storyContextMenuCallbacks: StoryContextMenuCallbacks -) : ContactSearchAdapter(context, emptySet(), displayCheckBox, displaySmsTag, displayPhoneNumber, onClickCallbacks, longClickCallbacks, storyContextMenuCallbacks) { +) : ContactSearchAdapter(context, emptySet(), displayCheckBox, displaySmsTag, displaySecondaryInformation, onClickCallbacks, longClickCallbacks, storyContextMenuCallbacks) { init { registerFactory(NewGroupModel::class.java, LayoutFactory({ NewGroupViewHolder(it, onClickCallbacks::onNewGroupClicked) }, R.layout.contact_selection_new_group_item)) diff --git a/app/src/main/java/org/thoughtcrime/securesms/ContactSelectionListFragment.java b/app/src/main/java/org/thoughtcrime/securesms/ContactSelectionListFragment.java index d953be6fb..65d42127a 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ContactSelectionListFragment.java +++ b/app/src/main/java/org/thoughtcrime/securesms/ContactSelectionListFragment.java @@ -338,7 +338,7 @@ public final class ContactSelectionListFragment extends LoggingFragment selectionLimit, isMulti, ContactSearchAdapter.DisplaySmsTag.DEFAULT, - ContactSearchAdapter.DisplayPhoneNumber.ALWAYS, + ContactSearchAdapter.DisplaySecondaryInformation.ALWAYS, this::mapStateToConfiguration, new ContactSearchMediator.SimpleCallbacks() { @Override @@ -347,11 +347,11 @@ public final class ContactSelectionListFragment extends LoggingFragment } }, false, - (context, fixedContacts, displayCheckBox, displaySmsTag, displayPhoneNumber, callbacks, longClickCallbacks, storyContextMenuCallbacks) -> new ContactSelectionListAdapter( + (context, fixedContacts, displayCheckBox, displaySmsTag, displaySecondaryInformation, callbacks, longClickCallbacks, storyContextMenuCallbacks) -> new ContactSelectionListAdapter( context, displayCheckBox, displaySmsTag, - displayPhoneNumber, + displaySecondaryInformation, new ContactSelectionListAdapter.OnContactSelectionClick() { @Override public void onNewGroupClicked() { diff --git a/app/src/main/java/org/thoughtcrime/securesms/NewConversationActivity.java b/app/src/main/java/org/thoughtcrime/securesms/NewConversationActivity.java index b3c8bacaf..5283307b0 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/NewConversationActivity.java +++ b/app/src/main/java/org/thoughtcrime/securesms/NewConversationActivity.java @@ -40,28 +40,22 @@ import org.signal.core.util.concurrent.SimpleTask; import org.signal.core.util.logging.Log; import org.thoughtcrime.securesms.components.menu.ActionItem; import org.thoughtcrime.securesms.components.menu.SignalContextMenu; -import org.thoughtcrime.securesms.contacts.ContactSelectionListItem; import org.thoughtcrime.securesms.contacts.management.ContactsManagementRepository; import org.thoughtcrime.securesms.contacts.management.ContactsManagementViewModel; -import org.thoughtcrime.securesms.contacts.paged.ContactSearchData; import org.thoughtcrime.securesms.contacts.paged.ContactSearchKey; import org.thoughtcrime.securesms.contacts.sync.ContactDiscovery; import org.thoughtcrime.securesms.conversation.ConversationIntents; import org.thoughtcrime.securesms.database.SignalDatabase; import org.thoughtcrime.securesms.groups.ui.creategroup.CreateGroupActivity; -import org.thoughtcrime.securesms.jobmanager.impl.NetworkConstraint; import org.thoughtcrime.securesms.keyvalue.SignalStore; import org.thoughtcrime.securesms.recipients.Recipient; import org.thoughtcrime.securesms.recipients.RecipientId; import org.thoughtcrime.securesms.util.CommunicationActions; import org.thoughtcrime.securesms.util.FeatureFlags; import org.thoughtcrime.securesms.util.LifecycleDisposable; -import org.thoughtcrime.securesms.util.Util; import org.thoughtcrime.securesms.util.views.SimpleProgressDialog; import java.io.IOException; -import java.util.Arrays; -import java.util.Collections; import java.util.List; import java.util.Objects; import java.util.Optional; diff --git a/app/src/main/java/org/thoughtcrime/securesms/contacts/ContactSelectionListItem.java b/app/src/main/java/org/thoughtcrime/securesms/contacts/ContactSelectionListItem.java deleted file mode 100644 index 53b8d0524..000000000 --- a/app/src/main/java/org/thoughtcrime/securesms/contacts/ContactSelectionListItem.java +++ /dev/null @@ -1,298 +0,0 @@ -package org.thoughtcrime.securesms.contacts; - -import android.annotation.SuppressLint; -import android.content.Context; -import android.text.SpannableStringBuilder; -import android.text.TextUtils; -import android.util.AttributeSet; -import android.view.View; -import android.widget.CheckBox; -import android.widget.TextView; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.constraintlayout.widget.ConstraintLayout; -import androidx.core.content.ContextCompat; - -import org.signal.core.util.logging.Log; -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.contacts.avatars.FallbackContactPhoto; -import org.thoughtcrime.securesms.contacts.avatars.ResourceContactPhoto; -import org.thoughtcrime.securesms.conversation.colors.AvatarColor; -import org.thoughtcrime.securesms.mms.GlideRequests; -import org.thoughtcrime.securesms.phonenumbers.PhoneNumberFormatter; -import org.thoughtcrime.securesms.profiles.manage.UsernameState; -import org.thoughtcrime.securesms.recipients.LiveRecipient; -import org.thoughtcrime.securesms.recipients.Recipient; -import org.thoughtcrime.securesms.recipients.RecipientForeverObserver; -import org.thoughtcrime.securesms.recipients.RecipientId; -import org.thoughtcrime.securesms.util.SpanUtil; -import org.thoughtcrime.securesms.util.Util; -import org.thoughtcrime.securesms.util.ViewUtil; - -import java.util.Optional; - - -public class ContactSelectionListItem extends ConstraintLayout implements RecipientForeverObserver { - - @SuppressWarnings("unused") - private static final String TAG = Log.tag(ContactSelectionListItem.class); - - private AvatarImageView contactPhotoImage; - private TextView numberView; - private FromTextView nameView; - private TextView labelView; - private CheckBox checkBox; - private View smsTag; - private BadgeImageView badge; - - private String number; - private String chipName; - private int contactType; - private String contactName; - private String contactNumber; - private String contactLabel; - private String contactAbout; - private LiveRecipient recipient; - private GlideRequests glideRequests; - - private final UsernameFallbackPhotoProvider usernameFallbackPhotoProvider = new UsernameFallbackPhotoProvider(); - - public ContactSelectionListItem(Context context) { - super(context); - } - - public ContactSelectionListItem(Context context, AttributeSet attrs) { - super(context, attrs); - } - - @Override - protected void onFinishInflate() { - super.onFinishInflate(); - this.contactPhotoImage = findViewById(R.id.contact_photo_image); - this.numberView = findViewById(R.id.number); - this.labelView = findViewById(R.id.label); - this.nameView = findViewById(R.id.name); - this.checkBox = findViewById(R.id.check_box); - this.smsTag = findViewById(R.id.sms_tag); - this.badge = findViewById(R.id.contact_badge); - - ViewUtil.setTextViewGravityStart(this.nameView, getContext()); - } - - @Override - protected void onAttachedToWindow() { - super.onAttachedToWindow(); - if (recipient != null) { - recipient.observeForever(this); - } - } - - @Override - protected void onDetachedFromWindow() { - super.onDetachedFromWindow(); - unbind(); - } - - public void set(@NonNull GlideRequests glideRequests, - @Nullable RecipientId recipientId, - int type, - String name, - String number, - String label, - String about, - boolean checkboxVisible) - { - this.glideRequests = glideRequests; - this.number = number; - this.contactType = type; - this.contactName = name; - this.contactNumber = number; - this.contactLabel = label; - this.contactAbout = about; - - this.contactPhotoImage.setFallbackPhotoProvider(null); - if (type == ContactRepository.NEW_PHONE_TYPE || type == ContactRepository.NEW_USERNAME_TYPE) { - this.recipient = null; - this.contactPhotoImage.setFallbackPhotoProvider(usernameFallbackPhotoProvider); - this.contactPhotoImage.setFallbackPhotoColor(AvatarColor.ON_SURFACE_VARIANT); - this.contactPhotoImage.setAvatar(glideRequests, null, false); - } else if (recipientId != null) { - if (this.recipient != null) { - this.recipient.removeForeverObserver(this); - } - this.recipient = Recipient.live(recipientId); - this.recipient.observeForever(this); - } - - Recipient recipientSnapshot = recipient != null ? recipient.get() : null; - - if (recipientSnapshot != null && !recipientSnapshot.isResolving() && !recipientSnapshot.isMyStory()) { - contactName = recipientSnapshot.getDisplayName(getContext()); - name = contactName; - } else if (recipient != null) { - name = ""; - } - - if (recipientSnapshot == null || recipientSnapshot.isResolving() || recipientSnapshot.isRegistered() || recipientSnapshot.isDistributionList()) { - smsTag.setVisibility(GONE); - } else { - smsTag.setVisibility(VISIBLE); - } - - if (recipientSnapshot == null || recipientSnapshot.isResolving()) { - this.contactPhotoImage.setAvatar(glideRequests, null, false); - setText(null, type, name, number, label, about); - } else if (recipientSnapshot.isMyStory()) { - this.contactPhotoImage.setRecipient(Recipient.self(), false); - setText(recipientSnapshot, type, name, number, label, about); - } else { - this.contactPhotoImage.setAvatar(glideRequests, recipientSnapshot, false); - setText(recipientSnapshot, type, name, number, label, about); - } - - this.checkBox.setVisibility(checkboxVisible ? View.VISIBLE : View.GONE); - - if (recipientSnapshot == null || recipientSnapshot.isSelf()) { - badge.setBadge(null); - } else { - badge.setBadgeFromRecipient(recipientSnapshot); - } - } - - public void setChecked(boolean selected, boolean animate) { - checkBox.setChecked(selected); - } - - @Override - public void setEnabled(boolean enabled) { - super.setEnabled(enabled); - this.checkBox.setEnabled(enabled); - } - - public void unbind() { - if (recipient != null) { - recipient.removeForeverObserver(this); - } - } - - @SuppressLint("SetTextI18n") - private void setText(@Nullable Recipient recipient, int type, String name, String number, String label, @Nullable String about) { - this.numberView.setVisibility(View.VISIBLE); - - if (number == null || number.isEmpty()) { - this.nameView.setEnabled(false); - this.numberView.setText(""); - this.labelView.setVisibility(View.GONE); - } else if (recipient != null && recipient.isGroup()) { - this.nameView.setEnabled(false); - this.numberView.setText(getGroupMemberCount(recipient)); - this.labelView.setVisibility(View.GONE); - } else if (type == ContactRepository.PUSH_TYPE) { - this.numberView.setText(!Util.isEmpty(about) ? about : number); - this.nameView.setEnabled(true); - this.labelView.setVisibility(View.GONE); - } else if (type == ContactRepository.NEW_USERNAME_TYPE) { - this.numberView.setVisibility(View.GONE); - this.nameView.setEnabled(true); - this.labelView.setVisibility(View.GONE); - } else if (recipient != null && recipient.isDistributionList()) { - this.numberView.setText(getViewerCount(number)); - this.labelView.setVisibility(View.GONE); - } else { - this.numberView.setText(!Util.isEmpty(about) ? about : number); - this.nameView.setEnabled(true); - this.labelView.setText(label != null && !label.equals("null") ? getResources().getString(R.string.ContactSelectionListItem__dot_s, label) : ""); - this.labelView.setVisibility(View.VISIBLE); - } - - if (recipient != null) { - this.nameView.setText(recipient); - chipName = recipient.getShortDisplayName(getContext()); - } else if (type == ContactRepository.NEW_USERNAME_TYPE && number != null) { - this.nameView.setText(presentUsername(number)); - } else { - this.nameView.setText(name); - chipName = name; - } - } - - public String getNumber() { - return number; - } - - public String getChipName() { - return chipName; - } - - private String getGroupMemberCount(@NonNull Recipient recipient) { - if (!recipient.isGroup()) { - throw new AssertionError(); - } - int memberCount = recipient.getParticipantIds().size(); - return getContext().getResources().getQuantityString(R.plurals.contact_selection_list_item__number_of_members, memberCount, memberCount); - } - - private String getViewerCount(@NonNull String number) { - int viewerCount = Integer.parseInt(number); - return getContext().getResources().getQuantityString(R.plurals.contact_selection_list_item__number_of_viewers, viewerCount, viewerCount); - } - - private CharSequence presentUsername(@NonNull String username) { - if (username.contains(UsernameState.DELIMITER)) { - return username; - } else { - return new SpannableStringBuilder(username).append(SpanUtil.color(ContextCompat.getColor(getContext(), R.color.signal_colorOutline), UsernameState.DELIMITER)); - } - } - - public @Nullable LiveRecipient getRecipient() { - return recipient; - } - - public boolean isUsernameType() { - return contactType == ContactRepository.NEW_USERNAME_TYPE; - } - - public Optional getRecipientId() { - return recipient != null ? Optional.of(recipient.getId()) : Optional.empty(); - } - - @Override - public void onRecipientChanged(@NonNull Recipient recipient) { - if (this.recipient != null && this.recipient.getId().equals(recipient.getId())) { - contactName = recipient.getDisplayName(getContext()); - contactAbout = recipient.getCombinedAboutAndEmoji(); - - if (recipient.isGroup() && recipient.getGroupId().isPresent()) { - contactNumber = recipient.getGroupId().get().toString(); - } else if (recipient.hasE164()) { - contactNumber = PhoneNumberFormatter.prettyPrint(recipient.getE164().orElse("")); - } else if (!recipient.isDistributionList()) { - contactNumber = recipient.getEmail().orElse(""); - } - - if (recipient.isMyStory()) { - contactPhotoImage.setRecipient(Recipient.self(), false); - } else { - contactPhotoImage.setAvatar(glideRequests, recipient, false); - } - - setText(recipient, contactType, contactName, contactNumber, contactLabel, contactAbout); - smsTag.setVisibility(recipient.isRegistered() || recipient.isDistributionList() ? GONE : VISIBLE); - badge.setBadgeFromRecipient(recipient); - } else { - Log.w(TAG, "Bad change! Local recipient doesn't match. Ignoring. Local: " + (this.recipient == null ? "null" : this.recipient.getId()) + ", Changed: " + recipient.getId()); - } - } - - private static class UsernameFallbackPhotoProvider extends Recipient.FallbackPhotoProvider { - @Override - public @NonNull FallbackContactPhoto getPhotoForRecipientWithoutName() { - return new ResourceContactPhoto(R.drawable.ic_search_24, R.drawable.ic_search_24, R.drawable.ic_search_24); - } - } -} diff --git a/app/src/main/java/org/thoughtcrime/securesms/contacts/paged/ContactSearchAdapter.kt b/app/src/main/java/org/thoughtcrime/securesms/contacts/paged/ContactSearchAdapter.kt index 1c85470f8..6235edf43 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/contacts/paged/ContactSearchAdapter.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/contacts/paged/ContactSearchAdapter.kt @@ -39,7 +39,7 @@ open class ContactSearchAdapter( fixedContacts: Set, displayCheckBox: Boolean, displaySmsTag: DisplaySmsTag, - displayPhoneNumber: DisplayPhoneNumber, + displaySecondaryInformation: DisplaySecondaryInformation, onClickCallbacks: ClickCallbacks, longClickCallbacks: LongClickCallbacks, storyContextMenuCallbacks: StoryContextMenuCallbacks @@ -47,7 +47,7 @@ open class ContactSearchAdapter( init { registerStoryItems(this, displayCheckBox, onClickCallbacks::onStoryClicked, storyContextMenuCallbacks) - registerKnownRecipientItems(this, fixedContacts, displayCheckBox, displaySmsTag, displayPhoneNumber, onClickCallbacks::onKnownRecipientClicked, longClickCallbacks::onKnownRecipientLongClick) + registerKnownRecipientItems(this, fixedContacts, displayCheckBox, displaySmsTag, displaySecondaryInformation, onClickCallbacks::onKnownRecipientClicked, longClickCallbacks::onKnownRecipientLongClick) registerHeaders(this) registerExpands(this, onClickCallbacks::onExpandClicked) registerFactory(UnknownRecipientModel::class.java, LayoutFactory({ UnknownRecipientViewHolder(it, onClickCallbacks::onUnknownRecipientClicked, displayCheckBox) }, R.layout.contact_search_unknown_item)) @@ -84,13 +84,13 @@ open class ContactSearchAdapter( fixedContacts: Set, displayCheckBox: Boolean, displaySmsTag: DisplaySmsTag, - displayPhoneNumber: DisplayPhoneNumber, + displaySecondaryInformation: DisplaySecondaryInformation, recipientListener: OnClickedCallback, recipientLongClickCallback: OnLongClickedCallback ) { mappingAdapter.registerFactory( RecipientModel::class.java, - LayoutFactory({ KnownRecipientViewHolder(it, fixedContacts, displayCheckBox, displaySmsTag, displayPhoneNumber, recipientListener, recipientLongClickCallback) }, R.layout.contact_search_item) + LayoutFactory({ KnownRecipientViewHolder(it, fixedContacts, displayCheckBox, displaySmsTag, displaySecondaryInformation, recipientListener, recipientLongClickCallback) }, R.layout.contact_search_item) ) } @@ -351,7 +351,7 @@ open class ContactSearchAdapter( private val fixedContacts: Set, displayCheckBox: Boolean, displaySmsTag: DisplaySmsTag, - private val displayPhoneNumber: DisplayPhoneNumber, + private val displaySecondaryInformation: DisplaySecondaryInformation, onClick: OnClickedCallback, private val onLongClick: OnLongClickedCallback ) : BaseRecipientViewHolder(itemView, displayCheckBox, displaySmsTag, onClick), LetterHeaderDecoration.LetterHeaderItem { @@ -370,7 +370,10 @@ open class ContactSearchAdapter( val count = recipient.participantIds.size number.text = context.resources.getQuantityString(R.plurals.ContactSearchItems__group_d_members, count, count) number.visible = true - } else if (displayPhoneNumber == DisplayPhoneNumber.ALWAYS && recipient.hasE164()) { + } else if (displaySecondaryInformation == DisplaySecondaryInformation.ALWAYS && recipient.combinedAboutAndEmoji != null) { + number.text = recipient.combinedAboutAndEmoji + number.visible = true + } else if (displaySecondaryInformation == DisplaySecondaryInformation.ALWAYS && recipient.hasE164()) { number.text = PhoneNumberFormatter.prettyPrint(recipient.requireE164()) number.visible = true } else { @@ -608,7 +611,7 @@ open class ContactSearchAdapter( NEVER } - enum class DisplayPhoneNumber { + enum class DisplaySecondaryInformation { NEVER, ALWAYS } diff --git a/app/src/main/java/org/thoughtcrime/securesms/contacts/paged/ContactSearchMediator.kt b/app/src/main/java/org/thoughtcrime/securesms/contacts/paged/ContactSearchMediator.kt index 71c0c6de7..d91b34553 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/contacts/paged/ContactSearchMediator.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/contacts/paged/ContactSearchMediator.kt @@ -31,7 +31,7 @@ import java.util.concurrent.TimeUnit * @param selectionLimits [SelectionLimits] describing how large the result set can be. * @param displayCheckBox Whether or not to display checkboxes on items. * @param displaySmsTag Whether or not to display the SMS tag on items. - * @param displayPhoneNumber Whether or not to display phone numbers on known contacts. + * @param displaySecondaryInformation Whether or not to display phone numbers on known contacts. * @param mapStateToConfiguration Maps a [ContactSearchState] to a [ContactSearchConfiguration] * @param callbacks Hooks to help process, filter, and react to selection * @param performSafetyNumberChecks Whether to perform safety number checks for selected users @@ -44,7 +44,7 @@ class ContactSearchMediator( selectionLimits: SelectionLimits, displayCheckBox: Boolean, displaySmsTag: ContactSearchAdapter.DisplaySmsTag, - displayPhoneNumber: ContactSearchAdapter.DisplayPhoneNumber, + displaySecondaryInformation: ContactSearchAdapter.DisplaySecondaryInformation, mapStateToConfiguration: (ContactSearchState) -> ContactSearchConfiguration, private val callbacks: Callbacks = SimpleCallbacks(), performSafetyNumberChecks: Boolean = true, @@ -71,7 +71,7 @@ class ContactSearchMediator( fixedContacts = fixedContacts, displayCheckBox = displayCheckBox, displaySmsTag = displaySmsTag, - displayPhoneNumber = displayPhoneNumber, + displaySecondaryInformation = displaySecondaryInformation, callbacks = object : ContactSearchAdapter.ClickCallbacks { override fun onStoryClicked(view: View, story: ContactSearchData.Story, isSelected: Boolean) { toggleStorySelection(view, story, isSelected) @@ -232,7 +232,7 @@ class ContactSearchMediator( fixedContacts: Set, displayCheckBox: Boolean, displaySmsTag: ContactSearchAdapter.DisplaySmsTag, - displayPhoneNumber: ContactSearchAdapter.DisplayPhoneNumber, + displaySecondaryInformation: ContactSearchAdapter.DisplaySecondaryInformation, callbacks: ContactSearchAdapter.ClickCallbacks, longClickCallbacks: ContactSearchAdapter.LongClickCallbacks, storyContextMenuCallbacks: ContactSearchAdapter.StoryContextMenuCallbacks @@ -245,12 +245,12 @@ class ContactSearchMediator( fixedContacts: Set, displayCheckBox: Boolean, displaySmsTag: ContactSearchAdapter.DisplaySmsTag, - displayPhoneNumber: ContactSearchAdapter.DisplayPhoneNumber, + displaySecondaryInformation: ContactSearchAdapter.DisplaySecondaryInformation, callbacks: ContactSearchAdapter.ClickCallbacks, longClickCallbacks: ContactSearchAdapter.LongClickCallbacks, storyContextMenuCallbacks: ContactSearchAdapter.StoryContextMenuCallbacks ): PagingMappingAdapter { - return ContactSearchAdapter(context, fixedContacts, displayCheckBox, displaySmsTag, displayPhoneNumber, callbacks, longClickCallbacks, storyContextMenuCallbacks) + return ContactSearchAdapter(context, fixedContacts, displayCheckBox, displaySmsTag, displaySecondaryInformation, callbacks, longClickCallbacks, storyContextMenuCallbacks) } } } diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/mutiselect/forward/MultiselectForwardFragment.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/mutiselect/forward/MultiselectForwardFragment.kt index 8de35671e..a8c6fe8f0 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/mutiselect/forward/MultiselectForwardFragment.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/mutiselect/forward/MultiselectForwardFragment.kt @@ -124,7 +124,7 @@ class MultiselectForwardFragment : FeatureFlags.shareSelectionLimit(), !args.selectSingleRecipient, ContactSearchAdapter.DisplaySmsTag.DEFAULT, - ContactSearchAdapter.DisplayPhoneNumber.NEVER, + ContactSearchAdapter.DisplaySecondaryInformation.NEVER, this::getConfiguration, object : ContactSearchMediator.SimpleCallbacks() { override fun onBeforeContactsSelected(view: View?, contactSearchKeys: Set): Set { diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversationlist/ConversationListFragment.java b/app/src/main/java/org/thoughtcrime/securesms/conversationlist/ConversationListFragment.java index 0246db839..d523b2904 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversationlist/ConversationListFragment.java +++ b/app/src/main/java/org/thoughtcrime/securesms/conversationlist/ConversationListFragment.java @@ -298,7 +298,7 @@ public class ConversationListFragment extends MainFragment implements ActionMode SelectionLimits.NO_LIMITS, false, ContactSearchAdapter.DisplaySmsTag.DEFAULT, - ContactSearchAdapter.DisplayPhoneNumber.NEVER, + ContactSearchAdapter.DisplaySecondaryInformation.NEVER, this::mapSearchStateToConfiguration, new ContactSearchMediator.SimpleCallbacks(), false, @@ -306,7 +306,7 @@ public class ConversationListFragment extends MainFragment implements ActionMode fixedContacts, displayCheckBox, displaySmsTag, - displayPhoneNumber, + displaySecondaryInformation, callbacks, longClickCallbacks, storyContextMenuCallbacks @@ -317,7 +317,7 @@ public class ConversationListFragment extends MainFragment implements ActionMode fixedContacts, displayCheckBox, displaySmsTag, - displayPhoneNumber, + displaySecondaryInformation, new ContactSearchClickCallbacks(callbacks), longClickCallbacks, storyContextMenuCallbacks, diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversationlist/ConversationListSearchAdapter.kt b/app/src/main/java/org/thoughtcrime/securesms/conversationlist/ConversationListSearchAdapter.kt index fdef0a6ca..62d72c985 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversationlist/ConversationListSearchAdapter.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversationlist/ConversationListSearchAdapter.kt @@ -28,13 +28,13 @@ class ConversationListSearchAdapter( fixedContacts: Set, displayCheckBox: Boolean, displaySmsTag: DisplaySmsTag, - displayPhoneNumber: DisplayPhoneNumber, + displaySecondaryInformation: DisplaySecondaryInformation, onClickedCallbacks: ConversationListSearchClickCallbacks, longClickCallbacks: LongClickCallbacks, storyContextMenuCallbacks: StoryContextMenuCallbacks, lifecycleOwner: LifecycleOwner, glideRequests: GlideRequests -) : ContactSearchAdapter(context, fixedContacts, displayCheckBox, displaySmsTag, displayPhoneNumber, onClickedCallbacks, longClickCallbacks, storyContextMenuCallbacks) { +) : ContactSearchAdapter(context, fixedContacts, displayCheckBox, displaySmsTag, displaySecondaryInformation, onClickedCallbacks, longClickCallbacks, storyContextMenuCallbacks) { init { registerFactory( diff --git a/app/src/main/java/org/thoughtcrime/securesms/mediasend/v2/stories/ChooseGroupStoryBottomSheet.kt b/app/src/main/java/org/thoughtcrime/securesms/mediasend/v2/stories/ChooseGroupStoryBottomSheet.kt index 926153d19..aceba590e 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/mediasend/v2/stories/ChooseGroupStoryBottomSheet.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/mediasend/v2/stories/ChooseGroupStoryBottomSheet.kt @@ -67,7 +67,7 @@ class ChooseGroupStoryBottomSheet : FixedRoundedCornerBottomSheetDialogFragment( selectionLimits = FeatureFlags.shareSelectionLimit(), displayCheckBox = true, displaySmsTag = ContactSearchAdapter.DisplaySmsTag.DEFAULT, - displayPhoneNumber = ContactSearchAdapter.DisplayPhoneNumber.NEVER, + displaySecondaryInformation = ContactSearchAdapter.DisplaySecondaryInformation.NEVER, mapStateToConfiguration = { state -> ContactSearchConfiguration.build { query = state.query diff --git a/app/src/main/java/org/thoughtcrime/securesms/stories/settings/connections/ViewAllSignalConnectionsFragment.kt b/app/src/main/java/org/thoughtcrime/securesms/stories/settings/connections/ViewAllSignalConnectionsFragment.kt index ba53a4c19..1afbfa822 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/stories/settings/connections/ViewAllSignalConnectionsFragment.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/stories/settings/connections/ViewAllSignalConnectionsFragment.kt @@ -29,7 +29,7 @@ class ViewAllSignalConnectionsFragment : Fragment(R.layout.view_all_signal_conne selectionLimits = SelectionLimits(0, 0), displayCheckBox = false, displaySmsTag = ContactSearchAdapter.DisplaySmsTag.IF_NOT_REGISTERED, - displayPhoneNumber = ContactSearchAdapter.DisplayPhoneNumber.NEVER, + displaySecondaryInformation = ContactSearchAdapter.DisplaySecondaryInformation.NEVER, mapStateToConfiguration = { getConfiguration() }, performSafetyNumberChecks = false )