Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6142841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:26:36+00:00 2026-05-23T18:26:36+00:00

I want to do this animation, when switching between 2 activities: — — any

  • 0

I want to do this animation, when switching between 2 activities:

enter image description here

—

enter image description here

—

enter image description here

any help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:26:36+00:00Added an answer on May 23, 2026 at 6:26 pm

    Here the answer:

        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
    
                    ViewFlipper flipper = findViewById(R.id.flipper);
                    flipper.setOnTouchListener(this);
    }
    
    private void myOnTouch(View v, MotionEvent event) {
    
            switch (event.getAction()) {
    
            case MotionEvent.ACTION_MOVE:
                mDragged = true;
                break;
            case MotionEvent.ACTION_DOWN:
                mDragged = false;
                mXbefore = event.getX();
                break;
            case MotionEvent.ACTION_UP:
    
                if(mDragged){
                    vf = (ViewFlipper) v;
                    mXafter = event.getX();
    
                    if(mXafter > mXbefore){
                        vf.setInAnimation(AnimationUtils.loadAnimation(this, R.anim.right_to_left_in));
                        vf.setOutAnimation(AnimationUtils.loadAnimation(this, R.anim.right_to_left_out));
                        vf.showNext();
                    }else{
                        vf.setInAnimation(AnimationUtils.loadAnimation(this, R.anim.left_to_right_in));
                        vf.setOutAnimation(AnimationUtils.loadAnimation(this, R.anim.left_to_right_out));
                        vf.showPrevious();
                    }
                }
    
                mDragged = false;
                break;
            default:
                break;
            }
        }
    

    main.xml:

    <ViewFLipper id="@+id/flipper">
             <YourLayout />
              <YourLayout />
    </ViewFlipper>
    

    right_to_left_in.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <set xmlns:android="http://schemas.android.com/apk/res/android">
        <translate 
            android:fromXDelta="-100%p" 
            android:toXDelta="0%p" 
            android:duration="500"/>
        <alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="500" />
    </set> 
    

    right_to_left_out.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <set xmlns:android="http://schemas.android.com/apk/res/android">
        <translate 
            android:fromXDelta="100%p" 
            android:toXDelta="200%p" 
            android:duration="500"/>
        <alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="500" />
    </set>
    

    left_to_right_in.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <set xmlns:android="http://schemas.android.com/apk/res/android">
        <translate 
            android:fromXDelta="100%p" 
            android:toXDelta="0" 
            android:duration="500"/>
        <alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="500" />
    </set>
    

    left_to_right_out_xml:

    <?xml version="1.0" encoding="utf-8"?>
    <set xmlns:android="http://schemas.android.com/apk/res/android">
        <translate 
            android:fromXDelta="0%p" 
            android:toXDelta="-100%p" 
            android:duration="500"/>
        <alpha android:fromAlpha="1.0" android:toAlpha="0.0" android:duration="500" />
    </set>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to set a Animation Transition like this there is a link to
I want to do this effect in my image (button) http://osc4.template-help.com/wt_32608/index.html# I want to
So, I have this animation that I want to run in the background of
So I have this ActivityGroup in which I show 2 Activities. When I'm switching
Hi there I've made this animation using the Raphael framework. I want the star
I want this url http://www.youtube.com/watch?v=dgNgODPIO0w&feature=rec-HM-fresh+div to be transformed to: http://www.youtube.com/v/dgNgODPIO0w with php.
I want this: http://jqueryui.com/demos/dialog/#modal-message to happend when you click on ClickMe. how to do
I want this for some conditional compilation code that will run in all IE's
I want this to be on top... how can I do this and not
I only want this function to run if .toolbar li does not have the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.