Android Open Source - Phylane Load Screen






From Project

Back to project page Phylane.

License

The source code is released under:

COPYRIGHT 2014 TRISTON JONES

If you think the Android project Phylane 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.lvadt.phylane.activity;
/*w  w w  .j  a v  a  2s .c  o m*/
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import com.lvadt.phylane.R;
import com.lvadt.phylane.model.LoadingScreens;

/**
 * Created by Triston on 4/12/2014.
 * Handles the time between two activities
 */
public class LoadScreen extends Activity implements Runnable{

    Class<?> target;
    TextView message;
    ImageView image;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.loadscreen);

        image = (ImageView) findViewById(R.id.ivLoadingScreen);
        message = (TextView) findViewById(R.id.tvLoadFact);

        LoadingScreens.Screen s = LoadingScreens.randomLoadScreen();
        image.setImageResource(s.id);
        message.setText(s.message);
        if(s.color != -1){
            message.setTextColor(s.color);
        }

        String classname;
        classname = getIntent().getStringExtra("class");
        try {
            target = Class.forName(classname);
        }
        catch(Exception e) {
            e.printStackTrace();
        }

        //Thread that just loads image and message for now
        Thread t = new Thread(this);
        t.start();

    }

    @Override
    public void run() {
        synchronized(this){
            try {
                //this.wait(3000);
                Intent i = new Intent(LoadScreen.this, target);
                //Loads aren't currently that long
                startActivity(i);
                LoadScreen.this.finish();
            }
            catch(Exception e){
                e.printStackTrace();
            }
        }
    }
}




Java Source Code List

com.lvadt.phylane.BuildConfig.java
com.lvadt.phylane.activity.Fly.java
com.lvadt.phylane.activity.HomeScreen.java
com.lvadt.phylane.activity.LevelComplete.java
com.lvadt.phylane.activity.LoadScreen.java
com.lvadt.phylane.activity.MainMenu.java
com.lvadt.phylane.activity.MessagePopup.java
com.lvadt.phylane.activity.Prefs.java
com.lvadt.phylane.activity.Splash.java
com.lvadt.phylane.activity.Store.java
com.lvadt.phylane.activity.Tutorial.java
com.lvadt.phylane.graphics.GLRenderer.java
com.lvadt.phylane.graphics.Sprite.java
com.lvadt.phylane.model.GameObject.java
com.lvadt.phylane.model.Level.java
com.lvadt.phylane.model.LoadingScreens.java
com.lvadt.phylane.model.Objects.java
com.lvadt.phylane.model.Plane.java
com.lvadt.phylane.model.Player.java
com.lvadt.phylane.model.WorldObject.java
com.lvadt.phylane.physics.Physics.java
com.lvadt.phylane.utils.Data.java
com.lvadt.phylane.utils.OnSwipeTouchListener.java
com.lvadt.phylane.utils.Sound.java