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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:08:16+00:00 2026-05-20T21:08:16+00:00

Hey! Basically, I have this little animation of this text that slides down when

  • 0

Hey!
Basically, I have this little animation of this text that “slides” down when a person clicks the screen.

It takes 6 seconds to slide from top to the bottom.

While it is sliding if someone clicks the screen again, I want to replace that animation with another animation which makes it go left/right or anything different.
Basically, replace the translate.xml animation with some_other_animation.xml right from that spot (not from the beginning).

(My eventual idea is to make it “explode”).
Any help appreciated.

My files: Main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/root"
 android:layout_width="fill_parent" android:layout_height="fill_parent"
 xmlns:android="http://schemas.android.com/apk/res/android"     android:gravity="top|center">
    <TextView android:id="@+id/animatedText" android:layout_height="wrap_content"     android:text="@string/hello" android:layout_width="wrap_content"></TextView>
</LinearLayout>

Strings.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
 <string name="hello">Just a sample string!</string>
 <string name="app_name">Ryan Sample</string>

</resources>

Animation class:

package com.ryan.test.animsxx;

import java.util.Timer;
import java.util.TimerTask;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.LinearLayout;
import android.widget.TextView;

public class AnimationActivity extends Activity {
 /** Called when the activity is first created. */
 @Override public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.main);
 final Animation a = AnimationUtils.loadAnimation(this, R.anim.translate);
 a.reset();
 final TextView rText = (TextView) findViewById(R.id.animatedText);

 LinearLayout layout = (LinearLayout) findViewById(R.id.root);
 layout.setOnClickListener(new OnClickListener() {
 @Override public void onClick(View v) {
 rText.startAnimation(a);

 }
 });

 }
}

Translate.xml

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

Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.ryan.test.animsxx"
  android:versionCode="1"
  android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />

<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".AnimationActivity"
 android:label="@string/app_name">
 <intent-filter>
 <action android:name="android.intent.action.MAIN" />
 <category android:name="android.intent.category.LAUNCHER" />
 </intent-filter>
 </activity>

</application>
</manifest>
  • 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-20T21:08:17+00:00Added an answer on May 20, 2026 at 9:08 pm

    Um, your “second” animation cannot be defined with xml, since it depends on a runtime event. You could construct a new animation in code, based on the location of the touch event.

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

Sidebar

Related Questions

Hey, I have a sequence of code that goes something like this: label.Text =
Hey, so basically I have this issue, where I'm trying to put an equation
Hey all. Basically I have a page full of text input fields with default
Hey. I have this javascript file that I'm getting off the web and it
Hey guys, So I have this report that I am grouping into different age
Hey all, basically i have an empty AS3 fla file with just the following
Hey guys I'm not sure how to write this in AS3, but basically I
Hey, I was working with a PHP function that takes multiple arguments and formats
Hey I'm wondering how I can get this code to work. Basically I want
Hey fellas, I have this weird bug, and I have no clue how to

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.