mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
Migrate to Android 12 splash screen implementation
This commit is contained in:
parent
a531502a1b
commit
43c78c6e9b
8 changed files with 37 additions and 1 deletions
|
|
@ -52,6 +52,9 @@ dependencies {
|
|||
// Android Material
|
||||
implementation 'com.google.android.material:material:1.4.0'
|
||||
|
||||
// Splashscreen
|
||||
implementation 'androidx.core:core-splashscreen:1.0.0-alpha01'
|
||||
|
||||
// VolleyRequest
|
||||
implementation 'com.android.volley:volley:1.2.0'
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:theme="@style/Theme.App.Starting"
|
||||
android:usesCleartextTraffic="true">
|
||||
<activity
|
||||
android:name=".ui.activity.MainActivity"
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import android.os.Bundle;
|
|||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.splashscreen.SplashScreen;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.navigation.NavController;
|
||||
|
|
@ -44,6 +45,8 @@ public class MainActivity extends BaseActivity {
|
|||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
SplashScreen.installSplashScreen(this);
|
||||
|
||||
bind = ActivityMainBinding.inflate(getLayoutInflater());
|
||||
View view = bind.getRoot();
|
||||
setContentView(view);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="Theme.App.Starting" parent="Theme.SplashScreen">
|
||||
<item name="windowSplashScreenBackground">@color/colorPrimary</item>
|
||||
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>
|
||||
<item name="postSplashScreenTheme">@style/AppTheme</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="Theme.App.Starting" parent="Theme.SplashScreen">
|
||||
<item name="windowSplashScreenBackground">@color/colorPrimary</item>
|
||||
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>
|
||||
<item name="postSplashScreenTheme">@style/AppTheme</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue