How to make a horizontal ContextMenu?

Simply you can achieve by QuickAction library.

https://github.com/piruin/quickaction
https://github.com/lorensiuswlt/NewQuickAction

enter image description here

Hope this will help you!!


I think the thing you need is the PopupWindow. Its easier to implement and has its custom layout setting option. The PopupWindow can be set in custom position as you wish and the idea of implementing a sample copy/paste UI that you are thinking of, can be served with the implementation of PopupWindow as well.

I found this answer very informative if you want to implement your situation with PopupWindow instead of implementing it with context menu.

In the above answer that I mentioned and provided a like to, has a PopupWindow which has a TextView only. You might implement any custom/complex UI instead of having a simple TextView like its shown there.

I hope that helps.

Update

As asked in the comment that getting locations of the position of PopupWindow can be set dynamically as well. I am referring to another link, so that you can check the implementation from there as well.

Here's the implementation of using PopupWindow in a list.