Android Open Source - polygons Main Activity






From Project

Back to project page polygons.

License

The source code is released under:

GNU General Public License

If you think the Android project polygons 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.github.polygons;
//from w  w w . ja  va2  s. c om
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.github.polygons.logic.CustomAudioManager;
import com.google.analytics.tracking.android.EasyTracker;
import com.google.example.games.basegameutils.BaseGameActivity;
import com.nobcatz.android.polygons.R;


public class MainActivity extends BaseGameActivity implements View.OnClickListener{
    private CustomAudioManager audioManager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        //noinspection MagicConstant
        setRequestedOrientation(getResources().getInteger(R.integer.orientation));
        setContentView(R.layout.activity_main);
        initializeAudioManager();

     //   findViewById(R.id.button_sign_in).setOnClickListener(this);
       // findViewById(R.id.button_sign_out).setOnClickListener(this);


    }

    @Override
    public void onStart() {
        super.onStart();
        EasyTracker.getInstance(this).activityStart(this);
    }

    @Override
    public void onStop() {
        super.onStop();
        EasyTracker.getInstance(this).activityStop(this);
    }


    public void newGame(View v) {
        Intent intent = new Intent(this, LevelActivity.class);
        intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
        startActivity(intent);
    }

    private void initializeAudioManager() {
  //      audioManager = CustomAudioManager.getInstance(this, R.raw.background_sound);
   //     audioManager.playBackgroundMusic();
    }

    @Override
    public void onSignInFailed() {
        showSignInButton();
    }

    @Override
    public void onSignInSucceeded() {
        showSignOutButton();
    }

    private void showSignInButton() {
       // findViewById(R.id.button_sign_in).setVisibility(View.VISIBLE);
       // findViewById(R.id.button_sign_out).setVisibility(View.GONE);
    }

    private void showSignOutButton() {
       // findViewById(R.id.button_sign_in).setVisibility(View.GONE);
       // findViewById(R.id.button_sign_out).setVisibility(View.VISIBLE);
    }

    @Override
    public void onClick(View v) {
/*
        switch (v.getId()) {

            case R.id.button_sign_in:
                // user wants to sign in
                beginUserInitiatedSignIn();
                break;
            case R.id.button_sign_out:
                signOut();
                break;

        } */

    }
}




Java Source Code List

com.github.polygons.FigureListActivity.java
com.github.polygons.GameActivity.java
com.github.polygons.LevelActivity.java
com.github.polygons.LostActivity.java
com.github.polygons.MainActivity.java
com.github.polygons.figures.Figure.java
com.github.polygons.figures.Oval.java
com.github.polygons.figures.Square.java
com.github.polygons.figures.Triangle.java
com.github.polygons.logic.CustomAudioManager.java
com.github.polygons.logic.FigureGenerator.java
com.github.polygons.logic.Keeper.java
com.google.example.games.basegameutils.BaseGameActivity.java
com.google.example.games.basegameutils.GameHelper.java