dimanche 3 mai 2015

moving Image View from point to another

good morning/evening everyone i want when a particular button clicked, the image view will move from a point in the layout to another point

here's my code

  int e = 0 ;  
  Button d = (Button)findViewById(R.id.button1);
  d.setOnClickListener(new OnClickListener()

  {

    @Override
    public void onClick(View v)  
     {   TranslateAnimation move = new TranslateAnimation(e,e+1, e, e+1);
        move.setDuration(1000 );
        move.setFillAfter(true);
       image.startAnimation(move);}


 });

but when i clicked the button nothing happend ! how to make it work ?

Aucun commentaire:

Enregistrer un commentaire