From 9ad8bcef0a6fbc0ade456fdb4b9a8a2bac6f0a24 Mon Sep 17 00:00:00 2001 From: RicomenPL Date: Sun, 9 Apr 2017 13:05:59 +0000 Subject: [PATCH] Revert "Merge branch 'new-splashscreen' into 'master'" This reverts merge request !4 --- app/src/main/AndroidManifest.xml | 4 +- .../activity/splash/SplashActivity.java | 19 ------- .../activity/started/LoadingTask.java | 35 ++++++++++++ .../activity/started/StartedActivity.java | 22 ++++++++ .../main/res/drawable/background_splash.xml | 13 ----- app/src/main/res/layout/activity_started.xml | 53 +++++++++++++++++++ app/src/main/res/values/colors.xml | 1 - app/src/main/res/values/styles.xml | 5 +- 8 files changed, 115 insertions(+), 37 deletions(-) delete mode 100644 app/src/main/java/leszcz_team/wulkanowy/activity/splash/SplashActivity.java create mode 100644 app/src/main/java/leszcz_team/wulkanowy/activity/started/LoadingTask.java create mode 100644 app/src/main/java/leszcz_team/wulkanowy/activity/started/StartedActivity.java delete mode 100644 app/src/main/res/drawable/background_splash.xml create mode 100644 app/src/main/res/layout/activity_started.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 948fdc02..9b574779 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -13,8 +13,8 @@ android:supportsRtl="true" android:theme="@android:style/Theme.DeviceDefault"> + android:name=".activity.started.StartedActivity" + android:theme = "@style/NoActionBar"> diff --git a/app/src/main/java/leszcz_team/wulkanowy/activity/splash/SplashActivity.java b/app/src/main/java/leszcz_team/wulkanowy/activity/splash/SplashActivity.java deleted file mode 100644 index 3ff6b20f..00000000 --- a/app/src/main/java/leszcz_team/wulkanowy/activity/splash/SplashActivity.java +++ /dev/null @@ -1,19 +0,0 @@ -package leszcz_team.wulkanowy.activity.splash; - -import leszcz_team.wulkanowy.activity.main.MainActivity; - -import android.content.Intent; -import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; - -public class SplashActivity extends AppCompatActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - Intent intent = new Intent(this, MainActivity.class); - startActivity(intent); - finish(); - } -} diff --git a/app/src/main/java/leszcz_team/wulkanowy/activity/started/LoadingTask.java b/app/src/main/java/leszcz_team/wulkanowy/activity/started/LoadingTask.java new file mode 100644 index 00000000..4e785b0c --- /dev/null +++ b/app/src/main/java/leszcz_team/wulkanowy/activity/started/LoadingTask.java @@ -0,0 +1,35 @@ +package leszcz_team.wulkanowy.activity.started; + + +import android.content.Context; +import android.content.Intent; +import android.os.AsyncTask; + +import leszcz_team.wulkanowy.activity.main.MainActivity; + +public class LoadingTask extends AsyncTask { + + Context activity; + + LoadingTask(Context main) { + activity = main; + } + + @Override + protected Void doInBackground(Void... voids) { + try { + Thread.sleep(500); + } catch (InterruptedException e) { + e.printStackTrace(); + } + return null; + } + + protected void onPostExecute(Void result) { + + Intent intent = new Intent(activity,MainActivity.class); + activity.startActivity(intent); + + } +} + diff --git a/app/src/main/java/leszcz_team/wulkanowy/activity/started/StartedActivity.java b/app/src/main/java/leszcz_team/wulkanowy/activity/started/StartedActivity.java new file mode 100644 index 00000000..5ccd8274 --- /dev/null +++ b/app/src/main/java/leszcz_team/wulkanowy/activity/started/StartedActivity.java @@ -0,0 +1,22 @@ +package leszcz_team.wulkanowy.activity.started; + +import android.app.Activity; +import android.os.Bundle; + +import leszcz_team.wulkanowy.R; + +public class StartedActivity extends Activity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_started); + Task(); + } + + public void Task(){ + + new LoadingTask(this).execute(); + + } +} diff --git a/app/src/main/res/drawable/background_splash.xml b/app/src/main/res/drawable/background_splash.xml deleted file mode 100644 index fdfde169..00000000 --- a/app/src/main/res/drawable/background_splash.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - diff --git a/app/src/main/res/layout/activity_started.xml b/app/src/main/res/layout/activity_started.xml new file mode 100644 index 00000000..ac1003b0 --- /dev/null +++ b/app/src/main/res/layout/activity_started.xml @@ -0,0 +1,53 @@ + + + + + + + + + diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 65c4d2bf..3ab3e9cb 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -3,5 +3,4 @@ #3F51B5 #303F9F #FF4081 - #444440 diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 28cd0713..e98aa4f3 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -8,8 +8,9 @@ @color/colorAccent -