猿问

拼图游戏不能显示拼图成功,求大神解答

//判断用户是否完成拼图

checkSuccess();

isAniming=false;

}

});

}

//判断用户是否完成拼图

private void checkSuccess() {

boolean isSuccess=true;

for (int i = 0; i < mGamePintuItems.length; i++) {

ImageView imageView=mGamePintuItems[i];

if (getImageIndexByTag((String)imageView.getTag())!=i) {

isSuccess=false;

}

     }

if (isSuccess) {

Log.e("TAG","SUCCESS");

Toast.makeText(getContext(), "Success,Level  up!!!", 

Toast.LENGTH_LONG).show();

  }

}

private int getImageIndexByTag(String tag) {

// TODO Auto-generated method stub

return 0;

}


/*

* 根据Tag获取ID

*/

public int getImageIdByTag(String tag) {

String[] split=tag.split("_");

return Integer.parseInt(split[0]);

}

public int getImageIndex(String tag){

String[] split=tag.split("_");

return Integer.parseInt(split[1]);

}

/*

* 构造我们的动画层

*/

private void setUpAnimLayout() {

if (mAnimLayout==null) {

mAnimLayout=new RelativeLayout(getContext());

addView(mAnimLayout);

}

}


}


慕粉3911145
浏览 1702回答 0
0回答
随时随地看视频慕课网APP

相关分类

Android
我要回答