Question

Create a simple Animation resource file (XML) which will animate a given image as follows: Move...

Create a simple Animation resource file (XML) which will animate a given image as follows:
Move the image to left by 5%
Move the image to right by 5%
Move the image to left by 5%
Set the duration of animation to 0.1 seconds each.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

solution:

<?xml version="1.0" encoding="utf-8"?>
<set
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:anim/linear_interpolator"
    android:fillAfter="true">

    <translate
        android:fromXDelta="0%p"
        android:toXDelta="5%p"
        android:duration="100" />
</set>
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:fillAfter="true"
    android:interpolator="@android:anim/linear_interpolator" >

    <translate
        android:fromXDelta="0%p"
        android:toXDelta="-5%p"
        android:duration="100"
        android:startOffset="0" />

    <translate
        android:fromXDelta="-5%p"
        android:toXDelta="5%p"
        android:duration="100"
        android:startOffset="100" />

    <translate
        android:fromXDelta="0%p"
        android:toXDelta="-5%p"
        android:duration="100" 
        android:startOffset="200"/>

</set>

We control the animation sequence using startOffset. When the start() method is called to begin the animation, we have got the first animation starting at time 0, the second at time 100 and third at time 200. These times are in milliseconds.

fromXDelta specifies the the position from the original where the image is shifted. ToXDelta specifies the final location of the image.

duration specifies the time of the animation.

please give me thumb up

Add a comment
Know the answer?
Add Answer to:
Create a simple Animation resource file (XML) which will animate a given image as follows: Move...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • In NetBeans create a new Java project. 2. Create a new XML file in this project...

    In NetBeans create a new Java project. 2. Create a new XML file in this project named movie with the following content: <movie> <director>Chris Columbus</director> <imdbRef>tt0295297</imdbRef> <year>2002</year> <metascore>63</metascore> <rottenTomatoes>82</rottenTomatoes> <keywords> <keyword>harrypotter</keyword> <keyword>jkrowlings</keyword> <keyword>hogwarts</keyword> </keywords> </movie> 3. The IMDB reference is a key that IMDB gives to each movie. It is used to access all the different features of IMDB for this movie. Just google "IMDB tt0295297" to get an idea. You would have to do this for the two other...

  • The Comelation and Regression Applet allows you to animate the given figure. Click to create a...

    The Comelation and Regression Applet allows you to animate the given figure. Click to create a group of 10 points in the lower-left comer of the scatterplot with a strong straight-line pattem (correlation approximately 09) Clickthe "Show least-squaresline"box to display the regression line. Move the outlier down Subject 16 Removing Subject 16 moves the regression line only a little. and the least-squares line chases it down 60 100 20 40 60 80 100 Empathy score Empathy score Now use the...

  • The Correlation and Regression Applet allows you to animate the given figure. Click to create a...

    The Correlation and Regression Applet allows you to animate the given figure. Click to create a group of 10 points in the lower-left corner of the scatterplot with a strong straight-line pattern (correlation approximately 0.9). Click the "Show least-squares line" box to display the regression line. Move the outlier down Subject 16 Removing Subject 16 moves the regression line only a little. and the least-squares line chases it down 20 40 60 80 100 20 40 Empathy score 60 80...

  • You are the systems manager for Blue City Movies Rentals and you have been asked to create a report on historical sales data. To complete your task you will combine and edit data from multiple sources using Excel’s Power add-ins, XML, and tex

    You are the systems manager for Blue City Movies Rentals and you have been asked to create a report on historical sales data. To complete your task you will combine and edit data from multiple sources using Excel’s Power add-ins, XML, and text functions.Instructions:For the purpose of grading the project you are required to perform the following tasks:StepInstructionsPoints Possible1Open e10c2MovieRentals.xlsx and save the workbook with the name e10c2MovieRentals_LastFirst.02Import the movie data from the delimited file e10c2Movies.txt and rename the new worksheet Inventory.Hint: On the Data tab,...

  • Assignment Λ You shall write a Java program that accepts 5 command-line arguments and generates an image of a Sierpinski triangle, as a 24- bit RGB PNG image file. Specifications The command-line arg...

    Assignment Λ You shall write a Java program that accepts 5 command-line arguments and generates an image of a Sierpinski triangle, as a 24- bit RGB PNG image file. Specifications The command-line arguments shall consist of the following 1. The width (in pixels) of the image, as a positive decimal integer 2. The height (in pixels) of the image, as a positive decimal integer 3. The minimum area (in pixels) that a triangle must have in order to be drawn,...

  • Please help me with this project by using Android Studio. I need to know the xml...

    Please help me with this project by using Android Studio. I need to know the xml and the java activities in both activities. Also the manifest activity. I appreciate the effort and I'll rate you with 5 stars. 1. SUMMARY This project will simulate the card game Concentration for one player. In Concentration, all cards, or pictures in this case, are upside down. Two cards are chosen, and if they match they are taken out of the game. If they...

  • (In Java) Create an applet which draws two sets of concentric circles. Each set will use recursio...

    (In Java) Create an applet which draws two sets of concentric circles. Each set will use recursion: Start with a diameter of 255 for the outermost circle As each circle is drawn, use a color created via a constructor in the Color class: Color circleColor = new Color(diameter, diameter, diameter) ; Use recursion to draw the next inner circle: for one set of circles, decrease the diameter of each circle by 20 pixels for the other set of circles, decrease...

  • In Python and in one file please. (Simple functions with an expressions) Create a function called...

    In Python and in one file please. (Simple functions with an expressions) Create a function called load_inventory(filename). The filename argument in this case specifies the name of a file that contains all the inventory/product information for the store, including product names, descriptions, prices, and stock levels. This function should clear any information already in the product list (i.e., a fresh start) and then re-initialize the product list using the file specified by the filename argument. You can structure your file...

  • I want to make a really simple maze game in Python. I need to use tkinter and GUI to make this ha...

    I want to make a really simple maze game in Python. I need to use tkinter and GUI to make this happened. Under you can see the description of the task, but i need help to getting startet. If there is an other easier way I'm just happy for the help!! task Description: You have to create a maze game. The goal of the game is to get out of the maze. The game should read The maze from a...

  • This should be in Java Create a simple hash table You should use an array for...

    This should be in Java Create a simple hash table You should use an array for the hash table, start with a size of 5 and when you get to 80% capacity double the size of your array each time. You should create a class to hold the data, which will be a key, value pair You should use an integer for you key, and a String for your value. For this lab assignment, we will keep it simple Use...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT