Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Hi Ed, Thank you so much for these suggestions. I've been reviewing them and merging them in. Hopefully it should be live. I've included a thank you note too in the article.
ap...@google.com <ap...@google.com> #3
Great! Thanks a lot, I'll look for the live updates soon!
jb...@google.com <jb...@google.com> #4
This has been fixed internally and will be available in the Fragment 1.3.0-alpha03 release.
Description
Component used: Fragment
Version used: 1.3.0-alpha02
Devices/Android versions reproduced on: all
The changes introduced into DialogFragment in version 1.3.0-alpha02 are causing BottomSheetDialogFragment to not be display properly. Instead of the Dialog being full screen width, it is a centered, floating dialog.
This reason for this is the recent changes use observe() with a LifecycleObserver on the DialogFragment's viewLifecycleOwnerLiveData , and calls setContentView in the observer's onChanged, instead of in the deprecated onActivityCreated() . But because it uses observe, the observer is not active until the LifecycleOwner is started, so onChanged is not called until the Dialog is started, which means it is shown before setContentView is called.
Instead of observe, the viewLifecycleOwnereLiveData should use observeForever() so that the observer can receive events before the LifecycleOwner is started.