Android Open Source - android-chess start






From Project

Back to project page android-chess.

License

The source code is released under:

MIT License

If you think the Android project android-chess 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 jwtc.android.chess;
//from   w  w w  .j ava 2  s .c  om
import jwtc.android.chess.puzzle.practice;
import jwtc.android.chess.puzzle.puzzle;
import jwtc.android.chess.tools.pgntool;
import jwtc.android.chess.convergence.ConvergenceActivity;
import jwtc.android.chess.ics.*;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

public class start extends Activity/*ListActivity*/  {
  
  //private ListView _lvStart;
  public static final String TAG = "start";
  
  /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        
        setContentView(R.layout.start);        
        
        //final CharSequence[] arrString;
        //arrString = getResources().getTextArray(R.array.start_menu); 
        
        OnClickListener ocl = new OnClickListener() {
          public void onClick(View arg0) {
            Button b = (Button)arg0;
            try{
          Intent i = new Intent();
          String s = b.getText().toString();
          Log.i("start", s);
          if(s.equals(getString(R.string.start_play))){
            i.setClass(start.this, main.class); 
            i.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
            startActivity(i); 
          } else if(s.equals(getString(R.string.start_practice))){
            i.setClass(start.this, practice.class); 
            i.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
            startActivity(i); 
          } else if(s.equals(getString(R.string.start_puzzles))){
            i.setClass(start.this, puzzle.class); 
            i.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
            startActivity(i); 
          } else if(s.equals(getString(R.string.start_about))){
            i.setClass(start.this, HtmlActivity.class);
            i.putExtra(HtmlActivity.HELP_MODE, "about");
            startActivity(i); 
          } else if(s.equals(getString(R.string.start_ics))){
            i.setClass(start.this, ICSClient.class);
            startActivity(i); 
          } else if(s.equals(getString(R.string.start_pgn))){
            i.setClass(start.this, pgntool.class); 
            i.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
            startActivity(i); 
          } else if (s.equals(getString(R.string.start_globalpreferences))){
            i.setClass(start.this, ChessPreferences.class);
            startActivity(i); 
          } else if (s.equals(getString(R.string.menu_help))){
            i.setClass(start.this, HtmlActivity.class);
            i.putExtra(HtmlActivity.HELP_MODE, "help");
            startActivity(i);
          } else if(s.equals(getString(R.string.start_convergence))){
            i.setClass(start.this, ConvergenceActivity.class);
            i.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
            startActivity(i); 
          } 
          
        } catch(Exception ex){
          Toast t = Toast.makeText(start.this, "Could not start the activity", Toast.LENGTH_LONG);
          t.setGravity(Gravity.BOTTOM, 0, 0);
          t.show();
        }
          }
        };
        
        ((Button)findViewById(R.id.StartButtonPlay)).setOnClickListener(ocl);
        ((Button)findViewById(R.id.StartButtonPractice)).setOnClickListener(ocl);
        ((Button)findViewById(R.id.StartButtonPuzzles)).setOnClickListener(ocl);
        ((Button)findViewById(R.id.StartButtonICS)).setOnClickListener(ocl);
        ((Button)findViewById(R.id.StartButtonPreferences)).setOnClickListener(ocl);
        //((Button)findViewById(R.id.StartButtonAbout)).setOnClickListener(ocl);
        ((Button)findViewById(R.id.StartButtonAdvanced)).setOnClickListener(ocl);
        ((Button)findViewById(R.id.StartButtonHelp)).setOnClickListener(ocl);
        ((Button)findViewById(R.id.StartButtonConvergence)).setOnClickListener(ocl);

       
        //Connection con = new Connection();
       
