GithubHelp home page GithubHelp logo

myheat / fragmenttransactionextended Goto Github PK

View Code? Open in Web Editor NEW

This project forked from desarrolloantonio/fragmenttransactionextended

0.0 2.0 0.0 8.24 MB

FragmentTransactionExtended is a library which provide us a set of custom animations between fragments.

License: Apache License 2.0

fragmenttransactionextended's Introduction

FragmentTransactionExtended

Logo Logo

FragmentTransactionExtended is a library which provide us a set of custom animations between fragments. FragmentTransaction only accepts some simple animations (TRANSIT_FRAGMENT_CLOSE, TRANSIT_FRAGMENT_FADE, TRANSIT_FRAGMENT_OPEN...).

List of animations added:

  • SCALEX
  • SCALEY
  • SCALEXY
  • FADE
  • FLIP_HORIZONTAL
  • FLIP_VERTICAL
  • SLIDE_VERTICAL
  • SLIDE_HORIZONTAL
  • SLIDE_HORIZONTAL_PUSH_TOP
  • SLIDE_VERTICAL_PUSH_LEFT
  • GLIDE
  • SLIDING
  • STACK
  • CUBE
  • ROTATE_DOWN
  • ROTATE_UP
  • ACCORDION
  • TABLE_HORIZONTAL
  • TABLE_VERTICAL
  • ZOOM_FROM_LEFT_CORNER
  • ZOOM_FROM_RIGHT_CORNER
  • ZOOM_SLIDE_HORIZONTAL
  • ZOOM_SLIDE_VERTICAL

Because FragmentTransaction.setCustomAnimations needs to use ObjectAnimator in XML and the animations of this library needs some fractional values is necesary to extends the fragment container from SlidingRelativeLayout, this class contains the necessary getters and setters.

<com.desarrollodroide.libraryfragmenttransitionextended.SlidingRelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
</com.desarrollodroide.libraryfragmenttransitionextended.SlidingRelativeLayout>

The container of the fragments must extends from SlidingRelativeLayout like the example

<com.desarrollodroide.libraryfragmenttransactionextended.SlidingRelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/back1" >
    <ListView
            android:id="@android:id/list"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>
</com.desarrollodroide.libraryfragmenttransactionextended.SlidingRelativeLayout>

You need to declare in your activity manifest if you need to manage change orientations:

android:configChanges="keyboardHidden|orientation|screenSize"

Usage FragmentTransitionExtended

Constructor:

FragmentTransactionExtended fragmentTransactionExtended = new FragmentTransactionExtended(context, fragmentTransaction, firstFragment, secondFragment, containerID);

AddTransition:

fragmentTransactionExtended.addTransition(FragmentTransactionExtended.*);

Example:

FragmentManager fm = getFragmentManager();
FragmentTransaction fragmentTransaction = fm.beginTransaction();
FragmentTransactionExtended fragmentTransactionExtended = new FragmentTransactionExtended(this, fragmentTransaction, firstFragment, secondFragment, R.id.fragment_place);
fragmentTransactionExtended.addTransition(FragmentTransactionExtended.GLIDE);
fragmentTransactionExtended.commit();

Special Thanks

Developed By

Antonio Corrales [email protected]

License

Copyright 2014 Antonio Corrales

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.

fragmenttransactionextended's People

Contributors

desarrolloantonio 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.