Android Open Source - iSlide Settings Menu






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;
/*w  ww .  j  a v  a2 s.c  o m*/
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.RadioButton;
import android.widget.Toast;

public class SettingsMenu extends Activity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_settings_menu);
    setButtonHandlers();
    RadioButton r;
    switch(Utility.size)
    {
    case 3:
      r = (RadioButton) findViewById(R.id.radio_easy);
      break;
    case 4:
      r = (RadioButton) findViewById(R.id.radio_medium);
      break;
    case 5:
      r = (RadioButton) findViewById(R.id.radio_hard);
      break;
    default:
      r = (RadioButton) findViewById(R.id.wtfRadio);
      break;
    }
    r.setChecked(true);
    if(Utility.sound)
    {
      CheckBox c = (CheckBox) findViewById(R.id.checkBox_music);
      c.setChecked(true);
    }
    if(Utility.showNumbers)
    {
      CheckBox c = (CheckBox) findViewById(R.id.checkBox_numbers);
      c.setChecked(true);
    }
  }

  private void setButtonHandlers() {
    ((Button) findViewById(R.id.btn_about)).setOnClickListener(btnClick);
  }

  public void RadioGroup_Click(View view) {
    switch (view.getId()) {
    case R.id.radio_easy: {
      Utility.size = 3;
      break;
    }
    case R.id.radio_medium: {
      Utility.size = 4;
      break;
    }
    case R.id.radio_hard: {
      Utility.size = 5;
      break;
    }
    case R.id.wtfRadio:{
      Utility.size = 8;
    }
    }
  }

  public void SoundEnabled_onClick(View v) {
    CheckBox c = (CheckBox) findViewById(R.id.checkBox_music);
    if (c.isChecked()) {
      Utility.sound = true;
    } else {
      Utility.sound = false;
    }
  }
  public void CheckBoxNumbers_Click(View v)
  {
    CheckBox c = (CheckBox) findViewById(R.id.checkBox_numbers);
    if (c.isChecked()) {
      Utility.showNumbers = true;
    } else {
      Utility.showNumbers = false;
    }
  }
  private View.OnClickListener btnClick = new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      switch (v.getId()) {
      case R.id.btn_about: {
        Toast.makeText(SettingsMenu.this, "Created by:\n\tTyler Thomas\n\tPaul Kirth\n\tDavid Mkrtchyan\n\tDoug Masini\n\tCopyright (c) 2013 All Rights Reserved.",
            Toast.LENGTH_LONG).show();
        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