Skip to content

Commit

Permalink
#21 spash screen
Browse files Browse the repository at this point in the history
  • Loading branch information
mjureczko committed Dec 19, 2023
1 parent cff4b9d commit 7661879
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
compileSdkVersion 33
defaultConfig {
applicationId "pl.marianjureczko.poszukiwacz"
minSdkVersion 21
minSdkVersion 23
targetSdkVersion 33
versionCode 1
versionName "1.0"
Expand Down Expand Up @@ -66,6 +66,7 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation "androidx.core:core-splashscreen:1.0.1"
implementation 'com.google.android.material:material:1.5.0'
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
android:icon="@mipmap/poszukiwacz_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/Theme.App.Starting">

<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
Expand Down Expand Up @@ -74,7 +74,7 @@
<activity
android:name=".activity.main.MainActivity"
android:exported="true"
android:theme="@style/FullscreenTheme">
android:theme="@style/Theme.App.Starting">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package pl.marianjureczko.poszukiwacz.activity.main
import android.content.pm.ActivityInfo
import android.os.Bundle
import android.view.View
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import pl.marianjureczko.poszukiwacz.R
Expand Down Expand Up @@ -34,6 +35,8 @@ class MainActivity : PermissionActivity() {
}

override fun onCreate(savedInstanceState: Bundle?) {
val splashScreen = installSplashScreen()

Check warning on line 38 in app/src/main/java/pl/marianjureczko/poszukiwacz/activity/main/MainActivity.kt

View workflow job for this annotation

GitHub Actions / build

Variable 'splashScreen' is never used

super.onCreate(savedInstanceState)
binding = ActivityMainBinding.inflate(layoutInflater)
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
Expand Down
Binary file added app/src/main/res/drawable/chest_splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<resources>

<style name="Theme.App.Starting" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/colorPrimary</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/chest_splash</item>
<item name="postSplashScreenTheme">@style/FullscreenTheme</item>
</style>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
Expand Down

0 comments on commit 7661879

Please sign in to comment.