Disable scrolling when context menu is open.
This commit is contained in:
parent
a0e4b1aaf9
commit
a837f86999
2 changed files with 8 additions and 3 deletions
|
@ -3,6 +3,7 @@ package org.thoughtcrime.securesms.calls.log
|
|||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import org.thoughtcrime.securesms.R
|
||||
import org.thoughtcrime.securesms.components.menu.ActionItem
|
||||
import org.thoughtcrime.securesms.components.menu.SignalContextMenu
|
||||
|
@ -18,11 +19,15 @@ class CallLogContextMenu(
|
|||
private val fragment: Fragment,
|
||||
private val callbacks: Callbacks
|
||||
) {
|
||||
fun show(anchor: View, call: CallLogRow.Call) {
|
||||
fun show(recyclerView: RecyclerView, anchor: View, call: CallLogRow.Call) {
|
||||
recyclerView.suppressLayout(true)
|
||||
anchor.isSelected = true
|
||||
SignalContextMenu.Builder(anchor, anchor.parent as ViewGroup)
|
||||
.preferredVerticalPosition(SignalContextMenu.VerticalPosition.BELOW)
|
||||
.onDismiss { anchor.isSelected = false }
|
||||
.onDismiss {
|
||||
anchor.isSelected = false
|
||||
recyclerView.suppressLayout(false)
|
||||
}
|
||||
.show(
|
||||
listOfNotNull(
|
||||
getVideoCallActionItem(call),
|
||||
|
|
|
@ -292,7 +292,7 @@ class CallLogFragment : Fragment(R.layout.call_log_fragment), CallLogAdapter.Cal
|
|||
}
|
||||
|
||||
override fun onCallLongClicked(itemView: View, callLogRow: CallLogRow.Call): Boolean {
|
||||
callLogContextMenu.show(itemView, callLogRow)
|
||||
callLogContextMenu.show(binding.recycler, itemView, callLogRow)
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue