Fixed
Status Update
Comments
jb...@google.com <jb...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit a071470cde57cf7eb6e39a67d331d716a0f8b842
Author: Ian Lake <ilake@google.com>
Date: Wed Jan 15 14:01:37 2020
Add SpecialEffectsController infrastructure
"Special Effects" is the blanket term for
Animation, Animator, framework Transition, and
AndroidX Transition that Fragments currently support.
Add the infrastructure around a SpecialEffectsController
which would operate on the container (i.e., ViewGroup)
level and coordinate all of the special effects.
This will eventually allow us to track the
postponed state at the container level.
Currently all APIs are purposefully package private
as they should not be used by external developers
at this time.
BUG: 147749580
Test: new test suites pass
Change-Id: I1e209bb4f55c21aa01afb49035d41f5b8d7d3eca
A fragment/fragment/src/androidTest/java/androidx/fragment/app/DefaultSpecialEffectsControllerTest.kt
A fragment/fragment/src/androidTest/java/androidx/fragment/app/SpecialEffectsControllerTest.kt
A fragment/fragment/src/main/java/androidx/fragment/app/DefaultSpecialEffectsController.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentManager.java
A fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsController.java
A fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsControllerFactory.java
M fragment/fragment/src/main/res/values/ids.xml
M jetifier/jetifier/migration.config
https://android-review.googlesource.com/1209367
Branch: androidx-master-dev
commit a071470cde57cf7eb6e39a67d331d716a0f8b842
Author: Ian Lake <ilake@google.com>
Date: Wed Jan 15 14:01:37 2020
Add SpecialEffectsController infrastructure
"Special Effects" is the blanket term for
Animation, Animator, framework Transition, and
AndroidX Transition that Fragments currently support.
Add the infrastructure around a SpecialEffectsController
which would operate on the container (i.e., ViewGroup)
level and coordinate all of the special effects.
This will eventually allow us to track the
postponed state at the container level.
Currently all APIs are purposefully package private
as they should not be used by external developers
at this time.
BUG: 147749580
Test: new test suites pass
Change-Id: I1e209bb4f55c21aa01afb49035d41f5b8d7d3eca
A fragment/fragment/src/androidTest/java/androidx/fragment/app/DefaultSpecialEffectsControllerTest.kt
A fragment/fragment/src/androidTest/java/androidx/fragment/app/SpecialEffectsControllerTest.kt
A fragment/fragment/src/main/java/androidx/fragment/app/DefaultSpecialEffectsController.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentManager.java
A fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsController.java
A fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsControllerFactory.java
M fragment/fragment/src/main/res/values/ids.xml
M jetifier/jetifier/migration.config
[Deleted User] <[Deleted User]> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit d990bffa6728272e139e1b5d58e764e9197b1adc
Author: Ian Lake <ilake@google.com>
Date: Thu Jan 16 14:05:14 2020
Find the appropriate SpecialEffectsControllerFactory
Instead of requiring each call to
getOrCreateController() require passing in the
factory, use findFragmentManager() to find the
containing FragmentManager and get the factory from
it.
Test: new test passes
BUG: 147749580
Change-Id: I44f747ba84feb2911a8d0811e40d1b46644429a5
M fragment/fragment/src/androidTest/java/androidx/fragment/app/DefaultSpecialEffectsControllerTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsController.java
https://android-review.googlesource.com/1210675
Branch: androidx-master-dev
commit d990bffa6728272e139e1b5d58e764e9197b1adc
Author: Ian Lake <ilake@google.com>
Date: Thu Jan 16 14:05:14 2020
Find the appropriate SpecialEffectsControllerFactory
Instead of requiring each call to
getOrCreateController() require passing in the
factory, use findFragmentManager() to find the
containing FragmentManager and get the factory from
it.
Test: new test passes
BUG: 147749580
Change-Id: I44f747ba84feb2911a8d0811e40d1b46644429a5
M fragment/fragment/src/androidTest/java/androidx/fragment/app/DefaultSpecialEffectsControllerTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsController.java
il...@google.com <il...@google.com>
jb...@google.com <jb...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 62e13263d9ee368a255cfb7db73eba061ca85f9c
Author: Ian Lake <ilake@google.com>
Date: Fri Jan 17 13:09:12 2020
Allow cancellation of special effects operations
Pipe through a CancellationSignal to Operation
so that a SpecialEffectsController can handle
cancellation.
Test: new test passes
BUG: 147749580
Change-Id: Iff9525a3d3e079a3b0b6818e43e6efdb16207a7a
M fragment/fragment/src/androidTest/java/androidx/fragment/app/SpecialEffectsControllerTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentStateManager.java
M fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsController.java
https://android-review.googlesource.com/1212445
Branch: androidx-master-dev
commit 62e13263d9ee368a255cfb7db73eba061ca85f9c
Author: Ian Lake <ilake@google.com>
Date: Fri Jan 17 13:09:12 2020
Allow cancellation of special effects operations
Pipe through a CancellationSignal to Operation
so that a SpecialEffectsController can handle
cancellation.
Test: new test passes
BUG: 147749580
Change-Id: Iff9525a3d3e079a3b0b6818e43e6efdb16207a7a
M fragment/fragment/src/androidTest/java/androidx/fragment/app/SpecialEffectsControllerTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentStateManager.java
M fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsController.java
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 9ea0884726565254629ff5c99ec919f56e0af1d9
Author: Ian Lake <ilake@google.com>
Date: Fri Jan 17 11:09:14 2020
Allow enqueuing special effects operations
Build the initial infrastructure for enqueuing
ADD and REMOVE operations to a SpecialEffectsController.
This currently doesn't change any runtime behavior
since DefaultSpecialEffectsController doesn't actually
do anything and FragmentStateManager isn't used to
move Fragments beyond CREATED with moveToExpectedState()
in production code.
Cancellation will be handled in a follow up CL.
Test: new SpecialEffectsControllerTest tests pass
BUG: 147749580
Change-Id: I6a3009de80419fd878f2f838bf8e234c20b933ae
M fragment/fragment/src/androidTest/java/androidx/fragment/app/SpecialEffectsControllerTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/DefaultSpecialEffectsController.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentManager.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentStateManager.java
M fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsController.java
https://android-review.googlesource.com/1212444
Branch: androidx-master-dev
commit 9ea0884726565254629ff5c99ec919f56e0af1d9
Author: Ian Lake <ilake@google.com>
Date: Fri Jan 17 11:09:14 2020
Allow enqueuing special effects operations
Build the initial infrastructure for enqueuing
ADD and REMOVE operations to a SpecialEffectsController.
This currently doesn't change any runtime behavior
since DefaultSpecialEffectsController doesn't actually
do anything and FragmentStateManager isn't used to
move Fragments beyond CREATED with moveToExpectedState()
in production code.
Cancellation will be handled in a follow up CL.
Test: new SpecialEffectsControllerTest tests pass
BUG: 147749580
Change-Id: I6a3009de80419fd878f2f838bf8e234c20b933ae
M fragment/fragment/src/androidTest/java/androidx/fragment/app/SpecialEffectsControllerTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/DefaultSpecialEffectsController.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentManager.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentStateManager.java
M fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsController.java
il...@google.com <il...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-master-dev
commit d67221893efc073415220d4d3635f159e728b905
Author: Ian Lake <ilake@google.com>
Date: Tue Jan 21 16:49:50 2020
Add isAwaitingCompletion() API
Build the infrastructure for allowing the
FragmentStateManager to check whether a
SpecialEffectsController is still awaiting
completion of queued up / executing
operations.
Test: updated tests to call new API
BUG: 147749580
Change-Id: I6ebd563c505dc2e7b65ced4932316986c478a8cf
M fragment/fragment/src/androidTest/java/androidx/fragment/app/SpecialEffectsControllerTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsController.java
https://android-review.googlesource.com/1214213
Branch: androidx-master-dev
commit d67221893efc073415220d4d3635f159e728b905
Author: Ian Lake <ilake@google.com>
Date: Tue Jan 21 16:49:50 2020
Add isAwaitingCompletion() API
Build the infrastructure for allowing the
FragmentStateManager to check whether a
SpecialEffectsController is still awaiting
completion of queued up / executing
operations.
Test: updated tests to call new API
BUG: 147749580
Change-Id: I6ebd563c505dc2e7b65ced4932316986c478a8cf
M fragment/fragment/src/androidTest/java/androidx/fragment/app/SpecialEffectsControllerTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsController.java
pr...@google.com <pr...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 974d9e0f0f1ca4108fa653302c239f9025dcd0d9
Author: Ian Lake <ilake@google.com>
Date: Fri Feb 07 15:46:17 2020
Add animations to DefaultSpecialEffectsController
Build the base for running Animations / Animators
in DefaultSpecialEffectsController, correctly only
calling complete() when they finish.
Test: visual inspection, comparing the code to the existing code
BUG: 147749580
Change-Id: Ib0eaeb34bfac7ca5e32b3feea9a2730388dcfd60
M fragment/fragment/src/main/java/androidx/fragment/app/DefaultSpecialEffectsController.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentAnim.java
https://android-review.googlesource.com/1230307
Branch: androidx-master-dev
commit 974d9e0f0f1ca4108fa653302c239f9025dcd0d9
Author: Ian Lake <ilake@google.com>
Date: Fri Feb 07 15:46:17 2020
Add animations to DefaultSpecialEffectsController
Build the base for running Animations / Animators
in DefaultSpecialEffectsController, correctly only
calling complete() when they finish.
Test: visual inspection, comparing the code to the existing code
BUG: 147749580
Change-Id: Ib0eaeb34bfac7ca5e32b3feea9a2730388dcfd60
M fragment/fragment/src/main/java/androidx/fragment/app/DefaultSpecialEffectsController.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentAnim.java
an...@daresay.co <an...@daresay.co> #8
Comment has been deleted.
li...@gmail.com <li...@gmail.com> #9
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 9c458049e7543914de98760102017b10dd04068e
Author: Ian Lake <ilake@google.com>
Date: Tue Feb 18 12:57:03 2020
Add cancelAllOperations() to SpecialEffectsController
Provide an API for cancelling all operations
(both pending and being executed) for a
SpecialEffectsController.
Test: new tests pass
BUG: 147749580
Change-Id: Id90f270869470bd44d73163a84343cf2cda3cd47
M fragment/fragment/src/androidTest/java/androidx/fragment/app/SpecialEffectsControllerTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsController.java
https://android-review.googlesource.com/1238926
Branch: androidx-master-dev
commit 9c458049e7543914de98760102017b10dd04068e
Author: Ian Lake <ilake@google.com>
Date: Tue Feb 18 12:57:03 2020
Add cancelAllOperations() to SpecialEffectsController
Provide an API for cancelling all operations
(both pending and being executed) for a
SpecialEffectsController.
Test: new tests pass
BUG: 147749580
Change-Id: Id90f270869470bd44d73163a84343cf2cda3cd47
M fragment/fragment/src/androidTest/java/androidx/fragment/app/SpecialEffectsControllerTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsController.java
ho...@gmail.com <ho...@gmail.com> #10
Comment has been deleted.
ho...@gmail.com <ho...@gmail.com> #11
Comment has been deleted.
ho...@gmail.com <ho...@gmail.com> #12
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 5a7e88f9d605f0a735d922e73463d1c603683e22
Author: Ian Lake <ilake@google.com>
Date: Thu Mar 05 16:02:57 2020
Don't call postpone when using FragmentStateManager
Avoid calling through to postponePostponableTransactions
at all when USE_STATE_MANAGER is true as it will
be responsible for taking care of postponement in
the future.
Tightened up the state management in FragmentStateManager
to avoid crashes in the test suite due to bad
transitions between states.
Test: all tests pass with USE_STATE_MANAGER=false
Test: test suite doesn't crash with USE_STATE_MANAGER=true
BUG: 147749580
Change-Id: I6ff2c3fbe325c82ea5e33dd5c0cb07c908bbd613
M fragment/fragment/src/main/java/androidx/fragment/app/Fragment.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentManager.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentStateManager.java
https://android-review.googlesource.com/1252296
Branch: androidx-master-dev
commit 5a7e88f9d605f0a735d922e73463d1c603683e22
Author: Ian Lake <ilake@google.com>
Date: Thu Mar 05 16:02:57 2020
Don't call postpone when using FragmentStateManager
Avoid calling through to postponePostponableTransactions
at all when USE_STATE_MANAGER is true as it will
be responsible for taking care of postponement in
the future.
Tightened up the state management in FragmentStateManager
to avoid crashes in the test suite due to bad
transitions between states.
Test: all tests pass with USE_STATE_MANAGER=false
Test: test suite doesn't crash with USE_STATE_MANAGER=true
BUG: 147749580
Change-Id: I6ff2c3fbe325c82ea5e33dd5c0cb07c908bbd613
M fragment/fragment/src/main/java/androidx/fragment/app/Fragment.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentManager.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentStateManager.java
gi...@gmail.com <gi...@gmail.com> #13
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 20090a3bd0d8392a165f56b3a9da4efd1a86875c
Author: Ian Lake <ilake@google.com>
Date: Mon Mar 09 15:04:48 2020
Start transitions before starting animations
Ensure that transitions start before animations
so that they properly capture the current state.
Test: existing tests pass
BUG: 147749580
Change-Id: Icc5bfae9b60554225307dadb278d7c2700527dfd
M fragment/fragment/src/main/java/androidx/fragment/app/DefaultSpecialEffectsController.java
https://android-review.googlesource.com/1253639
Branch: androidx-master-dev
commit 20090a3bd0d8392a165f56b3a9da4efd1a86875c
Author: Ian Lake <ilake@google.com>
Date: Mon Mar 09 15:04:48 2020
Start transitions before starting animations
Ensure that transitions start before animations
so that they properly capture the current state.
Test: existing tests pass
BUG: 147749580
Change-Id: Icc5bfae9b60554225307dadb278d7c2700527dfd
M fragment/fragment/src/main/java/androidx/fragment/app/DefaultSpecialEffectsController.java
va...@zedge.net <va...@zedge.net> #14
Project: platform/frameworks/support
Branch: androidx-master-dev
commit ea897029344b96b61a86de8a0607d307c281ab3d
Author: Ian Lake <ilake@google.com>
Date: Mon Mar 09 16:44:41 2020
Correctly add/remove view using SpecialEffectsController
Ensure that DefaultSpecialEffectsController
correctly applies shows the View or removes
the View based on the appropriate
operation type.
Test: existing tests pass
Test: more tests pass when using USE_STATE_MANAGER
BUG: 147749580
Change-Id: I5dc190adc85a357a74862e25567769575dd135ef
M fragment/fragment/src/main/java/androidx/fragment/app/DefaultSpecialEffectsController.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentStateManager.java
https://android-review.googlesource.com/1253010
Branch: androidx-master-dev
commit ea897029344b96b61a86de8a0607d307c281ab3d
Author: Ian Lake <ilake@google.com>
Date: Mon Mar 09 16:44:41 2020
Correctly add/remove view using SpecialEffectsController
Ensure that DefaultSpecialEffectsController
correctly applies shows the View or removes
the View based on the appropriate
operation type.
Test: existing tests pass
Test: more tests pass when using USE_STATE_MANAGER
BUG: 147749580
Change-Id: I5dc190adc85a357a74862e25567769575dd135ef
M fragment/fragment/src/main/java/androidx/fragment/app/DefaultSpecialEffectsController.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentStateManager.java
il...@google.com <il...@google.com> #15
Adding on to this, I get a `Trying to set a replacement startPostponedEnterTransition on {fragment}` when performing the following behavior:
Quickly open two (new) fragment instances of the same fragment, and exit/open them repeatedly. For example, via a double click, or simply calling a method that creates a fragment transaction to show the fragment twice. After opening/closing the said fragment several times, the exception will occur. I believe this has to do with the aforementioned issues with the FragmentManager getting into a unpredictable state.
Some extra things to be noted:
- I use `setReorderingAllowed(true)` and `replace` in the Fragment transaction
- I call `postponeEnterTransition()` in `onCreate` of the Fragment
- I call `startPostponedEnterTransition()` after `onViewCreated`, in the Observer of a LiveData. The LiveData's `setValue` is called before the fragment transaction, so it should be called as soon as the livedata observer is attached and observing.
- The Fragment that is being instantiated and opened twice is opened from another Fragment that follows the same steps, such that the stack looks like so: Fragment A is added, the user clicks on a button to open Fragment B, and two new instances of Fragment B are added to the stack.
Some notable behavior that occurs: After opening Fragment B, Fragment A and two instances of Fragment B are on the stack. Upon pressing the "back" button, all three fragments are "popped" from the stack. When setting `setReorderingAllowed(false)`, only one of the instances of Fragment B are popped from the stack, which is expected.
If there are any more details or clarity I can provide, let me know, as this is a bit of a strange/obscure bug.
Quickly open two (new) fragment instances of the same fragment, and exit/open them repeatedly. For example, via a double click, or simply calling a method that creates a fragment transaction to show the fragment twice. After opening/closing the said fragment several times, the exception will occur. I believe this has to do with the aforementioned issues with the FragmentManager getting into a unpredictable state.
Some extra things to be noted:
- I use `setReorderingAllowed(true)` and `replace` in the Fragment transaction
- I call `postponeEnterTransition()` in `onCreate` of the Fragment
- I call `startPostponedEnterTransition()` after `onViewCreated`, in the Observer of a LiveData. The LiveData's `setValue` is called before the fragment transaction, so it should be called as soon as the livedata observer is attached and observing.
- The Fragment that is being instantiated and opened twice is opened from another Fragment that follows the same steps, such that the stack looks like so: Fragment A is added, the user clicks on a button to open Fragment B, and two new instances of Fragment B are added to the stack.
Some notable behavior that occurs: After opening Fragment B, Fragment A and two instances of Fragment B are on the stack. Upon pressing the "back" button, all three fragments are "popped" from the stack. When setting `setReorderingAllowed(false)`, only one of the instances of Fragment B are popped from the stack, which is expected.
If there are any more details or clarity I can provide, let me know, as this is a bit of a strange/obscure bug.
ja...@gopuff.com <ja...@gopuff.com> #16
Re #15 - having a sample project that reproduces your issue would be very helpful in confirming that it no longer occurs in the new infrastructure.
ja...@sense.com <ja...@sense.com> #17
RE #16 - I can try to set up a new repo that reproduces that, although it may be a week or so until I have enough time to build it out.
Description
Versions
Component used: Navigation
Version used: 2.5.3
Devices/Android versions reproduced on: any
Description
According to the documentation of [BackHandler], nested BackHandlers(https://developer.android.com/reference/kotlin/androidx/activity/compose/package-summary#top-level-functions ) should take priority:
However, this doesn't work correctly if the activity is paused and then resumed.
Steps to reproduce
Code to demonstrate the issue
A sample project is attached.