Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#21 spash screen #23

Merged
merged 1 commit into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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 @@
}

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
Loading