一个运动驱动的Android动画框架:Backboard

jopen 10年前

一个运动驱动的Android动画框架。backboard是一个在rebound之上的框架,让它更加易于使用通过连接到的视图和动作。backboard-example is an Android app with a few demos of animations made possible by backboard.

Usage

Update yourbuild.gradlewith

dependencies {     compile 'com.非死book.rebound:rebound:0.3.8' compile 'com.tumblr.backboard:backboard:+' }

Getting Started

Backboard is a framework on top of rebound that manages howSpringsare used and simplifies the most common use cases:

  • Actions, such asMotionEvents, are mapped toSpringsviaImitators.
  • Springsare mapped toViewsand view properties viaPerformers.

In addition, anActorwraps the above objects and provides a simple interface for mapping touch motion to a view's position - dragging.

Performers

APerformertakes the current value of aSpringand sets it as the value of a view property.

Spring bounce = SpringSystem.create().createSpring();  Performer xMotion = new Performer(view, View.TRANSLATION_X);  bounce.addListener(xMotion);

for those saving screen space, a fluent interface is available:

Spring bounce = SpringSystem.create().createSpring().addListener(new Performer(view, View.TRANSLATION_X));

项目主页:http://www.open-open.com/lib/view/home/1441679809289