Use item view as anchor

This commit is contained in:
M66B 2020-10-08 17:11:28 +02:00
parent b29b4dba0a
commit c9d36cf9d1
1 changed files with 1 additions and 6 deletions

View File

@ -2093,12 +2093,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
}
private void onSwipeAsk(final @NonNull TupleMessageEx message, @NonNull RecyclerView.ViewHolder viewHolder) {
// Use fixed anchor
ConstraintLayout.LayoutParams lparam = (ConstraintLayout.LayoutParams) vwAnchor.getLayoutParams();
lparam.topMargin = viewHolder.itemView.getTop() + viewHolder.itemView.getHeight();
vwAnchor.setLayoutParams(lparam);
PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(getContext(), getViewLifecycleOwner(), vwAnchor);
PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(getContext(), getViewLifecycleOwner(), viewHolder.itemView);
if (message.ui_seen)
popupMenu.getMenu().add(Menu.NONE, R.string.title_unseen, 1, R.string.title_unseen);