Android Open Source - blokish Splash Screen






From Project

Back to project page blokish.

License

The source code is released under:

GNU General Public License

If you think the Android project blokish 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 org.scoutant.blokish;
// w w  w.j  a  va  2  s.  co m
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.Window;

public class SplashScreen extends Activity {
  private static final long DELAY = 1500;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.splashscreen);
    long delai = DELAY;
    try {
      FileInputStream fis;
      fis = openFileInput("moves.txt");
      BufferedReader reader = new BufferedReader( new InputStreamReader(fis));
      if (reader.readLine()!=null && reader.readLine()!=null) {
        delai = DELAY / 3;
      }
    } catch (Exception e) {
    }
    handler.sendEmptyMessageDelayed(0, delai);
  }

  private Handler handler = new Handler() {
    @Override
    public void handleMessage(Message msg) {
      startActivityForResult(new Intent(SplashScreen.this, UI.class), 0);
      super.handleMessage(msg);
    }
  };
  
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    finish();
  };
  
}




Java Source Code List

org.scoutant.blokish.AppRater.java
org.scoutant.blokish.BusyIndicator.java
org.scoutant.blokish.ButtonsView.java
org.scoutant.blokish.EndGameDialog.java
org.scoutant.blokish.GameView.java
org.scoutant.blokish.Help.java
org.scoutant.blokish.PieceUI.java
org.scoutant.blokish.RateDialog.java
org.scoutant.blokish.Settings.java
org.scoutant.blokish.SplashScreen.java
org.scoutant.blokish.UI.java
org.scoutant.blokish.model.AI.java
org.scoutant.blokish.model.Board.java
org.scoutant.blokish.model.Game.java
org.scoutant.blokish.model.Move.java
org.scoutant.blokish.model.Piece.java
org.scoutant.blokish.model.Square.java