Add startup splash screen
This commit is contained in:
parent
939041a4df
commit
32baf766df
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@ -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-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_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/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>
|
</map>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
|
@ -11,7 +11,8 @@
|
|||||||
android:theme="@style/Theme.DCCAggregator">
|
android:theme="@style/Theme.DCCAggregator">
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:exported="true">
|
android:exported="true"
|
||||||
|
android:theme="@style/SplashTheme">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
@ -1,14 +1,16 @@
|
|||||||
package org.communiquons.dccaggregator
|
package org.communiquons.dccaggregator
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.appcompat.app.AppCompatDelegate
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
|
|
||||||
class MainActivity : AppCompatActivity() {
|
class MainActivity : AppCompatActivity() {
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
setTheme(R.style.Theme_DCCAggregator)
|
||||||
setContentView(R.layout.activity_main)
|
setContentView(R.layout.activity_main)
|
||||||
|
|
||||||
|
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
|
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
|
||||||
}
|
}
|
||||||
}
|
}
|
15
app/src/main/res/drawable/splashscreen.xml
Normal file
15
app/src/main/res/drawable/splashscreen.xml
Normal 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>
|
@ -13,4 +13,9 @@
|
|||||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||||
<!-- Customize your theme here. -->
|
<!-- Customize your theme here. -->
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<!-- Startup splash screen -->
|
||||||
|
<style name="SplashTheme" parent="Theme.DCCAggregator">
|
||||||
|
<item name="android:windowBackground">@drawable/splashscreen</item>
|
||||||
|
</style>
|
||||||
</resources>
|
</resources>
|
@ -13,4 +13,9 @@
|
|||||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||||
<!-- Customize your theme here. -->
|
<!-- Customize your theme here. -->
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<!-- Startup splash screen -->
|
||||||
|
<style name="SplashTheme" parent="Theme.DCCAggregator">
|
||||||
|
<item name="android:windowBackground">@drawable/splashscreen</item>
|
||||||
|
</style>
|
||||||
</resources>
|
</resources>
|
Reference in New Issue
Block a user