Fixed
Status Update
Comments
il...@google.com <il...@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
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 161a33e17d95b4a7f8a14ac41352d79c9d459653
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Apr 07 10:17:04 2021
Ensure FragmentContainerView dispatches insets once
FragmentContainerView overrides onApplyWindowInsets() and dispatches new
insets to all children, but since it is a ViewGroup, and does not
consume the window insets, it makes a call to dispatchApplyWindowInsets
again. On this 2nd pass, if the first child consumes the WindowInsets,
all other children receive empty insets.
We should have FragmentContainerView override dispatchApplyWindowInsets
and dispatch them to the child views there.
RelNote: "When using `FragmentContainerView`, a new set of
`WindowInsets` are now dispatched to child views only once."
Test: modified windowInsetsDispatchToChildren test
Bug: 172153900
Change-Id: I63f685e6715334a77e477180ae94771eeef827c3
M fragment/fragment/build.gradle
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentContainerViewTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentContainerView.java
https://android-review.googlesource.com/1666194
Branch: androidx-main
commit 161a33e17d95b4a7f8a14ac41352d79c9d459653
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Apr 07 10:17:04 2021
Ensure FragmentContainerView dispatches insets once
FragmentContainerView overrides onApplyWindowInsets() and dispatches new
insets to all children, but since it is a ViewGroup, and does not
consume the window insets, it makes a call to dispatchApplyWindowInsets
again. On this 2nd pass, if the first child consumes the WindowInsets,
all other children receive empty insets.
We should have FragmentContainerView override dispatchApplyWindowInsets
and dispatch them to the child views there.
RelNote: "When using `FragmentContainerView`, a new set of
`WindowInsets` are now dispatched to child views only once."
Test: modified windowInsetsDispatchToChildren test
Bug: 172153900
Change-Id: I63f685e6715334a77e477180ae94771eeef827c3
M fragment/fragment/build.gradle
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentContainerViewTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentContainerView.java
jb...@google.com <jb...@google.com> #4
This has been fixed internally and will be available in the Fragment 1.3.0
release.
jb...@google.com <jb...@google.com> #5
Sorry about that, I meant Fragment 1.3.3
.
Description
Component used: Fragment Version used: 1.3.0-beta01
FragmentContainerView
overridesonApplyWindowInsets
and dispatches fresh copy ofWindowInsets
to all children correctly. But it does not consumeWindowInsets
and being aViewGroup
it then dispatches the insets again from theViewGroup.dispatchApplyWindowInsets
. As a result the insets are dispatched second time toFragmentContainerView
children, but this time incorrectly - e.g. if first child consumes system window insets, other children receive empty window insets.