Skip to content

Instantly share code, notes, and snippets.

@valllllll2000
Created October 27, 2012 11:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save valllllll2000/3964385 to your computer and use it in GitHub Desktop.
Save valllllll2000/3964385 to your computer and use it in GitHub Desktop.
MyActivity for Animations
public class MyActivity extends Activity {
private Animation a;
private ImageView im;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
a = AnimationUtils.loadAnimation(this, R.anim.scaletranslate);
a.reset();
im = (ImageView)findViewById(R.id.imageView1);
im.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
im.clearAnimation();
im.startAnimation(a);
}
});
}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment