diff --git a/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/MainActivity.java b/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/MainActivity.java index ca51f9c..ff7bc09 100644 --- a/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/MainActivity.java +++ b/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/MainActivity.java @@ -1,24 +1,56 @@ package org.ntlab.radishforandroidstudio.cactusClient; import android.os.Bundle; +import android.os.Handler; import android.support.v4.app.Fragment; import android.support.v7.app.AppCompatActivity; import org.ntlab.radishforandroidstudio.R; import org.ntlab.radishforandroidstudio.cactusClient.views.LoginFragment; +import org.ntlab.radishforandroidstudio.cactusClient.views.SplashScreenFragment; public class MainActivity extends AppCompatActivity { +// @Override +// protected void onCreate(Bundle savedInstanceState) { +// super.onCreate(savedInstanceState); +// setContentView(R.layout.activity_main); +// +// Fragment fragment; +// fragment = new LoginFragment(); +// getSupportFragmentManager().beginTransaction().add(R.id.fragment_place, fragment).commit(); + + // } + + SplashScreenFragment dialog; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + setTheme(R.style.SplashDialogTheme); setContentView(R.layout.activity_main); - Fragment fragment; - fragment = new LoginFragment(); - getSupportFragmentManager().beginTransaction().add(R.id.fragment_place, fragment).commit(); + openSplashScreenFragment(); } + private void openSplashScreenFragment() { + dialog = new SplashScreenFragment(); +// dialog.show(getFragmentManager(), "dialog"); + + dialog.show(getSupportFragmentManager(),"dialog"); + + Handler handler = new Handler(); + + handler.postDelayed(new Runnable() { + @Override + public void run() { + + dialog.dismiss(); + } + + }, 2000); + } + + }