Android Open Source - abalone-android Splash Acitvity






From Project

Back to project page abalone-android.

License

The source code is released under:

GNU General Public License

If you think the Android project abalone-android 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

/**
* Copyright (c) 2010-2011 Yaroslav Geryatovich, Alexander Yakushev
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*///w ww .j a  v  a  2 s .  c om
package com.bytopia.abalone;

import com.bytopia.abalone.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Window;
import android.view.WindowManager;

public class SplashAcitvity extends Activity {
  long m_dwSplashTime = 2000;
  boolean m_bPaused = false;

  boolean m_bSplashActive = true;

  public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    // Draw the splash screen

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
        WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.splash);
    // Very simple timer thread
    Thread splashTimer = new Thread() {
      public void run() {
        try {
          // Wait loop
          long ms = 0;
          while (m_bSplashActive && ms < m_dwSplashTime) {
            sleep(100);
            // Advance the timer only if we're running.
            if (!m_bPaused)
              ms += 100;
          }
          // Advance to the next screen.
          startActivity(new Intent("com.bytopia.abalone.MAINMENU"));

        } catch (Exception e) {
          Log.e("Splash", e.toString());
        } finally {
          finish();
        }
      }
    };
    splashTimer.start();
  }

  protected void onPause() {
    super.onPause();
    m_bPaused = true;
  }

  protected void onResume() {
    super.onResume();
    m_bPaused = false;
  }

  public boolean onKeyDown(int keyCode, KeyEvent event) {
    // if we get any key, clear the splash screen
    super.onKeyDown(keyCode, event);
    m_bSplashActive = false;
    return true;
  }
}




Java Source Code List

com.bytopia.abalone.BoardRenderer.java
com.bytopia.abalone.BoardView.java
com.bytopia.abalone.GameActivity.java
com.bytopia.abalone.GameOptionsActivity.java
com.bytopia.abalone.LoseBallsView.java
com.bytopia.abalone.MainMenuActivity.java
com.bytopia.abalone.Options.java
com.bytopia.abalone.Scenario.java
com.bytopia.abalone.SelectLayoutActivity.java
com.bytopia.abalone.SplashAcitvity.java
com.bytopia.abalone.TutorialActivity.java
com.bytopia.abalone.TutorialBoardView.java
com.bytopia.abalone.mechanics.AiAnn.java
com.bytopia.abalone.mechanics.AiBeatrice.java
com.bytopia.abalone.mechanics.AiCharlotte.java
com.bytopia.abalone.mechanics.AiDeborah.java
com.bytopia.abalone.mechanics.ArtificialIntilligence.java
com.bytopia.abalone.mechanics.BelgianLayout.java
com.bytopia.abalone.mechanics.Board.java
com.bytopia.abalone.mechanics.Cell.java
com.bytopia.abalone.mechanics.ClassicLayout.java
com.bytopia.abalone.mechanics.ConsoleWatcher.java
com.bytopia.abalone.mechanics.Debug.java
com.bytopia.abalone.mechanics.Direction.java
com.bytopia.abalone.mechanics.EmptyLayout.java
com.bytopia.abalone.mechanics.Game.java
com.bytopia.abalone.mechanics.GermanLayout.java
com.bytopia.abalone.mechanics.Group.java
com.bytopia.abalone.mechanics.Layout.java
com.bytopia.abalone.mechanics.MoveType.java
com.bytopia.abalone.mechanics.Move.java
com.bytopia.abalone.mechanics.Player.java
com.bytopia.abalone.mechanics.Side.java
com.bytopia.abalone.mechanics.TestLayout.java
com.bytopia.abalone.mechanics.Watcher.java