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?

8 comments:

Pradeep said...

Thanks Abhi, this is very useful..

Adrian Tabay said...

HI, can I get the source code for that lib? Thanks in advance.

Adrian Tabay said...

Hi Abhinava! Thanks for this tutorial. Can I get the source code for this lib?

Abhinava Srivastava said...

Hi Adrian,
I have made the library source is in OpenSource and published in Google Code https://code.google.com/p/transitionviewpager/

Anonymous said...

Hey Abhinava sir, you have done a great work but unfortunately while using your library in my project, I'm getting an error in my graphical layout :
"The following classes could not be instantiated:
- com.abhi.animated.TransitionViewPager"
please help sir :(

Abhinava Srivastava said...

Hi there,
Please ensure that you are adding the required libraries (nineolddroid).

Rajath Kumar said...

i get errors as soon as i add the jazzy view pager library from android project from existing source code. whats the problem?

Anonymous said...

Can you pls suggest that how can we set it horizontally ?