Android Open Source - donatello-y-raphael Play Activity






From Project

Back to project page donatello-y-raphael.

License

The source code is released under:

MIT License

If you think the Android project donatello-y-raphael listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.example.ATracePath;
// www  . ja  va  2s.  com
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

/**
 * Created by yngvi on 8.9.2014.
 */
public class PlayActivity extends Activity {
    private Global global = Global.getInstance();

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.play);

        final TextView mapsName = (TextView) findViewById(R.id.boardName);

        String name = global.mPacks.get(global.packID).getChallenge().get(global.challengeID).getName();
        mapsName.setText(name + " - " + String.valueOf(global.puzzleID + 1));

        global.nextLevelBtn = (Button) findViewById(R.id.next_level);
    }

    public void onClick(View view) {
        global.levelFinished = false;
        global.puzzleID++;
        if (global.puzzleID >= global.mPacks.get(global.packID).getChallenge().get(global.challengeID).getPuzzleList().size()) {
            global.challengeID++;
            global.puzzleID = 0;
            if (global.challengeID >= global.mPacks.get(global.packID).getChallenge().size()) {
                Intent intent = new Intent(this, LevelsActivity.class);
                startActivity(intent);
                return;
            }
        }
        view.setVisibility(View.INVISIBLE);
        recreate();
    }
}




Java Source Code List

com.example.ATracePath.Board.java
com.example.ATracePath.Cellpath.java
com.example.ATracePath.Challenge.java
com.example.ATracePath.Coordinate.java
com.example.ATracePath.DbHelper.java
com.example.ATracePath.Global.java
com.example.ATracePath.LevelsActivity.java
com.example.ATracePath.MainActivity.java
com.example.ATracePath.MapsActivity.java
com.example.ATracePath.Pack.java
com.example.ATracePath.PlayActivity.java
com.example.ATracePath.ProgressAdapter.java
com.example.ATracePath.Puzzle.java
com.example.ATracePath.SettingsActivity.java