I have LinearLayout, I am dynamically adding TextView, ImageView to that LinearLayout , now I have added OnClickListener to these TextViews and ImageViews.
I have an arraylist that has 10 elements in it using a for loop. I get each value and display, since this quiz application has the following and previous buttons, when I click on it, I show the elements one by one from the arraylist. Now I need slide In and slide Out animation to apply to this Linear Layout.
I saw this:
Link 1
Link 2
as well as i tried this
slideIn = new TranslateAnimation( TranslateAnimation.RELATIVE_TO_PARENT, 1.0f, TranslateAnimation.RELATIVE_TO_PARENT, 0.0f, TranslateAnimation.RELATIVE_TO_PARENT, 0.0f, TranslateAnimation.RELATIVE_TO_PARENT, 0.0f); slideIn.setDuration(500); slideOut = new TranslateAnimation( TranslateAnimation.RELATIVE_TO_PARENT, 0.0f, TranslateAnimation.RELATIVE_TO_PARENT, -1.0f, TranslateAnimation.RELATIVE_TO_PARENT, 0.0f, TranslateAnimation.RELATIVE_TO_PARENT, 0.0f); slideOut.setDuration(500);
But donβt work, please help with this.
EDIT:
Problem: I applied this to the linear layout, but what happens is that when I click on the next button, the current question will slide left and a blank screen, then it will slide and display the next question, but I want the current question to fail, for the following question should follow.
source share