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-master-dev
commit 0462776cb6ba10f9fcba978bbfaaf0e45513f849
Author: Ian Lake <ilake@google.com>
Date: Fri Mar 20 16:59:21 2020
Avoid destroying the target fragment's view too early
When using setReorderingAllowed(true) with a replace
operation that has the incoming fragment with a target
fragment of the outgoing fragment, the new fragment
goes through attach() before transitions are started.
Unconditionally calling moveToExpectedState() when
USE_STATE_MANAGER is false will move the target (i.e.,
the first fragment) all the way down to CREATED since
it is no longer added.
By checking the target's fragment state, we maintain
the guarantee that the target fragment is at least
created when the other fragment is attached without
moving the state downward.
This doesn't affect the USE_STATE_MANAGER case since
the expected state will be AWAITING_EXIT_EFFECTS and
the view won't be destroyed.
Test: new FragmentTransitionTest test
BUG: 152023196
Change-Id: I41f2f8cf3f0a33e846be91f0356adb197be9a386
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentTransitionTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentStateManager.java
https://android-review.googlesource.com/1264501
Branch: androidx-master-dev
commit 0462776cb6ba10f9fcba978bbfaaf0e45513f849
Author: Ian Lake <ilake@google.com>
Date: Fri Mar 20 16:59:21 2020
Avoid destroying the target fragment's view too early
When using setReorderingAllowed(true) with a replace
operation that has the incoming fragment with a target
fragment of the outgoing fragment, the new fragment
goes through attach() before transitions are started.
Unconditionally calling moveToExpectedState() when
USE_STATE_MANAGER is false will move the target (i.e.,
the first fragment) all the way down to CREATED since
it is no longer added.
By checking the target's fragment state, we maintain
the guarantee that the target fragment is at least
created when the other fragment is attached without
moving the state downward.
This doesn't affect the USE_STATE_MANAGER case since
the expected state will be AWAITING_EXIT_EFFECTS and
the view won't be destroyed.
Test: new FragmentTransitionTest test
BUG: 152023196
Change-Id: I41f2f8cf3f0a33e846be91f0356adb197be9a386
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentTransitionTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentStateManager.java
il...@google.com <il...@google.com> #4
We've added a fix and it'll be available in Fragment 1.3.0-alpha03
Description
Version used: 1.3.0-alpha02
Theme used: Theme.AppCompat.Light.DarkActionBar
Devices/Android versions reproduced on: Google Pixel 4 XL, Android 10 (API 29)
An otherwise working shared element fragment transition will stop working (i.e. not run at all) if `setTargetFragment` is called before. This does not happen when using version 1.2.3
See the sample project for a repro case