Fixed
Status Update
Comments
il...@google.com <il...@google.com>
jb...@google.com <jb...@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
tj...@gmail.com <tj...@gmail.com> #3
The issue still persists using the snapshot with the build id provided
unfortunately.
>
unfortunately.
>
jb...@google.com <jb...@google.com> #4
You're right, I was testing the wrong thing, this is currently still broken with that build. Thank you for checking that.
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit e9d5770dd9324d14cce6b469277f8c55fa9821f4
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu Sep 17 00:12:29 2020
Ensure transitions with only shared elements end
In DefaultSpecialEffects controller if there is a fragment that has only
a sharedElementTransition it currently does not have a way to end.
DefaultSpecialEffects should check if the transitionInfo has a
sharedElement when it is looking to start transitions, and when checking
if a transition involves a shared element.
Relnote: "Fragments that only have a shared element transition now
properly complete their special effects meaning they actually move to
their final state"
Test: noSharedElementToSharedElementTest
Bug: 166658128
Change-Id: Iaebc76914b9c24968a2943c18911b183f9dd8a4f
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentTransitionTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/DefaultSpecialEffectsController.java
https://android-review.googlesource.com/1428822
Branch: androidx-master-dev
commit e9d5770dd9324d14cce6b469277f8c55fa9821f4
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu Sep 17 00:12:29 2020
Ensure transitions with only shared elements end
In DefaultSpecialEffects controller if there is a fragment that has only
a sharedElementTransition it currently does not have a way to end.
DefaultSpecialEffects should check if the transitionInfo has a
sharedElement when it is looking to start transitions, and when checking
if a transition involves a shared element.
Relnote: "Fragments that only have a shared element transition now
properly complete their special effects meaning they actually move to
their final state"
Test: noSharedElementToSharedElementTest
Bug: 166658128
Change-Id: Iaebc76914b9c24968a2943c18911b183f9dd8a4f
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentTransitionTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/DefaultSpecialEffectsController.java
jb...@google.com <jb...@google.com> #6
This should now be fixed.
You can verify this by following the 6847503
and switching your fragment dependency to 1.3.0-SNAPSHOT
.
tj...@gmail.com <tj...@gmail.com> #7
I'm sorry if I sound like a broken record, but the issue still seems to
persist when I test it with the sample repository provided:
onDestroyView is never called for Fragment 2 (DoggoPagerFragment), and when
I pop Fragment 3 (AdoptDoggoFragment) I'm met with the stale view from
Fragment 2
persist when I test it with the sample repository provided:
onDestroyView is never called for Fragment 2 (DoggoPagerFragment), and when
I pop Fragment 3 (AdoptDoggoFragment) I'm met with the stale view from
Fragment 2
jb...@google.com <jb...@google.com> #8
You're seeing it still broken with build id 6847503
? (i.e. maven { url 'https://androidx.dev/snapshots/builds/6847503/artifacts/repository' }
added to your repository?)
tj...@gmail.com <tj...@gmail.com> #9
Oh my apologies! It persisted because I updated the fragment dependency to
androidx.fragment:fragment:1.3.0-SNAPSHOT, but forgot to update the ktx
extensions to androidx.fragment:fragment-ktx:1.3.0-SNAPSHOT.
Updating both fixes it, sorry about the false alarm and thanks for the fix!
>
androidx.fragment:fragment:1.3.0-SNAPSHOT, but forgot to update the ktx
extensions to androidx.fragment:fragment-ktx:1.3.0-SNAPSHOT.
Updating both fixes it, sorry about the false alarm and thanks for the fix!
>
Description
Component used: Fragment Version used: 1.3.0-alpha08 Devices/Android versions reproduced on: Emulator / Pixel 3
If this is a bug in the library, we would appreciate if you could attach:
I have a sequence of 3 Fragments that use shared element transitions, and use
postponeEnterTransition()
on all of them.Everything is great when I go from Fragments 1 -> 2 -> 3. However, when I pop from 3 -> 2, the onCreateView and onViewCreated methods are skipped. onStart and onResume are called however. What's worse, after popping, I see the old view instance for Fragment 2 that should have been destroyed when I move to Fragment 3. OnDestroyView is also never called for Fragment 2 at all.
Repository with reproducing code:https://github.com/tunjid/Android-Extensions/tree/feature/fragment-1.3.0
Fragment 1 -> DoggoListFragment Fragment 2 -> DoggoPagerFragment Fragment 3 -> AdoptDoggoFragment