Status Update
Comments
il...@google.com <il...@google.com> #2
sa...@gmail.com <sa...@gmail.com> #3
ch...@google.com <ch...@google.com> #4
ki...@gmail.com <ki...@gmail.com> #5
at com.android.tools.idea.run.editor.DeployTargetPickerDialog.<init>(DeployTargetPickerDialog.java:144)
at com.android.tools.idea.run.editor.ShowChooserTargetProvider.showPrompt(ShowChooserTargetProvider.java:113)
at com.android.tools.idea.run.AndroidRunConfigurationBase.getDeployTarget(AndroidRunConfigurationBase.java:600)
at com.android.tools.idea.run.AndroidRunConfigurationBase.doGetState(AndroidRunConfigurationBase.java:281)
at com.android.tools.idea.run.AndroidRunConfigurationBase.getState(AndroidRunConfigurationBase.java:241)
at com.intellij.execution.runners.ExecutionEnvironment.getState(ExecutionEnvironment.java:158)
at com.intellij.execution.runners.BaseProgramRunner.execute(BaseProgramRunner.java:55)
at com.intellij.execution.runners.BaseProgramRunner.execute(BaseProgramRunner.java:50)
at com.intellij.execution.ProgramRunnerUtil.executeConfigurationAsync(ProgramRunnerUtil.java:92)
at com.intellij.execution.ProgramRunnerUtil.executeConfiguration(ProgramRunnerUtil.java:41)
at com.intellij.execution.impl.ExecutionManagerImpl.restart(ExecutionManagerImpl.java:93)
at com.intellij.execution.impl.ExecutionManagerImpl.access$300(ExecutionManagerImpl.java:44)
at com.intellij.execution.impl.ExecutionManagerImpl$3.run(ExecutionManagerImpl.java:442)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:232)
at com.intellij.util.Alarm$Request.runSafely(Alarm.java:356)
at com.intellij.util.Alarm$Request.run(Alarm.java:343)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:228)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:315)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:435)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:419)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:403)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
at java.awt.EventQueue.access$500(EventQueue.java:98)
at java.awt.EventQueue$3.run(EventQueue.java:715)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:755)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:704)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:391)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
il...@google.com <il...@google.com> #6
ki...@gmail.com <ki...@gmail.com> #7
ap...@google.com <ap...@google.com> #8
Branch: androidx-master-dev
commit 374e0ca1083b40cceb683014c549b0921eeda68b
Author: Ian Lake <ilake@google.com>
Date: Mon Sep 14 12:40:18 2020
Avoid usages of AnimationSet for entering Animations
Adding an AnimationSet within an AnimationSet leads to
visual artifacts when used with entering Animations
due to how AnimationSet is implemented - something
that Fragments cannot control.
While we can't control developers using a <set> within
a <set> in their own Animation XML, our usage of
an additional AnimationSet meant that even a single
<set> in XML was enough to trigger the visual artifacts
and blinking.
By removing our AnimationSet, we lose the ability to
properly complete the special effect when the Animation
ends, but because that is the existing behavior of
Fragments, this is probably the best we can do while
1) maintaining the ability to use Animations
2) Avoiding visual artifacts
Test: existing tests pass, tested in sample apps
BUG: 163084315
Change-Id: Ie17af24c3920bb097cfc90fba6ca55e0cd7199ff
M fragment/fragment/src/main/java/androidx/fragment/app/DefaultSpecialEffectsController.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentAnim.java
il...@google.com <il...@google.com> #9
Bad news: Nested AnimationSet
instances are broken at a fundamental layer that Fragments can't work around. We strongly recommend switching to Animator
or AndroidX Transition
and are doing that internally in
Good news: We're reverting to the equivalent behavior of the old state manager in that we won't use an additional layer of AnimationSet
for entering Animations. This means that unlike Animators or Transitions, a Fragment using Animation
will immediately move to RESUMED
before the Animation
completes when using the new state manager.
g....@gmail.com <g....@gmail.com> #10
The only reason why I'm using Animation
is that I need to use percent values, as in the animation of FragmentTransaction
(and by extension Navigation
) only accepts @AnimatorRes
and @AnimRes
, I can't create the animation programmatically.
Is there any alternative to Animation
in this case?
il...@google.com <il...@google.com> #11
Re #10 - note that even when you do not pass a resource ID, you can still override onCreateAnimation()
or onCreateAnimator()
on your Fragment and return any custom Animation
or Animator
you want - there is no requirement that you only use Animations/Animators inflated from XML when using Fragments (and by extension, when using Navigation).
g....@gmail.com <g....@gmail.com> #12
Thank you, that does the trick. I even used to patch animations on the fly before you fixed all the issues I had with FragmentContainerView
, how could not I think of doing that.
For those reading that might be in a similar situation:
I have few animations that I use throughout the applications and they are all defined in the actions of the navigation graph. Since I have a common base Fragment class, I added something like the following to that base class (using the animation in
@Nullable
@Override
public Animator onCreateAnimator(int transit, boolean enter, int nextAnim) {
if (nextAnim == R.anim.transition_slide_left_show) {
int width = requireActivity().getWindow().getDecorView().getWidth();
ObjectAnimator anim = ObjectAnimator.ofFloat(getView(), View.TRANSLATION_X, -width, 0);
anim.setStartDelay(300);
anim.setDuration(300);
anim.setInterpolator(new DecelerateInterpolator());
return anim;
} else {
return super.onCreateAnimator(transit, enter, nextAnim);
}
}
This is probably not ideal given that now the XML animation is ignored, that could be not very obvious (you could also not outright ignore it), but it's a quick and easy solution to turn several XML based Animation
s into Animator
s.
il...@google.com <il...@google.com> #13
For full screen slides, you should strongly consider using a Slide
Transition
yc...@gmail.com <yc...@gmail.com> #14
I have got this bug with 'sharedElementReturnTransition', it causes blinking too. Also it doesn't happens with FragmentManager.enableNewStateManager(false). Any ideas? I don't want to use it unless I have to.
il...@google.com <il...@google.com> #15
Re #14 - Transitions do not use Animations so that would be unrelated to this issue. Please file a new issue with a sample project that reproduces your issue using the latest Fragment 1.3.2.
yc...@gmail.com <yc...@gmail.com> #16
I have tried to make a sample depends in
but I can't found the blinking, maybe there is something wrong in my project, I will try more, anyway ,thanks for reply!
yc...@gmail.com <yc...@gmail.com> #17
Re #15 - I have figured out the problem! It's just because I did some Job at "onPause()" in the return blinking Fragment!
Description
Component used: Fragment
Version used: 1.3.0-Snapshot (Build Id: 6743994)
Devices/Android versions reproduced on: Samsung Galaxy S10 running Android 10
When using "setCustomAnimations" on Fragment Transitions, the animations are broken (flashing) when using the new state manager.
Steps:
FragmentManager.enableNewStateManager(false)
inMainActivity
and re-run the appAttached is a sample and 2 videos detailing the difference in animations with the state manager being turned on and off