mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 18:30:20 +01:00
Fix row selection in new bottom sheet.
This commit is contained in:
@@ -3,6 +3,7 @@ package org.thoughtcrime.securesms.safety
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import org.signal.core.util.DimensionUnit
|
||||
import org.signal.core.util.or
|
||||
import org.thoughtcrime.securesms.R
|
||||
import org.thoughtcrime.securesms.components.AvatarImageView
|
||||
@@ -47,7 +48,6 @@ object SafetyNumberRecipientRowItem {
|
||||
private val avatar: AvatarImageView = itemView.findViewById(R.id.safety_number_recipient_avatar)
|
||||
private val name: TextView = itemView.findViewById(R.id.safety_number_recipient_name)
|
||||
private val identifier: TextView = itemView.findViewById(R.id.safety_number_recipient_identifier)
|
||||
private val menu: View = itemView.findViewById(R.id.safety_number_recipient_menu)
|
||||
|
||||
override fun bind(model: Model) {
|
||||
avatar.setRecipient(model.recipient)
|
||||
@@ -62,8 +62,12 @@ object SafetyNumberRecipientRowItem {
|
||||
|
||||
identifier.text = subLineText
|
||||
identifier.visible = !subLineText.isNullOrBlank()
|
||||
menu.setOnClickListener {
|
||||
|
||||
itemView.setOnClickListener {
|
||||
itemView.isSelected = true
|
||||
SignalContextMenu.Builder(itemView, itemView.rootView as ViewGroup)
|
||||
.offsetY(DimensionUnit.DP.toPixels(12f).toInt())
|
||||
.onDismiss { itemView.isSelected = false }
|
||||
.show(model.getContextMenuActions(model))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,22 +4,25 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dsl_settings_gutter"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:background="@drawable/selectable_list_item_background"
|
||||
android:minHeight="64dp">
|
||||
|
||||
<org.thoughtcrime.securesms.components.AvatarImageView
|
||||
android:id="@+id/safety_number_recipient_avatar"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="12dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/safety_number_recipient_menu"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:contentDescription="@string/SafetyNumberRecipientRowItem__open_context_menu"
|
||||
android:scaleType="centerInside"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
<dimen name="dsl_settings_gutter">24dp</dimen>
|
||||
<dimen name="media_overview_toggle_gutter">10dp</dimen>
|
||||
<dimen name="wallpaper_selection_gutter">16dp</dimen>
|
||||
<dimen name="safety_number_recipient_row_item_gutter">12dp</dimen>
|
||||
|
||||
<dimen name="chat_colors_preview_bubble_max_width">260dp</dimen>
|
||||
|
||||
|
||||
@@ -199,6 +199,7 @@
|
||||
<dimen name="dsl_settings_gutter">16dp</dimen>
|
||||
<dimen name="media_overview_toggle_gutter">2dp</dimen>
|
||||
<dimen name="wallpaper_selection_gutter">8dp</dimen>
|
||||
<dimen name="safety_number_recipient_row_item_gutter">4dp</dimen>
|
||||
|
||||
<dimen name="chat_colors_preview_bubble_max_width">240dp</dimen>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user