KenBurnsView

Android ImageViews animated by Ken Burns Effect

Github星跟踪图

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.

Changelog

Latest version: 1.0.7

Gradle integration

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

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

Basic usage

For a working implementation, see the sample/ folder.

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) {

    }
});
  1. You can pause the animation by calling kbv.pause() and resume it
    by calling kbv.resume();

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

RandomTransitionGenerator generator = new RandomTransitionGenerator(duration, interpolator);
kbv.setTransitionGenerator(generator);
  1. 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.

License

Apache Version 2.0

主要指标

概览
名称与所有者flavioarfaria/KenBurnsView
主编程语言Java
编程语言Java (语言数: 1)
平台
许可证Apache License 2.0
所有者活动
创建于2014-03-19 03:10:02
推送于2022-08-26 21:23:54
最后一次提交2019-08-28 08:07:49
发布数8
最新版本名称v1.0.7 (发布于 )
第一版名称v1.0 (发布于 )
用户参与
星数2.7k
关注者数79
派生数437
提交数114
已启用问题?
问题数46
打开的问题数10
拉请求数12
打开的拉请求数2
关闭的拉请求数2
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?