/ Published in: Java
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
AnimationSet set = new AnimationSet(true); Animation animation = new TranslateAnimation( Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, -1.0f, Animation.RELATIVE_TO_SELF, 0.0f); animation.setDuration(800); animation.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation animation) { // TODO Auto-generated method stub // MapContacts.this.mapviewgroup.setVisibility(View.VISIBLE); } @Override public void onAnimationRepeat(Animation animation) { // TODO Auto-generated method stub } @Override public void onAnimationEnd(Animation animation) { // TODO Auto-generated method stub } }); set.addAnimation(animation); LayoutAnimationController controller = new LayoutAnimationController( set, 0.25f); panel.setLayoutAnimation(controller); } AnimationSet set = new AnimationSet(true); /* * Animation animation = new AlphaAnimation(1.0f, 0.0f); * animation.setDuration(200); set.addAnimation(animation); */ Animation animation = new TranslateAnimation( Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, -1.0f); animation.setDuration(800); animation.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation animation) { // TODO Auto-generated method stub } @Override public void onAnimationRepeat(Animation animation) { // TODO Auto-generated method stub } @Override public void onAnimationEnd(Animation animation) { // MapContacts.this.mapviewgroup.setVisibility(View.INVISIBLE); // TODO Auto-generated method stub } }); set.addAnimation(animation); LayoutAnimationController controller = new LayoutAnimationController( set, 0.25f); panel.setLayoutAnimation(controller); }