Monday, November 7, 2011

How to do a simple visible animation in Android

public void showConfigurationBar() {
AnimationSet set = new AnimationSet(true);
Animation animation = new AlphaAnimation(0.0f, 1.0f);
animation.setDuration(500);
set.addAnimation(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(500);
set.addAnimation(animation);
RelativeLayout configBar = findViewById(R.id.baridhere);
configBar.setVisibility(View.VISIBLE);
configBar.startAnimation(set);
}

No comments:

Post a Comment