mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-02 03:15:37 +00:00
Switched to SplashScreen API
This commit is contained in:
1 parent
8c7e2c9bb0
commit
09f35579dc
7 files changed
+10
-13
No files matched your search
@@ -45,6 +45,7 @@ android {
|
||||
dependencies {
|
||||
implementation project(':core')
|
||||
implementation "com.google.android.material:material:$material_version"
|
||||
implementation "androidx.core:core-splashscreen:$splash_screen_version"
|
||||
implementation "androidx.constraintlayout:constraintlayout:$constraint_layout_version"
|
||||
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
|
||||
implementation "androidx.navigation:navigation-fragment-ktx:$navigation_version"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<activity
|
||||
android:name=".presentation.Look4SatActivity"
|
||||
android:exported="true"
|
||||
android:theme="@style/AppTheme.Splash">
|
||||
android:theme="@style/Theme.Look4Sat.SplashScreen">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
|
||||
@@ -21,6 +21,7 @@ import android.annotation.SuppressLint
|
||||
import android.content.pm.ActivityInfo
|
||||
import android.os.Bundle
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
|
||||
import androidx.navigation.fragment.NavHostFragment
|
||||
import androidx.navigation.ui.setupWithNavController
|
||||
import com.rtbishop.look4sat.R
|
||||
@@ -33,8 +34,8 @@ class Look4SatActivity : AppCompatActivity() {
|
||||
@SuppressLint("SourceLockedOrientationActivity")
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
|
||||
setTheme(R.style.AppTheme)
|
||||
super.onCreate(savedInstanceState)
|
||||
installSplashScreen()
|
||||
val binding = ActivityMainBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
val navHost = supportFragmentManager.findFragmentById(R.id.main_nav_host) as NavHostFragment
|
||||
|
||||
File renamed without changes.
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:opacity="opaque">
|
||||
<item android:drawable="@drawable/ic_launcher_background" />
|
||||
<item
|
||||
android:drawable="@drawable/splash_foreground"
|
||||
android:gravity="center" />
|
||||
</layer-list>
|
||||
@@ -1,10 +1,12 @@
|
||||
<resources>
|
||||
|
||||
<style name="AppTheme.Splash" parent="AppTheme">
|
||||
<item name="android:windowBackground">@drawable/splash_drawable</item>
|
||||
<style name="Theme.Look4Sat.SplashScreen" parent="Theme.SplashScreen">
|
||||
<item name="windowSplashScreenBackground">@color/greyDark</item>
|
||||
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_splash_drawable</item>
|
||||
<item name="postSplashScreenTheme">@style/Theme.Look4Sat.Main</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme" parent="Theme.MaterialComponents.NoActionBar">
|
||||
<style name="Theme.Look4Sat.Main" parent="Theme.MaterialComponents.NoActionBar">
|
||||
<item name="colorPrimary">@color/themeLight</item>
|
||||
<item name="colorSecondary">@color/themeLight</item>
|
||||
<item name="colorPrimaryVariant">@color/themeDark</item>
|
||||
|
||||
@@ -4,6 +4,7 @@ buildscript {
|
||||
kotlin_version = '1.5.30'
|
||||
coroutines_version = '1.5.2-native-mt'
|
||||
material_version = '1.4.0'
|
||||
splash_screen_version = '1.0.0-alpha01'
|
||||
constraint_layout_version = '2.1.0'
|
||||
lifecycle_version = '2.3.1'
|
||||
navigation_version = '2.3.5'
|
||||
|
||||
Reference in new issue
Block a user