Showing posts with label Animation. Show all posts
Showing posts with label Animation. Show all posts

Saturday, May 25, 2013

Transition View Pager

Its been sometime when we talked anything core technical and made our hands dirty :)

Well happy to announce of releasing a new open source project named TransitionViewPager.

The credit goes to JazzyViewPager i have only extended the functionality to Fragments.

What's This Now !!!

Its a ViewPager that allows you to do more than just showing your content.. it allows you to animate during transition.
You can relate it to something like your application screen ( Android original Flavour )


Ok!!!
 


Kool! But how long will it take to implement?

May be 2~10 mins (depends on your typing speed :D)

Enough talk lets fight !! fafamuii!

Step 1:
layout.xml

<com.abhi.animated.TransitionViewPager xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/pager"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

<android.support.v4.view.PagerTitleStrip
        android:id="@+id/pager_title_strip"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="top"
        android:background="#33b5e5"
        android:paddingBottom="4dp"
        android:paddingTop="4dp"
        android:textColor="#fff" />

</com.abhi.animated.TransitionViewPager>


Step 2:
Activity.java
just append this

mViewPager = (TransitionViewPager) findViewById(R.id.pager);
mViewPager.setAdapter(mSectionsPagerAdapter);

mViewPager.setTransitionEffect(TransitionEffect.CubeOut);


Yepp!! you are all done!!! there are wide variety of stuffs that you can do with this... keep playing with TransitionEffect and see effects in application :)

WAIT WAIT WAIT!! where to get it from?