Closed puntogris closed 3 years ago
Right now it gets the fragment manager of a FragmentActivity, AppCompatActivity and Fragment. AppCompatActivity is not added. If you only build(requireContext())
and then use the BottomSheetDialogFragment
method show(fragmentManager)
, then it works, or? But then I wonder why it works without Hilt - I didn't have time to learn Hilt yet and therefore can't tell you anything. Can I checkout your code or could you build a small sample with hilt and this library?
I tried it like you suggested and it works now, thanks a lot!
You are welcome! Will think about adding it through just the context with the default show method.
I added the preference library, and added PreferenceFragmentCompat so it can take the fragment manager directly through the context, which is used for the custom show + build method. Should work with the next version too then.
I'm getting :
java.lang.IllegalStateException: Context has no window attached. at com.maxkeppeler.bottomsheets.core.BottomSheet.show(BottomSheet.kt:412) at com.maxkeppeler.bottomsheets.time_clock.ClockTimeSheet.show(ClockTimeSheet.kt:120)
when using
ClockTimeSheet().show(requireContext()){...
with Hilt in aPreferenceFragmentCompat
Library Version: 1.0.6
Additional context When not using hilt on the PreferenceFragmentCompat it works fine.