我开发了一个记忆游戏,我在Gridview中有一个图像库..当我执行点击第一个图像时,通过翻转动画,图像打开,这继续下一个图像..当两个图像匹配,我保持在两个图像上执行摆动动画。当摆动动画开始时我禁用我的gridview,并在动画结束时再次启用它..现在最糟糕的情况是如果用户继续点击在这个时间间隔内的其他一些图像上(gridview(禁用) - gridview(启用)),在gridview启用后,它会打开除了需要打开的图像之外的其他图像......
if(firstImage.getId()== secondImage.getId()){
//increse the point score by 100
level_score = level_score + 100;
//disabling gridview for animation to be performed
// gridView.setEnabled(false);
secondImage.startAnimation(wobble);
firstImage.startAnimation(wobble);
wobble.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
secondImage.clearAnimation();
firstImage.clearAnimation();
//
}
@Override
public void onAnimationEnd(Animation animation) {
// TODO Auto-generated method stub
//enabling gridview after the animation ends
firstImage.clearAnimation();
secondImage.clearAnimation();
gridView.clearFocus();
gridView.setEnabled(true);
}
});
请帮忙,因为这会让我继续前进......提前致谢