GithubHelp home page GithubHelp logo

lerist / kenburnsview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from flavioarfaria/kenburnsview

0.0 2.0 0.0 1.54 MB

Android ImageViews animated by Ken Burns Effect

License: Apache License 2.0

Java 100.00%

kenburnsview's Introduction

KenBurnsView

Android library that provides an extension to ImageView that creates an immersive experience by animating its drawable using the Ken Burns Effect.

Example Image

Overview

KenBurnsView provides the following advantages:

  • Control: you can change the duration and the interpolator of transitions and pause/resume them. You can also listen to events like onTransitionStart() and onTransitionEnd();
  • Highly extensible: you can define how the rectangles to be zoomed and panned will be generated;
  • Libs friendly: since KenBurnsView is a direct extension of ImageView, it seamlessly works out of the box with your favorite image loader library;
  • Easy to use: you can start using it right away. All you need to do is to drop the JAR file into your project and replace ImageView elements in your XML layout files by com.flaviofaria.kenburnsview.KenBurnsView ones.

Latest version: 1.0.6

Gradle integration

If you're using Gradle, you can declare this library as a dependency:

dependencies {
    compile 'com.flaviofaria:kenburnsview:1.0.6'
}

Basic usage

For a working implementation, see the sample/ folder. You can also download the Sample APK.

The simplest way to use KenBurnsView is by dropping the library JAR file into your project adding a view to an XML layout file:

<com.flaviofaria.kenburnsview.KenBurnsView
    android:id="@+id/image"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:src="@drawable/your_drawable" />

Advanced usage

  1. You can set a listener to your view:

     KenBurnsView kbv = (KenBurnsView) findViewById(R.id.image);
     kbv.setTransitionListener(new TransitionListener() {
         @Override
         public void onTransitionStart(Transition transition) {
    
         }
         @Override
         public void onTransitionEnd(Transition transition) {
    
         }
     });
    
  2. You can pause the animation by calling kbv.pause() and resume it by calling kbv.resume();

  3. You can change the duration and the interpolator of transitions:

     RandomTransitionGenerator generator = new RandomTransitionGenerator(duration, interpolator);
     kbv.setTransitionGenerator(generator);
    
  4. If you're willing to have even more control over transitions, you can implement your own TransitionGenerator.

Questions

You can ask any question on Stack Overflow using the android-kenburnsview tag.

Used by

If you want your app listed here, drop me a message on Google+.

Icon App link
FotMob
Getaways by Groupon

Contribution

Want to contribute? Please, feel free to create a pull request! ;)

License

Apache Version 2.0

kenburnsview's People

Contributors

flavioarfaria avatar eric98118 avatar saguinav avatar jozefknazko avatar

Watchers

Lerist avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.