Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
It could easy to reproduce when turning on "Don't keep activities".
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit ba0c19707915ff87d9cac2089fcd166bb5cca17d
Author: Ian Lake <ilake@google.com>
Date: Wed Nov 14 16:20:28 2018
Set the correct FragmentManager on active Fragments
All active Fragments should have the correct
FragmentManager set instead of always using the
Activity's FragmentManager.
While added Fragments have their FragmentManager
set correctly in moveToState(), active Fragments
weren't being set correctly, causing issues when
attempting to save the state of the FragmentManager.
Test: new FragmentLifecycleTest
BUG: 119256498
Change-Id: I830f729d93f00859509a0844fae19752342e6ccc
M fragment/src/androidTest/java/androidx/fragment/app/FragmentLifecycleTest.java
M fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java
M fragment/src/main/java/androidx/fragment/app/FragmentState.java
https://android-review.googlesource.com/826954
https://goto.google.com/android-sha1/ba0c19707915ff87d9cac2089fcd166bb5cca17d
Branch: androidx-master-dev
commit ba0c19707915ff87d9cac2089fcd166bb5cca17d
Author: Ian Lake <ilake@google.com>
Date: Wed Nov 14 16:20:28 2018
Set the correct FragmentManager on active Fragments
All active Fragments should have the correct
FragmentManager set instead of always using the
Activity's FragmentManager.
While added Fragments have their FragmentManager
set correctly in moveToState(), active Fragments
weren't being set correctly, causing issues when
attempting to save the state of the FragmentManager.
Test: new FragmentLifecycleTest
BUG: 119256498
Change-Id: I830f729d93f00859509a0844fae19752342e6ccc
M fragment/src/androidTest/java/androidx/fragment/app/FragmentLifecycleTest.java
M fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java
M fragment/src/main/java/androidx/fragment/app/FragmentState.java
jb...@google.com <jb...@google.com> #4
Thanks Ian! Looking forward to a new alpha release ASAP rather than monthly 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.