Use item view as anchor

pull/187/head
M66B 4 years ago
parent b29b4dba0a
commit c9d36cf9d1

@ -2093,12 +2093,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
} }
private void onSwipeAsk(final @NonNull TupleMessageEx message, @NonNull RecyclerView.ViewHolder viewHolder) { private void onSwipeAsk(final @NonNull TupleMessageEx message, @NonNull RecyclerView.ViewHolder viewHolder) {
// Use fixed anchor PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(getContext(), getViewLifecycleOwner(), viewHolder.itemView);
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);
if (message.ui_seen) if (message.ui_seen)
popupMenu.getMenu().add(Menu.NONE, R.string.title_unseen, 1, R.string.title_unseen); popupMenu.getMenu().add(Menu.NONE, R.string.title_unseen, 1, R.string.title_unseen);

Loading…
Cancel
Save