dimanche 26 février 2017

Picking random ImageView from drawable folder after meeting a particular condition

I have small 3 images(50dp) in drawable folder. I have declared them in "onCreate" method

   img1 = (ImageView) findViewById(R.id.img1);
   img2 = (ImageView) findViewById(R.id.img2);
   img3 = (ImageView) findViewById(R.id.img3);

and they are off screen now (x,y) = (-100, 100)

now i want them to come in the screen from x=1000 to x=0 one by one. When img1 reaches to x=0 or it meets the collision condition then only next image(img2 or img1 or img1) should come.

I tried to follow some suggestions but the thing I couldn't get is how to set that random image's position and movements.

random genaration of image from drawable folder in android

How To Display Random images on image view




Aucun commentaire:

Enregistrer un commentaire