Add startup splash screen

This commit is contained in:
Pierre HUBERT 2022-02-15 17:07:00 +01:00
parent 939041a4df
commit 32baf766df
6 changed files with 32 additions and 2 deletions

View File

@ -6,6 +6,8 @@
<entry key="app/src/main/res/drawable-v24/ic_launcher_foreground.xml" value="0.3859375" />
<entry key="app/src/main/res/drawable/ic_launcher_background.xml" value="0.3859375" />
<entry key="app/src/main/res/drawable/ic_launcher_foreground.xml" value="0.2234375" />
<entry key="app/src/main/res/drawable/splashscreen.xml" value="0.3859375" />
<entry key="app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" value="0.3859375" />
</map>
</option>
</component>

View File

@ -11,7 +11,8 @@
android:theme="@style/Theme.DCCAggregator">
<activity
android:name=".MainActivity"
android:exported="true">
android:exported="true"
android:theme="@style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

View File

@ -1,14 +1,16 @@
package org.communiquons.dccaggregator
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setTheme(R.style.Theme_DCCAggregator)
setContentView(R.layout.activity_main)
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
}
}

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="#000000" />
</shape>
</item>
<!-- You can insert your own image assets here -->
<item>
<bitmap
android:gravity="center"
android:src="@drawable/splash_logo" />
</item>
</layer-list>

View File

@ -13,4 +13,9 @@
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
<!-- Startup splash screen -->
<style name="SplashTheme" parent="Theme.DCCAggregator">
<item name="android:windowBackground">@drawable/splashscreen</item>
</style>
</resources>

View File

@ -13,4 +13,9 @@
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
<!-- Startup splash screen -->
<style name="SplashTheme" parent="Theme.DCCAggregator">
<item name="android:windowBackground">@drawable/splashscreen</item>
</style>
</resources>