I want to create images which will go down from the upper part of the screen.
For up to today I have this:
ImageView mario = (ImageView) findViewById(R.id.mario);
TranslateAnimation anim = new TranslateAnimation(0f, 0f, 0, 400);
anim.setInterpolator(new LinearInterpolator());
anim.setRepeatCount(Animation.INFINITE);
anim.setDuration(800);
mario.startAnimation(anim);
The problems are that I have to set the imageview on the xml file on the layout and this code creates just 1 picture only.
I want to program the app to create a couple of images (for example in a loop) in the upper part of the screen and have them drop down the screen. (here I use TranslateAnimation here). I found something like this:
ImageView mario = (ImageView) findViewById(R.drawable.mario);
But I don't know how to set the position of the ImageView which isn't in the xml file (is it possible?). I though about creating LinearLayout and add it to the ImageView. But how to add the linearlayout to the existing layout?
Thanks in advance :)