From 1c2c7b36cae8b7cc854e42f93f069e9eb6733552 Mon Sep 17 00:00:00 2001 From: rohanbabbar Date: Tue, 19 Oct 2021 22:10:12 +0530 Subject: [PATCH] Upgraded Splash Screen to Android 12 --- app/build.gradle | 5 ++-- app/src/main/AndroidManifest.xml | 30 ++++++++++++------- .../quizforfun/LoginActivity.java | 3 +- app/src/main/res/values/themes.xml | 9 ++++-- 4 files changed, 31 insertions(+), 16 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index afeac2d..eb322dd 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,13 +3,13 @@ plugins { } android { - compileSdkVersion 30 + compileSdkVersion 31 buildToolsVersion "30.0.2" defaultConfig { applicationId "com.sagarkhurana.quizforfun" minSdkVersion 21 - targetSdkVersion 30 + targetSdkVersion 31 versionCode 1 versionName "1.0" @@ -30,6 +30,7 @@ android { dependencies { + implementation 'androidx.core:core-splashscreen:1.0.0-alpha02' implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'com.google.android.material:material:1.2.1' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d4ac983..c246ca0 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -9,24 +9,34 @@ android:roundIcon="@mipmap/ic_launcher" android:supportsRtl="true" android:theme="@style/Theme.QuizForFun"> - - - - - - - - + + + + + + + + + android:theme="@style/Theme.App.Starting"> - + \ No newline at end of file diff --git a/app/src/main/java/com/sagarkhurana/quizforfun/LoginActivity.java b/app/src/main/java/com/sagarkhurana/quizforfun/LoginActivity.java index f65dfe0..4fe8b57 100644 --- a/app/src/main/java/com/sagarkhurana/quizforfun/LoginActivity.java +++ b/app/src/main/java/com/sagarkhurana/quizforfun/LoginActivity.java @@ -1,6 +1,7 @@ package com.sagarkhurana.quizforfun; import androidx.appcompat.app.AppCompatActivity; +import androidx.core.splashscreen.SplashScreen; import android.content.Intent; import android.os.AsyncTask; @@ -36,7 +37,7 @@ protected void onStart() { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setTheme(R.style.Theme_QuizForFun); + SplashScreen.installSplashScreen(this); setContentView(R.layout.activity_login); etUsername = findViewById(R.id.tietUsername); diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 7681fd0..2a1ec80 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -12,9 +12,12 @@ @style/editTextLayoutStyle -