        /*
        _lvStart =(ListView)findViewById(android.R.id.list);
        
        _lvStart.setOnItemClickListener(new OnItemClickListener(){

      @Override
      public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
        try{
          Intent i = new Intent();
          if(arrString[arg2].equals(getString(R.string.start_play))){
            i.setClass(start.this, main.class); startActivity(i); 
          } else if(arrString[arg2].equals(getString(R.string.start_practice))){
            i.setClass(start.this, practice.class); startActivity(i); 
          } else if(arrString[arg2].equals(getString(R.string.start_puzzles))){
            i.setClass(start.this, puzzle.class); startActivity(i); 
          } else if(arrString[arg2].equals(getString(R.string.start_about))){
            i.setClass(start.this, HtmlActivity.class);
            i.putExtra(HtmlActivity.HELP_MODE, "about");
            startActivity(i); 
          } else if(arrString[arg2].equals(getString(R.string.start_ics))){
            i.setClass(start.this, ICSClient.class);
            startActivity(i); 
          } else if(arrString[arg2].equals(getString(R.string.start_pgn))){
            i.setClass(start.this, pgntool.class); startActivity(i); 
          } else if (arrString[arg2].equals(getString(R.string.start_globalpreferences))){
            i.setClass(start.this, ChessPreferences.class);
            startActivity(i); 
          } else if (arrString[arg2].equals(getString(R.string.start_exit))){
            finish();
          }
        } catch(Exception ex){
          Toast t = Toast.makeText(start.this, "Could not start the activity", Toast.LENGTH_LONG);
          t.setGravity(Gravity.BOTTOM, 0, 0);
          t.show();
        }
      }
        });
        */
    }
    
    
   
}




Java Source Code List

jwtc.android.chess.ChessFieldView.java
jwtc.android.chess.ChessImageView.java
jwtc.android.chess.ChessPreferences.java
jwtc.android.chess.ChessViewBase.java
jwtc.android.chess.ChessView.java
jwtc.android.chess.GamesListView.java
jwtc.android.chess.HtmlActivity.java
jwtc.android.chess.ImageCacheObject.java
jwtc.android.chess.MyBaseActivity.java
jwtc.android.chess.MyPGNProvider.java
jwtc.android.chess.PGNView.java
jwtc.android.chess.SaveGameDlg.java
jwtc.android.chess.UI.java
jwtc.android.chess.convergence.Connection.java
jwtc.android.chess.convergence.ConvergenceActivity.java
jwtc.android.chess.convergence.RestServer.java
jwtc.android.chess.iconifiedlist.IconifiedTextListAdapter.java
jwtc.android.chess.iconifiedlist.IconifiedTextView.java
jwtc.android.chess.iconifiedlist.IconifiedText.java
jwtc.android.chess.ics.CustomCommands.java
jwtc.android.chess.ics.ICSChatDlg.java
jwtc.android.chess.ics.ICSChessView.java
jwtc.android.chess.ics.ICSClient.java
jwtc.android.chess.ics.ICSConfirmDlg.java
jwtc.android.chess.ics.ICSMatchDlg.java
jwtc.android.chess.ics.TelnetSocket.java
jwtc.android.chess.ics.TimesealInputStream.java
jwtc.android.chess.ics.TimesealOutputStream.java
jwtc.android.chess.ics.TimesealPipe.java
jwtc.android.chess.ics.TimesealingSocket.java
jwtc.android.chess.puzzle.ChessViewPractice.java
jwtc.android.chess.puzzle.ChessViewPuzzle.java
jwtc.android.chess.puzzle.MyPuzzleProvider.java
jwtc.android.chess.puzzle.practice.java
jwtc.android.chess.puzzle.puzzle.java
jwtc.android.chess.tools.FileListView.java
jwtc.android.chess.tools.PGNProcessor.java
jwtc.android.chess.tools.importactivity.java
jwtc.android.chess.tools.pgntool.java
jwtc.android.chess.main.java
jwtc.android.chess.options.java
jwtc.android.chess.setup.java
jwtc.android.chess.start.java
jwtc.android.timeseal.TimesealingSocket.java
jwtc.android.timeseal.streams.a.java
jwtc.android.timeseal.streams.b.java
jwtc.android.timeseal.streams.c.java
jwtc.chess.ChessPuzzleProvider.java
jwtc.chess.GameControl.java
jwtc.chess.JNI.java
jwtc.chess.Move.java
jwtc.chess.PGNColumns.java
jwtc.chess.PGNEntry.java
jwtc.chess.PGNProvider.java
jwtc.chess.Pos.java
jwtc.chess.Valuation.java
jwtc.chess.algorithm.SearchAlgorithmRunner.java
jwtc.chess.algorithm.UCIWrapper.java
jwtc.chess.board.BoardConstants.java
jwtc.chess.board.BoardHashKeys.java
jwtc.chess.board.BoardMembers.java
jwtc.chess.board.BoardStatics.java
jwtc.chess.board.ChessBoard.java