Screen Splash

This commit is contained in:
2023-02-06 14:24:15 +01:00
parent 27dae2ff73
commit e25b486fe7
7 changed files with 111 additions and 4 deletions

View File

@@ -17,16 +17,26 @@
android:supportsRtl="true"
android:theme="@style/Theme.NavigationDrawer">
<activity
android:name=".MainActivity"
android:exported="true"
android:theme="@style/Theme.NavigationDrawer.NoActionBar"
android:screenOrientation="portrait">
android:name=".SplashActivity"
android:theme="@style/splashTheme"
android:screenOrientation="portrait"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:exported="true"
android:screenOrientation="portrait"
android:theme="@style/Theme.NavigationDrawer.NoActionBar">
</activity>
<activity
android:name=".MailActivity"
android:screenOrientation="portrait" />

View File

@@ -0,0 +1,35 @@
package fr.svpro.radiomercure;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.widget.TextView;
public class SplashActivity extends AppCompatActivity {
Handler mHandler;
Runnable mRunnable;
TextView tvVersion;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
tvVersion = findViewById(R.id.tv_version);
tvVersion.setText(getString(R.string.app_version) + BuildConfig.VERSION_NAME);
mHandler = new Handler();
mRunnable = new Runnable() {
@Override
public void run() {
Intent intent = new Intent(SplashActivity.this,MainActivity.class);
startActivity(intent);
finish();
}
};
// its trigger runnable after 4000 millisecond.
mHandler.postDelayed(mRunnable,4000);
}
}

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<gradient
android:type="linear"
android:angle="135"
android:startColor="#ff1b49"
android:endColor="#e67d20" />
</shape>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:drawable="@drawable/bg_gradient"/>
<item>
<bitmap android:gravity="center"
android:src="@drawable/logo_menu"/>
</item>
</layer-list>

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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=".SplashActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="50dp"
android:layout_gravity="center"
android:textSize="30dp"
android:textColor="@color/white"
android:textStyle="bold"
android:text="@string/splash_txt" />
<TextView
android:id="@+id/tv_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/app_version"
android:textAlignment="center"
android:textColor="@color/white"
android:textStyle="bold" />
</LinearLayout>
</RelativeLayout>

View File

@@ -42,5 +42,6 @@
<string name="toast_live">Vous écoutez Radio Mercure en direct</string>
<string name="btn_envoyer">Envoyer</string>
<string name="btn_annuler">Annuler</string>
<string name="splash_txt">Bienvenue...</string>
</resources>

View File

@@ -20,4 +20,10 @@
</style>
<style name="Theme.NavigationDrawer.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
<style name="Theme.NavigationDrawer.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>
<style name="splashTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="android:windowBackground">@drawable/splash_background</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowTranslucentNavigation">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
</style>
</resources>