Status Update
Comments
hu...@google.com <hu...@google.com>
[Deleted User] <[Deleted User]> #2
Jeremy, is this still an issue? I think the problem was that you had two transitions targeting the same View for the same action (e.g. two Slide() transitions).
do...@google.com <do...@google.com> #3
I have a similar issue with plain AnimatorSet:
set.start()
set.pause()
set.setCurrentPlayTime(100)
set.setCurrentPlayTime(0)
set.setCurrentPlayTime(100)
set.resume()
doesn't play animation in resume().
sa...@peilicke.de <sa...@peilicke.de> #4
Should clarify that if I filter out setCurrentPlayTime(0)
(or replace it with setCurrentPlayTime(1)
) it works well.
Also even with setCurrentPlayTime(0)
, onAnimationEnd
is notified with correct delay (as if the animation has played).
ya...@lightricks.com <ya...@lightricks.com> #5
@
I think that is intended for Animator. If you set the currentPlayTime
to 0 or the total duration the animator completes. We do some
hu...@google.com <hu...@google.com>
an...@gmail.com <an...@gmail.com> #6
Did some investigation on the Fragment side and it seems like the merged transition is targeting correctly.
Exiting Transition: Slide@aa9288e: tgts(android.widget.LinearLayout{f9add3d})
>>>>> ExitingViews <<<<<
View: android.widget.LinearLayout{f9add3d}
Entering Transition: Slide@35b8af: tgts(android.widget.LinearLayout{b7f24bc})
>>>>> EnteringViews <<<<<
View: android.widget.LinearLayout{b7f24bc}
Final merged transition: TransitionSet@7bc1c45:
TransitionSet@e133f9a:
Slide@aa9288e: tgts(android.widget.LinearLayout{f9add3d})
Slide@35b8af: tgts(android.widget.LinearLayout{b7f24bc})
merged transition passed to controlDelayedTransition: TransitionSet@7bc1c45:
TransitionSet@e133f9a:
Slide@aa9288e: tgts(android.widget.LinearLayout{f9add3d})
Slide@35b8af: tgts(android.widget.LinearLayout{b7f24bc})
Still digging.
np...@platformscience.com <np...@platformscience.com> #7
Branch: androidx-main
commit 567b7459329d1ec8d27a8c6fe1c4a86442065d7d
Author: Jeremy Woods <jbwoods@google.com>
Date: Tue Sep 26 20:06:54 2023
Add additional logging for transitions
Adding more debug logging in transitions to track the entering and
exiting transitions as well as the final merged transition and its
targets.
Test: added logging
Bug: 300157785
Change-Id: I0d9ad72b865422493c6c895ddb6115abf85eed16
M fragment/fragment/src/main/java/androidx/fragment/app/DefaultSpecialEffectsController.kt
st...@gmail.com <st...@gmail.com> #8
So I have isolated this outside of fragment into something much simpler and I think it breaks down when it comes to the adding and removing of Views with animateToStart.
The attached sample is a simple add that goes between two screens BLUE
and GREEN
. It has code for both the 1.5.0-alpha03
and 1.5.0-alpha04
versions, but I think alpha04 is currently broken in another way so I will upload the alpha03 version here.
This is integrated with predictive back similar to how fragment is, so upon cancelling we call animateToStart
, then we do a beginDelayedTransition
on a 0
duration Fade()
and we reverse the view visibility back to what it was prior to starting the transition.
If you only do visibility, cancel always works the view never goes away, it is wonderful, but when you do adding and removing views like we need to in fragment it fails.
First the code for beginDelayedTransition goes from this:
TransitionManager.beginDelayedTransition(container, Fade().apply {
duration = 0
})
reverseViews()
to this:
TransitionManager.beginDelayedTransition(container, Fade().apply {
duration = 0
addListener(onEnd = {
reverseViews()
blueScreen.visibility = View.VISIBLE
greenScreen.visibility = View.VISIBLE
})
})
reverseViews(useVisibility = true)
We need to make this change because after the animateToStart()
view is still parented by the overlay, so we call reverseViews(useVisibility = true)
to only change the visibility and then once the transition finishes we can call reverseViews()
to parent the view properly, then we make both views visible again.
From our perspective after the 0
duration transition our views are back in the proper state, but they do not transition properly after a cancel.
If the app is doing this wrong and we can make the appropriate fixes, doing the same in fragment should resolve this. There is logging available that shows the state of the views when we start the transition.
do...@gmail.com <do...@gmail.com> #9
The API has changed since that project was created in a way that makes the API more robust. I'm hoping that has fixed this...
al...@gmail.com <al...@gmail.com> #10
There appears to be a problem with the order of operations. I'm going to look into fixing that.
st...@gmail.com <st...@gmail.com> #11
Branch: androidx-main
commit e57dd5f9ac6cbb8cf83b221e2d5b3fbd3e88ce6b
Author: George Mount <mount@google.com>
Date: Thu Nov 09 14:33:53 2023
Fix animateToStart with Slide.
Fixes: 300157785
Slide was not repositioning the View to its proper
translation after animating it to the start position.
This fixes that so that it is moved.
Test: new test
Change-Id: I698f4dbcef46304f9aa545847d205f7b70c80d63
M transition/transition/src/androidTest/java/androidx/transition/SlideEdgeTest.java
M transition/transition/src/androidTest/java/androidx/transition/TranslationAnimationCreatorTest.java
M transition/transition/src/main/java/androidx/transition/TranslationAnimationCreator.java
fe...@gmail.com <fe...@gmail.com> #12
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.transition:transition:1.5.0-alpha05
ri...@gmail.com <ri...@gmail.com> #13
ma...@gmail.com <ma...@gmail.com> #14
at...@adobe.com <at...@adobe.com> #15
Any update would be appreciated :)
ad...@gmail.com <ad...@gmail.com> #16
For a bit of context: The androidx.fragment:fragment-testing
library declares an activity named androidx.fragment.app.testing.FragmentScenario$EmptyFragmentActivity
in its AndroidManifest.xml
file. The problem is that activities defined in a project's androidTest/AndroidManifest.xml
file or in the AndroidManifest.xml
file of any of the project's androidTestImplementation
dependencies are not merged into the project's main AndroidManifest.xml
file and therefore not available for use in the instrumentation tests. This, I believe, is the reason why the androidx.fragment:fragment-testing
library has to be declared as a debugImplementation
dependency instead of an androidTestImplementation
dependency.
It would be great if Android testing offered a way for manifest entries defined in the project's androidTest/AndroidManifest.xml
file or in the AndroidManifest.xml
file of any of the project's androidTestImplementation
dependencies were available for use in the instrumentation tests.
gs...@gmail.com <gs...@gmail.com> #17
androidTestImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.0-RC2")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.0-RC2")
jb...@google.com <jb...@google.com> #18
Unfortunately, there is nothing we can do about this. And modifying for test code will continue to be required.
br...@google.com <br...@google.com> #19
Could a separate fragment-testing-manifest artifact be shipped that only defines the Activity manifest entries? That way only the manifest get merged into non test code, and not fragment-testing and all its test dependencies like androidx.test.core.
This is how we worked around similar issues in androidx.test.core
I'd be willing to take this on if the androidx.fragment maintainers agree with this approach.
br...@google.com <br...@google.com> #20
br...@google.com <br...@google.com>
ap...@google.com <ap...@google.com> #21
Branch: androidx-main
commit 0292adb761d98ea08aa7ecfb46763e58d7c3df48
Author: Brett Chabot <brettchabot@google.com>
Date: Tue Nov 15 15:04:55 2022
Add a fragment-testing-manifest artifact.
FragmentScenario makes use of empty fixture activities, which need
to defined in the instrumentation test's targetPackage. Thus currently users need to build in
fragment-testing, with all of its other androidx.test dependencies into
their 'implementation' targets in order to use FragmentScenario. This
commonly causes conflicts due to version skew between fragment-testing
and androidx.test.
This change follows the compose ui-test-manfest pattern of creating a
separate fragment-testing-manifest artifact that just defines the
fixture activity + manifest entries.
Now users can do:
```
debugImplementation("androidx.fragment:fragment-testing-manifest:X.Y.Z")
androidTestImplementation("androidx.fragment:fragment-testing:X.Y.Z")
```
Relnote: Add fragment-testing-manifest artifact.
Bug: 128612536
Test: ran fragment,fragment-testing,fragment:integration-tests
Change-Id: I8e534e2fcab467a43944b6ab4821dc34c1c02cef
A fragment/fragment-testing-manifest-lint/OWNERS
A fragment/fragment-testing-manifest-lint/build.gradle
A fragment/fragment-testing-manifest-lint/src/main/java/androidx/fragment/testing/manifest/lint/FragmentTestingManifestIssueRegistry.kt
A fragment/fragment-testing-manifest-lint/src/main/java/androidx/fragment/testing/manifest/lint/GradleConfigurationDetector.kt
A fragment/fragment-testing-manifest-lint/src/main/resources/META-INF/services/com.android.tools.lint.client.api.IssueRegistry
A fragment/fragment-testing-manifest-lint/src/test/java/androidx/fragment/testing/manifest/lint/ApiLintVersionsTest.kt
A fragment/fragment-testing-manifest-lint/src/test/java/androidx/fragment/testing/manifest/lint/GradleConfigurationDetectorTest.kt
A fragment/fragment-testing-manifest/api/current.txt
A fragment/fragment-testing-manifest/api/public_plus_experimental_current.txt
A fragment/fragment-testing-manifest/api/res-current.txt
A fragment/fragment-testing-manifest/api/restricted_current.txt
A fragment/fragment-testing-manifest/build.gradle
A fragment/fragment-testing-manifest/src/main/AndroidManifest.xml
A fragment/fragment-testing-manifest/src/main/java/androidx/fragment/app/testing/EmptyFragmentActivity.kt
A fragment/fragment-testing-manifest/src/main/java/androidx/fragment/app/testing/FragmentFactoryHolderViewModel.kt
M fragment/fragment-testing-manifest/src/main/res/values/styles.xml
M fragment/fragment-testing/build.gradle
M fragment/fragment-testing/src/main/AndroidManifest.xml
M fragment/fragment-testing/src/main/java/androidx/fragment/app/testing/FragmentScenario.kt
M fragment/integration-tests/testapp/build.gradle
A fragment/integration-tests/testapp/src/androidTest/java/androidx/fragment/testapp/SimpleFragmentTest.kt
A fragment/integration-tests/testapp/src/main/java/androidx/fragment/testapp/SimpleFragment.kt
A fragment/integration-tests/testapp/src/main/res/layout/simple_fragment.xml
M settings.gradle
br...@google.com <br...@google.com>
il...@google.com <il...@google.com> #22
In Fragment 1.6.0-alpha04, we've added a new fragment-testing-manifest
artifact. This means that instead of adding fragment-testing
as a debugImplementation
, you can now instead add fragment-testing-manifest
as a debugImplementation
and keep fragment-testing
as androidTestImplementation
.
debugImplementation "androidx.fragment:fragment-testing-manifest:$fragment_version"
androidTestImplementation "androidx.fragment:fragment-testing:$fragment_version"
ju...@google.com <ju...@google.com> #23
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.fragment:fragment-testing:1.6.0-alpha04
ba...@gmail.com <ba...@gmail.com> #24
debugImplementation "androidx.test:monitor:1.6.1"
debugImplementation("androidx.fragment:fragment-ktx:1.6.0-alpha04")
debugImplementation 'androidx.test:core-ktx:1.5.0'
debugImplementation 'androidx.test:rules:1.5.0'
debugImplementation 'androidx.test:runner:1.5.2'
debugImplementation("androidx.fragment:fragment-testing-manifest:1.6.0-alpha04")
androidTestImplementation("androidx.fragment:fragment-testing:1.6.0-alpha04")
ba...@gmail.com <ba...@gmail.com> #25
jb...@google.com <jb...@google.com> #26
Please file a new bug with a minimal project that reproduces the issue.
Description
The reason of this limitation is that activities defined in test APK run in different process from the target process (unless you set sharedUserId). FragmentScenario uses EmptyFragmentActivity as the host Activity and it is defined in the library's manifest. In order to start EmptyFragmentActivity in the target app process, the manifest needs to be merged into the target APK.
This thread is to track the progress of removing this limitation.