0

Could anyone offer any advice on how I can get an image to scroll smoothly from one side of the screen to another?

I am a java novice and I have followed some guides that do this in games using gdx, but this is just in a simple app and on one of the pages I want to click a button and then after clicking some text appears and the image slowly moves across the sky from one side to the other.

I have already done the code to make the text appear, but I can't figure out how to get the image to move. I know roughly I will need to give it an x and y position and then a new x and y position and possibly a timer with 3000 to give me 3 seconds but I don't know how to put this all together :(

So far I have for the onClick method for the button,

//when button clicked

public void imageMove(View view) {
textView1.setVisibility(View.VISIBLE);

I am now stuck on how to write the code to make the image move :(

Many thanks for any help

Danny

Danny Jebb
  • 39
  • 5

1 Answers1

0

This thread will help you man :

Android Layout Animations from bottom to top and top to bottom on ImageView click

When you are in your imageMove method triggered by the onClick from your button, you just have to animate your images. A full example is given in the thread above. Hope this help you !