Several core classes (including Dialog, PopupWindow and some Menu implementations) create an “overlay layer” that exists above, and separate from, existing UI elements – this is why we don’t need to use special layoutmanagers on underlying Activity contentViews in order to position them. While the documentation is sparse, and cloning those classes is challenging (due to the inaccessible com.android.internal classes like PolicyManager), it’s actually fairly simple to implement the functionality.

Use WindowManager.addView(view, windowManagerLayoutParams) to add a new layer. E.g., to add a view glued to the bottom of the screen, that’ll overlay existing content: