mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-19 08:09:12 +01:00
Small UI fixes for pinned messages.
This commit is contained in:
committed by
jeffrey-signal
parent
6d01fff7ee
commit
8fd17fd909
@@ -22,6 +22,7 @@ object PinnedContextMenu {
|
||||
anchorView: View,
|
||||
rootView: ViewGroup = anchorView.rootView as ViewGroup,
|
||||
message: MmsMessageRecord,
|
||||
isGroup: Boolean,
|
||||
canUnpin: Boolean,
|
||||
onUnpin: () -> Unit = {},
|
||||
onCopy: () -> Unit = {},
|
||||
@@ -33,6 +34,7 @@ object PinnedContextMenu {
|
||||
anchorView = anchorView,
|
||||
rootView = rootView,
|
||||
message = message,
|
||||
isGroup = isGroup,
|
||||
canUnpin = canUnpin,
|
||||
callbacks = object : Callbacks {
|
||||
override fun onUnpin() = onUnpin()
|
||||
@@ -48,6 +50,7 @@ object PinnedContextMenu {
|
||||
anchorView: View,
|
||||
rootView: ViewGroup,
|
||||
message: MmsMessageRecord,
|
||||
isGroup: Boolean,
|
||||
canUnpin: Boolean,
|
||||
callbacks: Callbacks
|
||||
) {
|
||||
@@ -97,10 +100,11 @@ object PinnedContextMenu {
|
||||
}
|
||||
|
||||
val horizontalPosition = if (message.isOutgoing) SignalContextMenu.HorizontalPosition.END else SignalContextMenu.HorizontalPosition.START
|
||||
val offsetX = if (message.isOutgoing || !isGroup) 16f else 48f
|
||||
SignalContextMenu.Builder(anchorView, rootView)
|
||||
.preferredHorizontalPosition(horizontalPosition)
|
||||
.preferredVerticalPosition(SignalContextMenu.VerticalPosition.BELOW)
|
||||
.offsetX(DimensionUnit.DP.toPixels(16f).toInt())
|
||||
.offsetX(DimensionUnit.DP.toPixels(offsetX).toInt())
|
||||
.offsetY(DimensionUnit.DP.toPixels(4f).toInt())
|
||||
.show(actions)
|
||||
}
|
||||
|
||||
@@ -165,6 +165,7 @@ class PinnedMessagesBottomSheet : FixedRoundedCornerBottomSheetDialogFragment()
|
||||
anchorView = itemView,
|
||||
rootView = itemView.rootView as ViewGroup,
|
||||
message = item.conversationMessage.messageRecord as MmsMessageRecord,
|
||||
isGroup = item.conversationMessage.threadRecipient.isPushV2Group,
|
||||
canUnpin = requireArguments().getBoolean(KEY_CAN_UNPIN),
|
||||
onUnpin = {
|
||||
dismiss()
|
||||
|
||||
Reference in New Issue
Block a user