Please complete the following information:
Describe the Bug:
When trying to show a balloon in compose in a Fragment annotated with @AndroidEntryPoint the balloon doesn't show up. Especially when used like so:
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
) = content {
// Balloon here
}
This is likely due to the context which is dagger.hilt.android.internal.managers.ViewComponentManager$FragmentContextWrapper
When using the activity context it works:
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
) = ComposeView(requireActivity()).apply {
setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)
setContent {
// Balloon here
}
}
(Note the requireActivity())
Expected Behavior:
The balloon should show without explicitly using the activity context.
Please complete the following information:
Describe the Bug:
When trying to show a balloon in compose in a Fragment annotated with
@AndroidEntryPointthe balloon doesn't show up. Especially when used like so:This is likely due to the context which is
dagger.hilt.android.internal.managers.ViewComponentManager$FragmentContextWrapperWhen using the activity context it works:
(Note the
requireActivity())Expected Behavior:
The balloon should show without explicitly using the activity context.