wirecube / android_additive_animations Goto Github PK
View Code? Open in Web Editor NEWAdditive animations for Android!
License: Apache License 2.0
Additive animations for Android!
License: Apache License 2.0
Would you consider move to AndroidX? I still get the following running canISayByeByeJetifier
Scanning at.wirecube:additive_animations:1.8.0
Absoulute path: /Users/xiwei/.gradle/caches/modules-2/files-2.1/at.wirecube/additive_animations/1.8.0/1af778f898822b9b74d83f8c3632188f191fc41b/additive_animations-1.8.0.aar
Graphs to this dependency:
+---at.wirecube:additive_animations:1.8.0
Issues found:
* at/wirecube/additiveanimations/additive_animator/SubclassableAdditiveViewAnimator.class -> android/support/v4/view/ViewCompat
* at/wirecube/additiveanimations/helper/EaseInOutPathInterpolator.class -> android/support/v4/view/animation/PathInterpolatorCompat
Thanks
I just upgraded from 1.7.5 to 1.9.2 and most of my app's content was not shown anymore. In lots of places I fade in/out content with AdditiveAnimator. After two hours of searching for the root cause I switched from 1.9.2 back to 1.9.1 and suddenly everything is working again.
Might there be a bug in 1.9.2? I saw that lots of visibility/fade related framework code has been changed in 1.9.2.
This is a typical pattern which works in 1.9.1 but does NOT work in 1.9.2:
AdditiveAnimator.animate(contentViews)
.setDuration(UI.CARDS_INTRO_DURATION)
.setInterpolator(new DecelerateInterpolator())
.fadeVisibility(show ? View.VISIBLE : View.GONE)
.start();
Am I missing something?
Cool library! Thank you.
One question: How do I reset, reverse and pause/resume additive animations like in AnimatorSet?
The animation of rotation of a view looks wierd because its using the upper left corner for the rotation, how can I change the pivotX and pivotY to the center of the view to animate around this center?
First off, thanks for this library! It's made animating things so much better.
But could we include animations with delays in the blending calculations as soon as we call .start()
on the chain? Say we have a simple fade-out-then-fade-in:
animator.animate(view)
.alpha(0f)
.then()
.target(otherView)
.alpha(1f)
.start()
And we have its reverse:
animator.animate(otherView)
.alpha(0f)
.then()
.target(view)
.alpha(1f)
.start()
If we run these in quick succession, the outcome is that both views are visible, since the .alpha(1f)
animations are started last due to the .then()
delay.
I would expect that the blending would take into account any animations that have been .start()
ed, i.e. that the last animation block to be declared and .start()
ed would be the end state of all views involved, regardless of delays/choreography.
I can make a PR for this if I find the time before you do, but I'd love to hear your thoughts first.
The stagger parameter gets overwritten by the startDelay when used in this order:
AdditiveAnimator.anime(views, 50)
.setStartDelay(300)
.yBy(100)
.start()
setStartDelay
should just add to the initial stagger, not overwrite it.
Hi there!
Thanks for your lib, it's awesome! What about the same but for iOS? :)
Error:Unable to find method 'org.gradle.api.internal.project.ProjectInternal.getPluginManager()Lorg/gradle/api/internal/plugins/PluginManagerInternal;'.
Possible causes for this unexpected error include:
Recently JFrog announced they'll be sunsetting the jcenter registry: https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/
It looks like Maven Central is their recommended alternative https://search.maven.org/
Problem:
Kotlin requires that type information be provided. i.e. the following code has an error.
AdditiveAnimator()
Instead, it has to be used like this:
AdditiveAnimator<AdditiveAnimator<*>>()
It's quite ugly and annoying.
Short Term Solution:
Please provide static methods that duplicate the constructor arguments.
AdditiveAnimator.create()
AdditiveAnimator.create(300L)
Long Term Solution:
I don't understand the library well enough to recommend a good long-term solution, but ideally the API would be reconsidered with Kotlin in mind.
Hi, i would like to ask question about specific use case. How do you handle startAction, endAction cases, such as:
when animation1
with endAction
that sets viewA.visibility=GONE
and animation2
with startAction
that sets viewA.visibility=VISIBLE
. Problem occurs if animation1
is started and in the middle of animation1
, animation2
is started. Desired result of viewA
visibility is VISIBLE
since animation2
is started later. But result is viewA
visibility GONE
because animation1
s endAction
runs even animation2
is started later.
The gifs should be hosted somewhere else, they unnecessarily bloat the repository.
AdditiveAnimator.animate(this)
.addEndAction(object : AnimationEndListener() {
override fun onAnimationEnd(wasCancelled: Boolean) {
}
})
Function above can be simplified using typealias and lambda.
typealias AnimationEndListener =
(wasCancelled: Boolean) -> Unit
fun AdditiveAnimator.addEndAction(listener: AnimationEndListener) {
addEndAction(object : AnimationEndListener() {
override fun onAnimationEnd(wasCancelled: Boolean) {
listener(wasCancelled)
}
})
}
// Use
AdditiveAnimator.animate(this)
.addEndAction { wasCancelled ->
}
Do you have any plans to do something like this? (Support Kotlin)
I've go following stacktrace:
03-31 12:36:17.715 4093 4093 E AndroidRuntime: FATAL EXCEPTION: main
03-31 12:36:17.715 4093 4093 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'void at.wirecube.additiveanimations.additive_animator.RunningAnimationsManager.setCurrentState(at.wirecube.additiveanimations.additive_animator.animation_set.AnimationState)' on a null object reference
03-31 12:36:17.715 4093 4093 E AndroidRuntime: at at.wirecube.additiveanimations.additive_animator.BaseAdditiveAnimator.state(BaseAdditiveAnimator.java:371)
03-31 12:36:17.715 4093 4093 E AndroidRuntime: at at.wirecube.additiveanimations.additive_animator.SubclassableAdditiveViewAnimator.fadeVisibility(SubclassableAdditiveViewAnimator.java:180)
...
03-31 12:36:17.715 4093 4093 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:873)
03-31 12:36:17.715 4093 4093 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
03-31 12:36:17.715 4093 4093 E AndroidRuntime: at android.os.Looper.loop(Looper.java:193)
03-31 12:36:17.715 4093 4093 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6680)
03-31 12:36:17.715 4093 4093 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
03-31 12:36:17.715 4093 4093 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
03-31 12:36:17.715 4093 4093 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
There is no particular case, when it happen, but it seems that it is related to the object mRunningAnimationsManager
being null sometimes (it is nullable by design and there is no null checks in that part of code).
Can you fix that?
Hi, how to cancel animation with repeat count INFINITE?
shakeAnimation = AdditiveAnimator.animate(image)
.setDuration(200L)
.setInterpolator(LinearInterpolator())
.rotation(3f)
.then()
.rotation(-3f)
.setRepeatCount(ValueAnimator.INFINITE)
.setRepeatMode(ValueAnimator.REVERSE)
shakeAnimation.cancelAllAnimations()
does not stop animation.
Hi, i run animations using
AdditiveAnimator()
.setDuration()
...
.addStartAction(...)
...
.start()
and i get leak reports from LeakCanary like below. I assume AdditiveAnimator
keeps reference to Views which keeps reference to Activity Context. How do we clear those references when leaving the Activity?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.