Skip to content

Instantly share code, notes, and snippets.

@Foosvald
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Foosvald/b6639f12d847803ca3eb to your computer and use it in GitHub Desktop.
Save Foosvald/b6639f12d847803ca3eb to your computer and use it in GitHub Desktop.
Configuranimation configuranimation = new Configuranimation(this);
// Add what you want to configure like this
configuranimation
.addAnimationConfig("Expander")
.addDuration(0, 1000, 0, 20)
.addInterpolator()
.setCallback(new Callback() {
@Override
public void run() {
expandView();
}});
// Or maybe like this
configuranimation
.addAnimationConfig("Thumb Start")
.addFloatProperty("Start Scale X", 0f, 2f, 1f, 0.1f)
.addFloatProperty("Start Scale Y", 0f, 2f, 1f, 0.1f)
.addDpProperty("Start X", 0, 400, 0, 4)
.addDpProperty("Start Y", 0, 1000, 0, 10)
.setDebouncingEnabled(false);
// Retrieve values again
AnimationConfig config = configuranimation.getAnimationConfig("Thumb Start");
thumbView.setX(config.getDpPropertyInPx("Start X"));
thumbView.setY(config.getDpPropertyInPx("Start Y"));
thumbView.setScaleX(config.getFloatProperty("Start Scale X"));
thumbView.setScaleY(config.getFloatProperty("Start Scale Y"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment