dtx12 / androidanimationsactions Goto Github PK
View Code? Open in Web Editor NEWActions for android animations. Inspired by libgdx scene2d actions.
License: MIT License
Actions for android animations. Inspired by libgdx scene2d actions.
License: MIT License
This is my code:
LinearInterpolator interpolator = new LinearInterpolator();
float width = (float) worldMap[0].getWidth();
//width = 400;
float duration = 1f;
play(forever(sequence(moveBy(-width, 0f, duration, interpolator), moveBy(width, 0f, duration, interpolator))), worldMap[0]);
I am trying to make a loop but The view does not go to the first place, and instead it moves left more than moving to right! So, after few seconds, the view goes out of the screen!
What is wrong here?
The method can be hard to read when the sequence is very long.
Maybe the API can be changed to Builder pattern, something like
play().sequence().fadeOut().fadeIn(2).on(view)
play(forever(parallel(
sequence(
scaleBy(2f, 2f, 2, Interpolations.QuadraticEaseOut),
scaleBy(-2f, -2f),
delay(0.2f)
),
fadeOut())
), radar);
stacktrace:
8-13318/com.justd.startupfabrictest E/AndroidRuntime: Process: com.justd.startupfabrictest, PID: 13318
java.lang.IllegalStateException: target is not specified!
at com.dtx12.android_animations_actions.actions.TypedAction.updateValues(TypedAction.java:68)
at com.dtx12.android_animations_actions.actions.TypedAction.start(TypedAction.java:59)
at android.animation.AnimatorSet.start(AnimatorSet.java:586)
at android.animation.AnimatorSet.start(AnimatorSet.java:586)
at com.dtx12.android_animations_actions.actions.RepeatAction.start(RepeatAction.java:53)
at com.dtx12.android_animations_actions.actions.Actions.play(Actions.java:506)
at com.justd.startupfabrictest.MainActivity.playRadarAnimation(MainActivity.java:69)
at com.justd.startupfabrictest.MainActivity.access$000(MainActivity.java:35)
at com.justd.startupfabrictest.MainActivity$1$1.run(MainActivity.java:130)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
MainActivity 69 is the first line, with play() function
Hello I love your library I've just realized that I could not do certain things, how I can free a view of the final states of an animation? and How to change the colors, and how I can stop a forever?
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.