From 32baf766dfc2872b47a32178d5aef354e62e6d5b Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Tue, 15 Feb 2022 17:07:00 +0100 Subject: [PATCH] Add startup splash screen --- .idea/misc.xml | 2 ++ app/src/main/AndroidManifest.xml | 3 ++- .../communiquons/dccaggregator/MainActivity.kt | 4 +++- app/src/main/res/drawable/splashscreen.xml | 15 +++++++++++++++ app/src/main/res/values-night/themes.xml | 5 +++++ app/src/main/res/values/themes.xml | 5 +++++ 6 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 app/src/main/res/drawable/splashscreen.xml diff --git a/.idea/misc.xml b/.idea/misc.xml index f40c854..04e7fe5 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -6,6 +6,8 @@ + + diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index f393511..aeae542 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -11,7 +11,8 @@ android:theme="@style/Theme.DCCAggregator"> + android:exported="true" + android:theme="@style/SplashTheme"> diff --git a/app/src/main/java/org/communiquons/dccaggregator/MainActivity.kt b/app/src/main/java/org/communiquons/dccaggregator/MainActivity.kt index 662266f..8ce4df5 100644 --- a/app/src/main/java/org/communiquons/dccaggregator/MainActivity.kt +++ b/app/src/main/java/org/communiquons/dccaggregator/MainActivity.kt @@ -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) } } \ No newline at end of file diff --git a/app/src/main/res/drawable/splashscreen.xml b/app/src/main/res/drawable/splashscreen.xml new file mode 100644 index 0000000..52e1a1c --- /dev/null +++ b/app/src/main/res/drawable/splashscreen.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index 2d6e14f..930c5e4 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -13,4 +13,9 @@ ?attr/colorPrimaryVariant + + + \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 04b7cf3..fe7d6c5 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -13,4 +13,9 @@ ?attr/colorPrimaryVariant + + + \ No newline at end of file