0

I need to implement an animation on text views which are placed inside the layout,

My requirement is, I need to show Ist three text views on the screen

"Title1(left of the screen)  Title2(center)   Title3(right of the screen)".

when user click on the text 'Title3' i need to show

 Title2(at left)   Title3(at center) and Title4(at right).

and then when we click on 'Title4' it will show

Title3(at left) Title4(at center) and Title1(at right) like a rotation. How can we implement this kind of animation,

This is my code,

in onclick() i have called below lines for scale animation,

tv3.setAnimation(AnimationUtils.loadAnimation(mContext, R.anim.right_to_left));
tv2.setAnimation(AnimationUtils.loadAnimation(mContext, R.anim.right_to_left));
tv1.setAnimation(AnimationUtils.loadAnimation(mContext, R.anim.right_to_left));
tv3.getAnimation().setAnimationListener(flipperAnimationListener);

and my animation listener is given below

flipperAnimationListener = new AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {
            }
            @Override
            public void onAnimationRepeat(Animation animation) {}
            @Override
            public void onAnimationEnd(Animation animation) {
                changeTab();
            }
        };
ranjith
  • 4,526
  • 5
  • 27
  • 31

1 Answers1

0

Why didn't you use ViewPager? It contains what you want.

Here's an example: https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcSFjdgbbZGqUzaWTmm7Rvj4OtRx2oWnHfBYghwwmRIoStKLnzfLAg

This is an example of ViewPager: http://developer.android.com/training/animation/screen-slide.html

To activate "PagerTitleStrip" just override getPageTitle:

@Override
public CharSequence getPageTitle(int position) {
return "Title " + position;
}
QArea
  • 4,955
  • 1
  • 12
  • 22
  • Yes you are right,already I tried that, but i need a circular animation, that means after page4 i need page1 as next tab. is there any method for that?? – ranjith Oct 31 '14 at 08:34