一個運動驅動的Android動畫框架:Backboard

jopen 9年前發布 | 12K 次閱讀 Backboard Android開發 移動開發

一個運動驅動的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.baiduhome.net/lib/view/home/1441679809289

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!