Android Open Source - FileShare Splash Activity






From Project

Back to project page FileShare.

License

The source code is released under:

MIT License

If you think the Android project FileShare 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.csyangchsh.fileshare;
//  w  w w  .  j a va2 s. c  om
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.MotionEvent;
import android.widget.Toast;


/**
 * @author csyangchsh
 * 2014-08-28
 */
public class SplashActivity extends Activity {
    protected volatile boolean mActive = true;
    protected int mSplashTime = 2500;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        Thread splashTread = new Thread() {
            @Override
            public void run() {
                try {
                    int waited = 0;
                    while (mActive && (waited < mSplashTime)) {
                        sleep(100);
                        if (mActive) {
                            waited += 100;
                        }
                    }
                } catch (InterruptedException e) {
                    // do nothing
                } finally {
                    finish();
                    startActivity(new Intent(SplashActivity.this, FileActivity.class));
                }
            }
        };
        splashTread.start();
        //Check wifi status
        if(!FSApplication.isWifi()) {
            Toast.makeText(getApplicationContext(), R.string.wifi_toast, Toast.LENGTH_LONG).show();
        }
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        if (event.getAction() == MotionEvent.ACTION_DOWN) {
            mActive = false;
        }
        return true;
    }
}




Java Source Code List

com.csyangchsh.fileshare.ApplicationTest.java
com.csyangchsh.fileshare.FSApplication.java
com.csyangchsh.fileshare.FileActivity.java
com.csyangchsh.fileshare.FileListAdapter.java
com.csyangchsh.fileshare.FileService.java
com.csyangchsh.fileshare.SplashActivity.java
com.csyangchsh.fileshare.util.DefaultFileFilter.java
com.csyangchsh.fileshare.util.FileHandler.java
com.csyangchsh.fileshare.util.MiniFileServer.java
com.csyangchsh.fileshare.util.TempFileFactory.java
com.csyangchsh.fileshare.util.Util.java