Listener to detect whether a view is at the front?

Viewed 1807

I have RecyclerView and, in some cases, I show another view on top of it - ProgressDialog, AlertDialog or DialogFragment.

Is there some way to notify me about cases when my RecyclerView is at front or another view is above it now?

I tried to add onFocusChangeListener() to my RecyclerView, but no luck.

PS. Definitely, I can in my RecyclerView create some method isOnFront(boolean onFront) and in all my other views call it, but maybe there is some more elegance way?

2 Answers
Related