Screen Splash
This commit is contained in:
@@ -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" />
|
||||
|
||||
35
app/src/main/java/fr/svpro/radiomercure/SplashActivity.java
Normal file
35
app/src/main/java/fr/svpro/radiomercure/SplashActivity.java
Normal 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);
|
||||
}
|
||||
}
|
||||
9
app/src/main/res/drawable/bg_gradient.xml
Normal file
9
app/src/main/res/drawable/bg_gradient.xml
Normal 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>
|
||||
9
app/src/main/res/drawable/splash_background.xml
Normal file
9
app/src/main/res/drawable/splash_background.xml
Normal 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>
|
||||
37
app/src/main/res/layout/activity_splash.xml
Normal file
37
app/src/main/res/layout/activity_splash.xml
Normal 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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user