-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/Android: fallback option for player reparenting #497
base: develop
Are you sure you want to change the base?
Conversation
…View among the direct parents
@tvanlaerhoven please put this PR on hold for a while until our QA folks test these changes over our apps. Thank you. |
var parent: ViewParent? = view?.parent | ||
while (parent != null && parent !is T) { | ||
parent = parent.parent | ||
inline fun <reified T : View> ViewGroup.getClosestParentOfType(upward: Boolean = true): T? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tvanlaerhoven I could move this to some util file, any thoughts? or better keep it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kot331107 You can move it if you like. It could be useful somewhere else as well indeed.
?: (activity.window.decorView.rootView as? ViewGroup) | ||
?.getClosestParentOfType(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would work as a fallback option, so should be safe to merge for current clients I guess. The part to test is PiP reparenting but we set the build flag to false by default as it is experimental
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my understanding: in which case did the upwards search for a suitable root fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in our apps it happens when we switch on the fullscreen mode from inline player. For some reason the React Root view doesn't exist in the direct player's parents in this particular scenario. Also it happens only on the second and any subsequent times. The first attempt it just works fine with the upward search.
converting to draft for now as we see some side effects in our apps we'd like to manage |
Description
Test-plan