Reputation: 947
I want to replace a view object in android where a view object will take place of another view object using animation. Please find attached image for reference.
I just want to slide the three dots to left side in the place of CVV_label and the right arrow should come in. again after if I click on the dots the reverse animation should be played, that means CVV_label should come in and the three dots should slide to right side.
Upvotes: 0
Views: 1359
Reputation: 947
TranslateAnimation animation = new TranslateAnimation(0, left_text.getX()-right_text.getX(),0 , left_text.getY()-right_text.getY());
animation.setRepeatMode(0);
animation.setDuration(1000);
animation.setFillAfter(true);
right_text.startAnimation(animation);
left_text.setVisibility(View.INVISIBLE);
The above code will work for the scenario.
Upvotes: 1