Fixed
Status Update
Comments
il...@google.com <il...@google.com>
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
jb...@google.com <jb...@google.com> #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
ap...@google.com <ap...@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
il...@google.com <il...@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
Description
When using the new state manager released in fragment 1.3.0-alpha08, if you manually (without using the hide/show fragment transactions) set the visibility state of your view after the SpecialEffectsController has started any animations/transitions on your view, the visibility changes are ignored.
The reason this happens is because the new state manager saves the visibility state of the view in
onViewCreated()
as the final state and then restores that visibility state once the special effect completes afteronStart()
. This means that any changes made by the user to the view visibility state betweenonViewCreate()
andonStart()
are completely ignored.This becomes apparent in two particular cases:
There is a fragment that is always added, but has its visibility state updated based on some internal data (i.e. an error screen that is set to
View.INVISIBLE
when there is no error andView.VISIBLE
when there is one). If the view state changes toINVISIBLE
inonStart()
, the fragment should not be shown once the add transaction completes.A entering fragment is postponed and while it is postponed, its view visibility state is set to
View.INVISIBLE
. Even once the fragment is no longer postponed, its view should still beINVISIBLE
until the user changes it again manually.The new state manager should defer view visibility state control to the user no matter when the state is changed. Doing so would ensure that the user always has the source of truth for their Fragment's view visibility.