jmrboosties / recyclerview-animators

An Android Animation library which easily add itemanimator to RecyclerView items.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RecyclerView Animators

Gitter

Build Status Android Arsenal License Download

RecyclerView Animators is an Android library that allows developers to easily create RecyclerView with animations.

Please feel free to use this.

Features

  • Animate addition and removal of ItemAnimator
  • Appearance animations for items in RecyclerView.Adapter

Demo

ItemAnimator

Adapters

Samples

How do I use it?

Setup

Download the latest JAR or grab via Gradle:

Gradle

repositories {
    jcenter()
}

dependencies {
    compile 'jp.wasabeef:recyclerview-animators:1.1.2@aar'
}

ItemAnimator

Step 1

Set RecyclerView ItemAnimator.

    RecyclerView recyclerView = (RecyclerView) findViewById(R.id.list);
    recyclerView.setItemAnimator(new SlideInLeftAnimator());

Advanced Step 2

You can change the durations.

    recyclerView.getItemAnimator().setAddDuration(1000);
    recyclerView.getItemAnimator().setRemoveDuration(1000);
    recyclerView.getItemAnimator().setMoveDuration(1000);
    recyclerView.getItemAnimator().setChangeDuration(1000);

Animators

Cool

LandingAnimator

Scale

ScaleInAnimator, ScaleInTopAnimator, ScaleInBottomAnimator
ScaleInLeftAnimator, ScaleInRightAnimator

Fade

FadeInAnimator, FadeInDownAnimator, FadeInUpAnimator
FadeInLeftAnimator, FadeInRightAnimator

Flip

FlipInTopXAnimator, FlipInBottomXAnimator
FlipInLeftYAnimator, FlipInRightYAnimator

Slide

SlideInLeftAnimator, SlideInRightAnimator, OvershootInLeftAnimator, OvershootInRightAnimator
SlideInUpAnimator, SlideInDownAnimator

RecyclerView.Adapter

Step 1

Set RecyclerView ItemAnimator.

    RecyclerView recyclerView = (RecyclerView) findViewById(R.id.list);
    MyAdapter adapter = new MyAdapter();
    recyclerView.setAdapter(new AlphaInAnimationAdapter(adapter));

Advanced Step 2

You can change the durations.

    MyAdapter adapter = new MyAdapter();
    AlphaInAnimationAdapter alphaAdapter = new AlphaInAnimationAdapter(adapter);
    alphaAdapter.setDuration(1000);
    recyclerView.setAdapter(alphaAdapter);

Advanced Step 3

You can Multiple Animations

    MyAdapter adapter = new MyAdapter();
    AlphaInAnimationAdapter alphaAdapter = new AlphaInAnimationAdapter(adapter);
    recyclerView.setAdapter(new ScaleInAnimationAdapter(alphaAdapter));

Adapters

Alpha

AlphaInAnimationAdapter

Scale

ScaleInAnimationAdapter

Slide

SlideInBottomAnimationAdapter
SlideInRightAnimationAdapter, SlideInLeftAnimationAdapter

Applications using RecyclerView Animators

Please ping me or send a pull request if you would like to be added here.

Icon Application
Ameba Ownd

Developed By

Daichi Furiya (Wasabeef) - dadadada.chop@gmail.com

Follow me on Twitter

Thanks

  • Inspired by AndroidViewAnimations in daimajia.

License

Copyright 2015 Wasabeef

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

An Android Animation library which easily add itemanimator to RecyclerView items.

License:Apache License 2.0


Languages

Language:Java 100.0%