mirror of
https://github.com/wulkanowy/wulkanowy.git
synced 2025-01-19 00:16:48 -06:00
Delete StartedActivity and replace it by SplashActivity
This commit is contained in:
parent
6415e673c8
commit
b5b6420b00
@ -13,8 +13,8 @@
|
|||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@android:style/Theme.DeviceDefault">
|
android:theme="@android:style/Theme.DeviceDefault">
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.started.StartedActivity"
|
android:name=".activity.splash.SplashActivity"
|
||||||
android:theme = "@style/NoActionBar">
|
android:theme = "@style/SplashTheme">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
@ -1,35 +0,0 @@
|
|||||||
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<Void, Void, Void> {
|
|
||||||
|
|
||||||
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);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
|||||||
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();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
13
app/src/main/res/drawable/background_splash.xml
Normal file
13
app/src/main/res/drawable/background_splash.xml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:drawable="@color/gray"/>
|
||||||
|
|
||||||
|
<item>
|
||||||
|
<bitmap
|
||||||
|
android:gravity="center"
|
||||||
|
android:src="@mipmap/ic_launcher"/>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
</layer-list>
|
@ -1,53 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<android.support.constraint.ConstraintLayout
|
|
||||||
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
tools:context="leszcz_team.wulkanowy.activity.started.StartedActivity"
|
|
||||||
tools:layout_editor_absoluteY="0dp"
|
|
||||||
tools:layout_editor_absoluteX="0dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/nameApp"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/app_name"
|
|
||||||
android:textSize="40sp"
|
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
|
||||||
tools:layout_constraintRight_creator="1"
|
|
||||||
tools:layout_constraintBottom_creator="1"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
tools:layout_constraintLeft_creator="1"
|
|
||||||
android:layout_marginBottom="185dp" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/logoImage"
|
|
||||||
android:layout_width="201dp"
|
|
||||||
android:layout_height="176dp"
|
|
||||||
android:src="@drawable/logo_image"
|
|
||||||
tools:layout_constraintRight_creator="1"
|
|
||||||
tools:layout_constraintBottom_creator="1"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/nameApp"
|
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
|
||||||
tools:layout_constraintLeft_creator="1"
|
|
||||||
android:layout_marginBottom="29dp"
|
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
|
||||||
app:layout_constraintHorizontal_bias="0.502" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/rawText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/under_logo"
|
|
||||||
tools:layout_constraintTop_creator="1"
|
|
||||||
tools:layout_constraintRight_creator="1"
|
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
|
||||||
android:layout_marginTop="57dp"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/nameApp"
|
|
||||||
tools:layout_constraintLeft_creator="1"
|
|
||||||
app:layout_constraintLeft_toLeftOf="parent" />
|
|
||||||
</android.support.constraint.ConstraintLayout>
|
|
@ -3,4 +3,5 @@
|
|||||||
<color name="colorPrimary">#3F51B5</color>
|
<color name="colorPrimary">#3F51B5</color>
|
||||||
<color name="colorPrimaryDark">#303F9F</color>
|
<color name="colorPrimaryDark">#303F9F</color>
|
||||||
<color name="colorAccent">#FF4081</color>
|
<color name="colorAccent">#FF4081</color>
|
||||||
|
<color name="gray">#444440</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -8,9 +8,8 @@
|
|||||||
<item name="colorAccent">@color/colorAccent</item>
|
<item name="colorAccent">@color/colorAccent</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name = "NoActionBar" parent = "@android:style/Theme.DeviceDefault">
|
<style name="SplashTheme" parent="@android:style/Theme.DeviceDefault">
|
||||||
<item name = "android:windowActionBar">false</item>
|
<item name="android:windowBackground">@drawable/background_splash</item>
|
||||||
<item name = "android:windowNoTitle">true</item>
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user