I'm curious if there's any plans for an equivalent of the `findFragment(view: View)` method for Comp...
v
I'm curious if there's any plans for an equivalent of the
findFragment(view: View)
method for Compose - https://developer.android.com/reference/androidx/fragment/app/FragmentManager#findFragment(android.view.View). Basically need a way to find the fragment that's hosting the composable (Don't judge me for saying that 😄 Need it for practical reasons). If there's no plans for first class support, how can I go about creating similar functionality. The view system essentially makes use of the
get/setTag
method to associate a view to a fragment using this id
R.id.fragment_container_view_tag
.
i
What do you need the fragment for that wouldn't be better suited as either one of the existing CompositionLocals (i.e.,
LocalLifecycleOwner
) or your own
LocalFragment
?
Using
LocalView.current
with
findFragment()
v
Needed the fragment due to the existing assumptions that some of our tooling was making. That can certainly be changed though.
and thanks for the link! This seems promising!