Android Open Source - iSlide Main Menu Activity






From Project

Back to project page iSlide.

License

The source code is released under:

MIT License

If you think the Android project iSlide 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 edu.csun.group2.islide;
//ww  w .j  a va  2s . c  o m
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Button;

public class MainMenuActivity extends Activity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main_menu);
    setButtonHandlers();
  }

  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main_menu, menu);
    return true;
  }
  private void setButtonHandlers() {
      ((Button) findViewById(R.id.btn_play)).setOnClickListener(btnClick);
      ((Button) findViewById(R.id.btn_settings)).setOnClickListener(btnClick);
      ((Button) findViewById(R.id.btn_highscores)).setOnClickListener(btnClick);
  }
  private View.OnClickListener btnClick = new View.OnClickListener() {
      @Override
      public void onClick(View v) {
          switch (v.getId()) {
              case R.id.btn_play: {
                Intent play = new Intent(MainMenuActivity.this, PlayMenu.class);
                startActivity(play);
                  break;
              }
              case R.id.btn_settings: {
                Intent settings = new Intent(MainMenuActivity.this, SettingsMenu.class);
                startActivity(settings);
                  break;
              }
              case R.id.btn_highscores: {
                Intent highscores = new Intent(MainMenuActivity.this, HighScore.class);
                startActivity(highscores);
                  break;
              }
          }
      }
  };

}




Java Source Code List

edu.csun.group2.islide.CameraPreview.java
edu.csun.group2.islide.HighScore.java
edu.csun.group2.islide.MainActivity.java
edu.csun.group2.islide.MainMenuActivity.java
edu.csun.group2.islide.PhotoHandler.java
edu.csun.group2.islide.PlayMenu.java
edu.csun.group2.islide.SelectImageActivity.java
edu.csun.group2.islide.SettingsMenu.java
edu.csun.group2.islide.TakePictureActivity.java
edu.csun.group2.islide.UtilityInfo.java
edu.csun.group2.islide.Utility.java
edu.csun.group2.islide.engine.BoardTest.java
edu.csun.group2.islide.engine.Board.java
edu.csun.group2.islide.engine.GameBoardTest.java
edu.csun.group2.islide.engine.GameBoard.java
edu.csun.group2.islide.engine.GameManager.java
edu.csun.group2.islide.engine.InputHandler.java
edu.csun.group2.islide.engine.MoveComparator.java
edu.csun.group2.islide.engine.MoveTest.java
edu.csun.group2.islide.engine.Move.java
edu.csun.group2.islide.engine.Pair.java
edu.csun.group2.islide.engine.entity.SlideTile.java
edu.csun.group2.islide.engine.entity.TileManager.java
edu.csun.group2.islide.global.GameInfo.java
edu.csun.group2.islide.interfaces.IRenderable.java
edu.csun.group2.islide.iSlide.java