Android Open Source - hacktoolkit-android_lib H T K Splash Screen Activity






From Project

Back to project page hacktoolkit-android_lib.

License

The source code is released under:

MIT License

If you think the Android project hacktoolkit-android_lib 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 com.hacktoolkit.android.activities;
/*from   w  ww .  ja v  a 2  s. co  m*/
import android.app.ActionBar;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import com.hacktoolkit.android.utils.HTKUtils;
import com.hacktoolkit.android.utils.SystemUiHider;

/**
 * An example full-screen activity that shows and hides the system UI (i.e.
 * status bar and navigation/system bar) with user interaction.
 * 
 * @see SystemUiHider
 */
public abstract class HTKSplashScreenActivity extends Activity {
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    int layoutId = getLayoutId();
    setContentView(layoutId);
    runSplashThread();
  }

  public void runSplashThread() {
    final int splashDuration = getSplashDurationMillis();
    final Activity currentActivity = this;
    Thread splashThread = new Thread() {
      @Override
      public void run() {
        try {
          int waited = 0;
          while (waited < splashDuration) {
            sleep(100);
            waited += 100;
          }
        } catch (InterruptedException e) {
          // do nothing
        } finally {
          Intent intent = getNextActivity();
          HTKUtils.switchActivity(currentActivity, intent);
        }
      }
    };
    splashThread.start();
  }
  protected abstract int getLayoutId();
  protected abstract int getSplashDurationMillis();
  protected abstract Intent getNextActivity();
}




Java Source Code List

com.hacktoolkit.android.activities.HTKSplashScreenActivity.java
com.hacktoolkit.android.adapters.HTKContactsAdapter.java
com.hacktoolkit.android.api_helpers.FacebookHelper.java
com.hacktoolkit.android.api_helpers.HTKCallback.java
com.hacktoolkit.android.api_helpers.ParseHelper.java
com.hacktoolkit.android.constants.GeoConstants.java
com.hacktoolkit.android.constants.StringConstants.java
com.hacktoolkit.android.constants.TimeConstants.java
com.hacktoolkit.android.constants.UnitConstants.java
com.hacktoolkit.android.fragments.ContactsFragment.java
com.hacktoolkit.android.maps.MapUtils.java
com.hacktoolkit.android.maps.Mapper.java
com.hacktoolkit.android.models.HTKContact.java
com.hacktoolkit.android.user.HTKUser.java
com.hacktoolkit.android.utils.BitmapUtils.java
com.hacktoolkit.android.utils.ContactsUtils.java
com.hacktoolkit.android.utils.FileUtils.java
com.hacktoolkit.android.utils.HTKUtils.java
com.hacktoolkit.android.utils.SystemUiHiderBase.java
com.hacktoolkit.android.utils.SystemUiHiderHoneycomb.java
com.hacktoolkit.android.utils.SystemUiHider.java