mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 13:08:46 +00:00
Remove sms tag from contacts.
This commit is contained in:
committed by
Greyson Parrelli
parent
489b58ad67
commit
39cb1c638e
@@ -337,7 +337,6 @@ public final class ContactSelectionListFragment extends LoggingFragment {
|
||||
selectionLimit,
|
||||
new ContactSearchAdapter.DisplayOptions(
|
||||
isMulti,
|
||||
ContactSearchAdapter.DisplaySmsTag.DEFAULT,
|
||||
ContactSearchAdapter.DisplaySecondaryInformation.ALWAYS,
|
||||
newCallCallback != null,
|
||||
false
|
||||
|
||||
@@ -507,7 +507,6 @@ open class ContactSearchAdapter(
|
||||
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)
|
||||
private val startAudio: View = itemView.findViewById(R.id.start_audio)
|
||||
private val startVideo: View = itemView.findViewById(R.id.start_video)
|
||||
|
||||
@@ -543,7 +542,6 @@ open class ContactSearchAdapter(
|
||||
bindAvatar(model)
|
||||
bindNumberField(model)
|
||||
bindLabelField(model)
|
||||
bindSmsTagField(model)
|
||||
bindCallButtons(model)
|
||||
}
|
||||
|
||||
@@ -578,14 +576,6 @@ open class ContactSearchAdapter(
|
||||
label.visible = false
|
||||
}
|
||||
|
||||
protected open fun bindSmsTagField(model: T) {
|
||||
smsTag.visible = when (displayOptions.displaySmsTag) {
|
||||
DisplaySmsTag.DEFAULT -> isSmsContact(model)
|
||||
DisplaySmsTag.IF_NOT_REGISTERED -> isNotRegistered(model)
|
||||
DisplaySmsTag.NEVER -> false
|
||||
}
|
||||
}
|
||||
|
||||
protected open fun bindLongPress(model: T) = Unit
|
||||
|
||||
private fun bindCallButtons(model: T) {
|
||||
@@ -607,14 +597,6 @@ open class ContactSearchAdapter(
|
||||
}
|
||||
}
|
||||
|
||||
private fun isSmsContact(model: T): Boolean {
|
||||
return getRecipient(model).isUnregistered && !getRecipient(model).isDistributionList
|
||||
}
|
||||
|
||||
private fun isNotRegistered(model: T): Boolean {
|
||||
return getRecipient(model).isUnregistered && !getRecipient(model).isDistributionList
|
||||
}
|
||||
|
||||
abstract fun isSelected(model: T): Boolean
|
||||
abstract fun getData(model: T): D
|
||||
abstract fun getRecipient(model: T): Recipient
|
||||
@@ -748,12 +730,6 @@ open class ContactSearchAdapter(
|
||||
fun onDeletePrivateStory(story: ContactSearchData.Story, isSelected: Boolean)
|
||||
}
|
||||
|
||||
enum class DisplaySmsTag {
|
||||
DEFAULT,
|
||||
IF_NOT_REGISTERED,
|
||||
NEVER
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether or not we should display a recipient's 'about' or e164, if either are
|
||||
* available.
|
||||
@@ -765,7 +741,6 @@ open class ContactSearchAdapter(
|
||||
|
||||
data class DisplayOptions(
|
||||
val displayCheckBox: Boolean = false,
|
||||
val displaySmsTag: DisplaySmsTag = DisplaySmsTag.NEVER,
|
||||
val displaySecondaryInformation: DisplaySecondaryInformation = DisplaySecondaryInformation.NEVER,
|
||||
val displayCallButtons: Boolean = false,
|
||||
val displayStoryRing: Boolean = false
|
||||
|
||||
@@ -31,7 +31,6 @@ import java.util.concurrent.TimeUnit
|
||||
* @param fixedContacts Contacts which are "pre-selected" (for example, already a member of a group we're adding to)
|
||||
* @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 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
|
||||
|
||||
@@ -127,7 +127,6 @@ class MultiselectForwardFragment :
|
||||
FeatureFlags.shareSelectionLimit(),
|
||||
ContactSearchAdapter.DisplayOptions(
|
||||
displayCheckBox = !args.selectSingleRecipient,
|
||||
displaySmsTag = ContactSearchAdapter.DisplaySmsTag.DEFAULT,
|
||||
displaySecondaryInformation = ContactSearchAdapter.DisplaySecondaryInformation.NEVER,
|
||||
displayStoryRing = true
|
||||
),
|
||||
|
||||
@@ -301,7 +301,6 @@ public class ConversationListFragment extends MainFragment implements ActionMode
|
||||
SelectionLimits.NO_LIMITS,
|
||||
new ContactSearchAdapter.DisplayOptions(
|
||||
false,
|
||||
ContactSearchAdapter.DisplaySmsTag.DEFAULT,
|
||||
ContactSearchAdapter.DisplaySecondaryInformation.NEVER,
|
||||
false,
|
||||
false
|
||||
|
||||
@@ -68,7 +68,6 @@ class ChooseGroupStoryBottomSheet : FixedRoundedCornerBottomSheetDialogFragment(
|
||||
selectionLimits = FeatureFlags.shareSelectionLimit(),
|
||||
displayOptions = ContactSearchAdapter.DisplayOptions(
|
||||
displayCheckBox = true,
|
||||
displaySmsTag = ContactSearchAdapter.DisplaySmsTag.DEFAULT,
|
||||
displaySecondaryInformation = ContactSearchAdapter.DisplaySecondaryInformation.NEVER
|
||||
),
|
||||
mapStateToConfiguration = { state ->
|
||||
|
||||
@@ -29,7 +29,6 @@ class ViewAllSignalConnectionsFragment : Fragment(R.layout.view_all_signal_conne
|
||||
selectionLimits = SelectionLimits(0, 0),
|
||||
displayOptions = ContactSearchAdapter.DisplayOptions(
|
||||
displayCheckBox = false,
|
||||
displaySmsTag = ContactSearchAdapter.DisplaySmsTag.IF_NOT_REGISTERED,
|
||||
displaySecondaryInformation = ContactSearchAdapter.DisplaySecondaryInformation.NEVER
|
||||
),
|
||||
mapStateToConfiguration = { getConfiguration() },
|
||||
|
||||
@@ -105,24 +105,9 @@
|
||||
tools:ignore="RtlSymmetry"
|
||||
tools:text="· Mobile" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sms_tag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:text="@string/ContactSelectionListItem__sms"
|
||||
android:textAppearance="@style/TextAppearance.Signal.Body2"
|
||||
android:textColor="@color/signal_text_secondary"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/check_box"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_goneMarginEnd="0dp"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/button_barrier"
|
||||
app:constraint_referenced_ids="start_audio,start_video,sms_tag"
|
||||
app:constraint_referenced_ids="start_audio,start_video"
|
||||
app:barrierDirection="start"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
@@ -5108,9 +5108,6 @@
|
||||
<!-- VectorAvatarCreationFragment -->
|
||||
<string name="VectorAvatarCreationFragment__select_a_color">Select a color</string>
|
||||
|
||||
<!-- ContactSelectionListItem -->
|
||||
<string name="ContactSelectionListItem__sms">SMS</string>
|
||||
|
||||
<!-- Displayed in the toolbar when externally sharing text to multiple recipients -->
|
||||
<string name="ShareInterstitialActivity__share">Share</string>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user