动画上下左右判断1
应该是这样的吧?
if(mImageView.getX()>iv_null_imageView.getX()){
//往左移动
translateAnimation = new TranslateAnimation(0.1f, -mImageView.getWidth(), 0.1f,0.1f );
Toast.makeText(this,"往左移动",Toast.LENGTH_LONG).show();
}else if (mImageView.getX()<iv_null_imageView.getX()){
//往右移动
translateAnimation = new TranslateAnimation(0.1f, mImageView.getWidth(), 0.1f, 0.1f);
}else if (mImageView.getY()>iv_null_imageView.getY()){
//往上移动
translateAnimation = new TranslateAnimation(0.1f,0.1f, 0.1f, -mImageView.getHeight());
}else if (mImageView.getY()<iv_null_imageView.getY()){
//往下移动
translateAnimation = new TranslateAnimation(0.1f,0.1f, 0.1f, mImageView.getHeight());
}