mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 19:38:08 +00:00
Fixed chat bubble long press layout issue in full-screen mode
This commit is contained in:
parent
fb86cd9bcb
commit
2086fbad66
2 changed files with 37 additions and 21 deletions
|
|
@ -48,7 +48,10 @@ import androidx.activity.result.contract.ActivityResultContracts
|
|||
import androidx.annotation.UiThread
|
||||
import androidx.core.app.ActivityCompat
|
||||
import androidx.core.content.FileProvider
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import androidx.core.view.doOnPreDraw
|
||||
import androidx.core.view.updatePadding
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
|
|
@ -1013,9 +1016,6 @@ class ConversationFragment : SlidingPaneChildFragment() {
|
|||
private fun showChatMessageLongPressMenu(chatMessageModel: MessageModel) {
|
||||
Compatibility.setBlurRenderEffect(binding.root)
|
||||
|
||||
val dialog = Dialog(requireContext(), R.style.Theme_LinphoneDialog)
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
|
||||
|
||||
val layout: ChatBubbleLongPressMenuBinding = DataBindingUtil.inflate(
|
||||
LayoutInflater.from(context),
|
||||
R.layout.chat_bubble_long_press_menu,
|
||||
|
|
@ -1085,21 +1085,37 @@ class ConversationFragment : SlidingPaneChildFragment() {
|
|||
dismissDialog()
|
||||
}
|
||||
|
||||
dialog.setContentView(layout.root)
|
||||
dialog.setOnDismissListener {
|
||||
Compatibility.removeBlurRenderEffect(binding.root)
|
||||
val dialog = Dialog(requireContext(), R.style.Theme_LinphoneDialog)
|
||||
dialog.apply {
|
||||
setOnDismissListener {
|
||||
Compatibility.removeBlurRenderEffect(binding.root)
|
||||
}
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE)
|
||||
|
||||
window?.apply {
|
||||
setLayout(
|
||||
WindowManager.LayoutParams.MATCH_PARENT,
|
||||
WindowManager.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
|
||||
setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
|
||||
|
||||
val d: Drawable = ColorDrawable(
|
||||
requireContext().getColor(R.color.grey_300)
|
||||
)
|
||||
d.alpha = 102
|
||||
setBackgroundDrawable(d)
|
||||
}
|
||||
|
||||
setContentView(layout.root)
|
||||
|
||||
ViewCompat.setOnApplyWindowInsetsListener(layout.root) { v, windowInsets ->
|
||||
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
|
||||
v.updatePadding(0, 0, 0, insets.bottom)
|
||||
WindowInsetsCompat.CONSUMED
|
||||
}
|
||||
}
|
||||
|
||||
dialog.window
|
||||
?.setLayout(
|
||||
WindowManager.LayoutParams.MATCH_PARENT,
|
||||
WindowManager.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
val d: Drawable = ColorDrawable(
|
||||
requireContext().getColor(R.color.grey_300)
|
||||
)
|
||||
d.alpha = 102
|
||||
dialog.window?.setBackgroundDrawable(d)
|
||||
dialog.show()
|
||||
messageLongPressDialog = dialog
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,9 +113,9 @@
|
|||
android:onClick="@{resendClickListener}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:text="@string/menu_resend_chat_message"
|
||||
android:background="@drawable/menu_item_background"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:drawableStart="@drawable/paper_plane_right"
|
||||
android:visibility="@{model.isInError && model.isOutgoing ? View.VISIBLE : View.GONE, default=gone}"
|
||||
app:layout_constraintBottom_toTopOf="@id/action_reply"
|
||||
|
|
@ -128,10 +128,10 @@
|
|||
android:onClick="@{replyClickListener}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:text="@string/menu_reply_to_chat_message"
|
||||
android:visibility="@{model.chatRoomIsReadOnly ? View.GONE : View.VISIBLE}"
|
||||
android:background="@drawable/menu_item_background"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:drawableStart="@drawable/reply"
|
||||
app:layout_constraintBottom_toTopOf="@id/action_copy"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
|
@ -143,9 +143,9 @@
|
|||
android:onClick="@{copyClickListener}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:text="@string/menu_copy_chat_message"
|
||||
android:background="@drawable/menu_item_background"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:drawableStart="@drawable/copy"
|
||||
app:layout_constraintBottom_toTopOf="@id/action_forward"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
|
@ -157,9 +157,9 @@
|
|||
android:onClick="@{forwardClickListener}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:text="@string/menu_forward_chat_message"
|
||||
android:background="@drawable/menu_item_background"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:drawableStart="@drawable/forward"
|
||||
android:visibility="@{hideForward ? View.GONE : View.VISIBLE}"
|
||||
app:layout_constraintBottom_toTopOf="@id/action_delete"
|
||||
|
|
@ -172,9 +172,9 @@
|
|||
android:onClick="@{deleteClickListener}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:text="@string/menu_delete_selected_item"
|
||||
android:background="@drawable/menu_item_background"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:drawableStart="@drawable/trash_simple"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue