Ignore OverlayHandlerView as active child
Summary: On foldable devices, there's an issue whereas the topmost root view is of type `OverlayHandlerView`. This doesn't seem to be related in any way to the running app's UI. Or at least is not something of interest when debugging the running app's UI (for example, ig4a). This change effectively ignores the `OverlayHandlerView` instance as active child and instead returns the next to last root view. Reviewed By: LukeDefeo Differential Revision: D44579223 fbshipit-source-id: cea52289c5ba1e6a96817232ac54725b8d2f48d9
This commit is contained in:
committed by
Facebook GitHub Bot
parent
5b0ae2a4f8
commit
8f9bf978e1
@@ -18,7 +18,15 @@ object ApplicationRefDescriptor : ChainedDescriptor<ApplicationRef>() {
|
|||||||
|
|
||||||
override fun onGetActiveChild(node: ApplicationRef): Any? {
|
override fun onGetActiveChild(node: ApplicationRef): Any? {
|
||||||
val children = onGetChildren(node)
|
val children = onGetChildren(node)
|
||||||
return if (children.isNotEmpty()) children.last() else null
|
if (children.isNotEmpty()) {
|
||||||
|
val last = children.last()
|
||||||
|
if (last.javaClass.simpleName.contains("OverlayHandlerView")) {
|
||||||
|
return children.getOrNull(children.size - 2)
|
||||||
|
}
|
||||||
|
return last
|
||||||
|
}
|
||||||
|
|
||||||
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onGetBounds(node: ApplicationRef): Bounds = DisplayMetrics.getDisplayBounds()
|
override fun onGetBounds(node: ApplicationRef): Bounds = DisplayMetrics.getDisplayBounds()
|
||||||
|
|||||||
Reference in New Issue
Block a user