I was searching for some solution to display an Overlay on ListView, just like what I can do over the MapView. As Android Framework doesn't support multi-hierarchy views in Z-Axis, so it looks challenging. The solution lies behind overwriting standard ListView. The benefit from this feature is multiple, you can display your custom popup over list and there are many more use cases.
How I can do that-
There are 2 steps-
The trick is overriding dispatchDraw(Canvas canvas) method of ListView. This method gets called from Android Framework once List drawing is over. So, whatever you draw inside of dispatchDraw(Canvas canvas), comes in the foreground. You get drawing control over the whole screen, so you can draw popup at anywhere on the screen.
2. Click Event Handling-
To intercept user click events, you need to define Region and need to restrict ListView to handle clicks which falls under your custom Region. You can read my previous post on Region handling in Canvas.
To intercept click events, you need to overwrite onTouchEvent(MotionEvent e).
You can download the complete source from here.