I have a full-screen fragment.
And a popup fragment that appears over this.
Which then displays like this.
The popup is inside a full-screen container and centered. The transparent area behind the popup where you can see the fragment behind is clickable so that we can close the popup so it acts modally.
The issue I am having is with handset (d-pad) navigation. When the popup appears I request focus on the close button which works fine, but then navigation focus can be put on items behind the popup. For example: down from the popups close button will put the focus on the green recycler view of the full-screen fragment behind the popup. A secondary issue is that I want to prevent the d-pad directional buttons from focusing away from the popup if there is nothing to go to. An example of this would be the close button where I want the focus to remain on the close button when up, left and right is pressed since there is only content below it.
The next screen shows the expected handset navigation flow in pink (where x means focus stays where is), and the dark arrows are what is happening now and causing the issue.

Is there any way to prevent navigation focus from escaping a view and bubbling up the tree? If there is a way of doing this then I would think Android would then handle the focusing correctly it should just start working as expected!?


