Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 57ca221882695bd6a52549f4d9ea3b812e6fe87c
Author: Simon Schiller <simonschiller@users.noreply.github.com>
Date: Mon Mar 22 16:09:30 2021
[GH] [FragmentStrictMode] Detect <fragment> tag usage
## Proposed Changes
- Detect `<fragment>` tag usage inside XML layouts
## Testing
Test: See `FragmentStrictModeTest#detectFragmentTagUsage`
## Issues Fixed
Fixes: 153738235
This is an imported pull request fromhttps://github.com/androidx/androidx/pull/141 .
Resolves #141
Github-Pr-Head-Sha: 4ea052596e4341b9f11bcf335e2bc38045a91f19
GitOrigin-RevId: 62e7487aa4874eef6bb556490e193717cf937251
Change-Id: Iae48578e85e4e4897f806d7ade2e2a660adf9479
M fragment/fragment/api/public_plus_experimental_current.txt
M fragment/fragment/api/restricted_current.txt
M fragment/fragment/src/androidTest/java/androidx/fragment/app/strictmode/FragmentStrictModeTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentLayoutInflaterFactory.java
M fragment/fragment/src/main/java/androidx/fragment/app/strictmode/FragmentStrictMode.java
A fragment/fragment/src/main/java/androidx/fragment/app/strictmode/FragmentTagUsageViolation.java
https://android-review.googlesource.com/1649748
Branch: androidx-main
commit 57ca221882695bd6a52549f4d9ea3b812e6fe87c
Author: Simon Schiller <simonschiller@users.noreply.github.com>
Date: Mon Mar 22 16:09:30 2021
[GH] [FragmentStrictMode] Detect <fragment> tag usage
## Proposed Changes
- Detect `<fragment>` tag usage inside XML layouts
## Testing
Test: See `FragmentStrictModeTest#detectFragmentTagUsage`
## Issues Fixed
Fixes: 153738235
This is an imported pull request from
Resolves #141
Github-Pr-Head-Sha: 4ea052596e4341b9f11bcf335e2bc38045a91f19
GitOrigin-RevId: 62e7487aa4874eef6bb556490e193717cf937251
Change-Id: Iae48578e85e4e4897f806d7ade2e2a660adf9479
M fragment/fragment/api/public_plus_experimental_current.txt
M fragment/fragment/api/restricted_current.txt
M fragment/fragment/src/androidTest/java/androidx/fragment/app/strictmode/FragmentStrictModeTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentLayoutInflaterFactory.java
M fragment/fragment/src/main/java/androidx/fragment/app/strictmode/FragmentStrictMode.java
A fragment/fragment/src/main/java/androidx/fragment/app/strictmode/FragmentTagUsageViolation.java
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 4734bc39cf00d0cec42e87e64bb54ebd14c33bc3
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Mar 18 09:20:23 2020
Ensure onRestoreInstanceState gets called after setContentView
If setContentView is called after the state of a DialogFragment is
restored, that state is essentially erased. We should ensure that
onRestoreInstanceState is always called after we setContentView.
This change moves the saving and restoring of the dialogState to the
onViewStateRestored method.
Test: updated dialogFragmentTest
Bug: 151652127
Change-Id: If81709abc50ab78a7b6f4ab25eb20be432cb51d5
M fragment/fragment/src/androidTest/java/androidx/fragment/app/DialogFragmentTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/DialogFragment.java
https://android-review.googlesource.com/1261699
Branch: androidx-master-dev
commit 4734bc39cf00d0cec42e87e64bb54ebd14c33bc3
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Mar 18 09:20:23 2020
Ensure onRestoreInstanceState gets called after setContentView
If setContentView is called after the state of a DialogFragment is
restored, that state is essentially erased. We should ensure that
onRestoreInstanceState is always called after we setContentView.
This change moves the saving and restoring of the dialogState to the
onViewStateRestored method.
Test: updated dialogFragmentTest
Bug: 151652127
Change-Id: If81709abc50ab78a7b6f4ab25eb20be432cb51d5
M fragment/fragment/src/androidTest/java/androidx/fragment/app/DialogFragmentTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/DialogFragment.java
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.