仿猜歌游戏做的,已实现大部分功能,包括话费金币购买提示功能,非常适合学习使用。


public class MainActivity extends Activity implements iWordButtonClickListener {
// 待选文字数量
public final static int COUNTS_WORDS = 24;
// 答案正确
public final static int ANSWER_RIGHT = 1;
// 答案错误
public final static int ANSWER_WRONG = 2;
// 答案不完整
public final static int ANSWER_LACK = 3;
public final static int ID_DIALOG_DELET_WORD = 1;
public final static int ID_DIALOG_TIP_WORD = 2;
public final static int ID_DIALOG_LACK_COINS_WORD = 3;
// 文字闪烁次数
public final static int SPARD_TIME = 6;
// 唱片,拨杆,开始按钮动画
private Animation mDiscAnim, mDiscBarInAnim, mDiscBarOutAnim;
private LinearInterpolator mDiscLin, mDiscBarInLin, mDiscBarOutLin;
// 唱片,拨杆,开始按钮
private ImageView mViewDisc, mViewDiscBar;
private ImageButton mbtnGameStart;
// 当前动画是否运行
private boolean mIsRunning = false;
// 已选,待选文字框容器
private ArrayList<wordbutton> mAllWords, mSelWords;
// 待选文字框控件
private MyGridView mMyGridView;
// 已选择文字框的布局控件
private LinearLayout mViewWordsContainer;
// 关卡引索
private int mCurrentIndex;
private TextView mTextPassIndex;
private TextView mTextCurrentIndex;
// 当前关卡歌曲
private GetSong mCurrentSong;
private TextView mTextCurrentPassSongName;
// 过关界面
private LinearLayout mPassEvent;
// 已选文字提示按钮,待选文字删除按钮, 分享按钮
private ImageButton mBtnTip, mBtnDelet;
// 已拥有的金币数量
private TextView mTextCurrentCoin;
private int mCurrentCoins;</wordbutton>