Giter Club home page Giter Club logo

easytransition's Introduction

EasyTransition

A light transition lib(with only 2 files...) for Android, scince shared elements transition is not supported before LOLLIPOP, using EasyTransition can easily make fun transition animation between elements in two activities. Enjoy it!

ScreenShots

easytransition

Usage

1.Using same ids between two Views in two layouts.

    <!-- Activity A -->
    <ImageView
        android:id="@+id/iv_icon"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:src="@mipmap/avatar_male"
        />
    
    <!-- Activity B -->
    <ImageView
        android:id="@+id/iv_icon"
        android:layout_width="200dp"
        android:layout_height="200dp"
        android:src="@mipmap/avatar_male"
        />

2.In Activity A, make transition options, and start Activity B with EasyTransition#startActivity.

    // ready for transition options
    EasyTransitionOptions options =
        EasyTransitionOptions.makeTransitionOptions(
            ActivityA.this,
            findViewById(R.id.iv_icon),
            findViewById(R.id.tv_name)); // add as many views as you like

    // start transition
    Intent intent = new Intent(ActivityA.this, ActivityB.class);
    EasyTransition.startActivity(intent, options);

3.In Activity B, enter transition when creating, and exit transition when backing.

    // onCreate
    EasyTransition.enter(ActivityB.this);
    
    // onBackPressed
    EasyTransition.exit(ActivityB.this);

Attributes

Usage above is only the minimum choice, you can set attributes like duration, time interpolator and so on, have fun!

easytransition's People

Contributors

huzenan avatar

Stargazers

 avatar

Watchers

 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.