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 4273170
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:40:35+00:00 2026-05-21T07:40:35+00:00

I want to know about the image translation activity. The layout should contain two

  • 0

I want to know about the image translation activity.

The layout should contain two images and these two images should
split towards left and right at the same time when we click a button
one image should translate towards left and the other towards right.

Help is appreciated.

  • 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-21T07:40:36+00:00Added an answer on May 21, 2026 at 7:40 am

    Either post code or check out the documentation on what you’re asking and get a little more descriptive. This isn’t a vending machine for code, people generally don’t want to just code things for people because they ask for it. What exactly are you having problems with would be a good start? Please read documents, try again and if you can’t get it come back with details; you’ll find help quicker.

    [edit]—-tutorial below—–

    Since you’ve actually given some level of detail here I suppose I’ll show you a simple method. First, this is a great place for animation information. Use it. Second, this code worked perfect for me on the Droid2.

    public class animationTEST extends Activity implements AnimationListener {
        LinearLayout layout;
        LinearLayout layout2;
        Animation movement;
        Animation movement2;
    
        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
    
            // Get the layouts
            layout = (LinearLayout) findViewById(R.id.linearLayout1);
            layout2 = (LinearLayout) findViewById(R.id.linearLayout2);
    
            // Create animation for right image
            movement = AnimationUtils.loadAnimation(this, R.layout.animation_test);
            movement.reset();
            movement.setAnimationListener(this);
    
            // Create animation for left image
            movement2 = AnimationUtils.loadAnimation(this, R.layout.animation_test2);
            movement2.reset();
            movement2.setAnimationListener(this);        
    
    
            // Start animation on each image
            layout2.startAnimation(movement2);
            layout.startAnimation(movement);}
    
        // Listen for animations to be finished
        // There are more efficient ways, I'm just being lazy.
        public void onAnimationEnd(Animation animation) {
            layout.setVisibility(View.INVISIBLE);
            layout2.setVisibility(View.INVISIBLE);
            // or do whatever it is you wanted to do here, like launch another activity?
        } 
    
        public void onAnimationRepeat(Animation animation) {    
        } 
    
        public void onAnimationStart(Animation animation) { 
        } 
    
    }
    

    The main.xml file:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical" android:layout_width="fill_parent"
        android:layout_height="fill_parent">
    
        <TextView android:layout_width="fill_parent"
            android:layout_height="wrap_content" android:text="Animation Test Activity" />
        <RelativeLayout android:layout_width="match_parent"
            android:layout_height="match_parent" android:id="@+id/relativeLayout1">
    
    
            <LinearLayout android:layout_width="wrap_content"
                android:layout_height="wrap_content" android:layout_centerVertical="true"
                android:layout_marginLeft="105dip" android:id="@+id/linearLayout2">
    
                <ImageView android:layout_width="wrap_content"
                    android:layout_height="wrap_content" android:src="@drawable/icon"
                    android:layout_marginRight="30dip" android:id="@+id/imageView2"></ImageView>
    
            </LinearLayout>
    
            <LinearLayout android:layout_width="wrap_content"
                android:layout_height="wrap_content" android:layout_centerVertical="true"
                android:id="@+id/linearLayout1" android:layout_marginLeft="145dip">
    
                <ImageView android:layout_width="wrap_content"
                    android:layout_height="wrap_content" android:src="@drawable/icon"
                    android:layout_marginRight="30dip" android:id="@+id/imageView1"></ImageView>
    
            </LinearLayout>
    
    
        </RelativeLayout>
    
    
    </LinearLayout>
    

    The animation_test.xml (defining translate animation)

    <?xml version="1.0" encoding="utf-8"?>
    <translate xmlns:android="http://schemas.android.com/apk/res/android"
         android:fromXDelta="0" 
         android:toXDelta="65%p" 
         android:fromYDelta="0"
         android:toYDelta="0%" 
         android:duration="3000" 
         android:zAdjustment="top"/>
    

    The animation_test2.xml

    <?xml version="1.0" encoding="utf-8"?>
    <translate xmlns:android="http://schemas.android.com/apk/res/android"
         android:fromXDelta="0" 
         android:toXDelta="-65%p" 
         android:fromYDelta="0"
         android:toYDelta="0%" 
         android:duration="3000" 
         android:zAdjustment="top"/>
    

    If you can’t understand this, go back and read both documents I’ve given you. There is enough information here to understand just about any of the animations. However, your wanting to use animationDrawable objects isn’t right, because that’s a frame animation, not a transformation or motion. Frame based animation is simply making something look like it’s dancing, or waving. When you’re trying to simply move, fade, or scale an image you want transformation animations. Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know about share image or text on Facebook but if i want to
I'm learning about image processing. I want to know about lossless and lossy image
i want to Generate .png image in GWT Does anyone know about this?
I want to know about the advantages and disadvantages of URL masking. Does it
I want to know about the id3 metadata, I am eager in extracting the
I want to know about Virtualization in detail. But start from basics, like what
I want to know about the best practices here. Suppose I want to get
i just want to know about the files and folder structure for a site
Here is the wiki for those who want to know about Apache CXF. http://en.wikipedia.org/wiki/Apache_CXF
Friends, If I want to know about the new features of Oracle 11gR2 Database

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.