Skip to content
Open
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: 3 additions & 0 deletions presentation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,7 @@ dependencies {
//glide
implementation deps.glide.glide
kapt deps.glide.compiler

//Splash Screen Api
implementation deps.ui.splash_screen
}
1 change: 1 addition & 0 deletions presentation/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package="com.example.presentation">

<application>
<activity
android:theme="@style/Theme.App.Starting"
android:name="com.example.presentation.views.CockTailsActivity"
android:exported="true">
<nav-graph android:value="@navigation/app_nav"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,26 @@ package com.example.presentation.views

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import com.bumptech.glide.load.engine.Resource
import com.example.core.Status
import com.example.presentation.R
import com.example.presentation.viemodel.CockTailViewModel
import org.koin.androidx.viewmodel.ext.android.viewModel

class CockTailsActivity : AppCompatActivity() {
private val viewModel: CockTailViewModel by viewModel()
override fun onCreate(savedInstanceState: Bundle?) {
initSplashScreen()
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_cocktails)
// actionBar?.hide()
// supportActionBar?.hide()
}
private fun initSplashScreen() {
val splashScreen = installSplashScreen()
splashScreen.setKeepOnScreenCondition {
viewModel.cockTailStatus.value?.status == Status.LOADING
}
}
}
12 changes: 12 additions & 0 deletions presentation/src/main/res/values-v31/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.App.Starting" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/purple_700</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/cocktails</item>
<item name="windowSplashScreenAnimationDuration">1000</item>
<item name="postSplashScreenTheme">@style/Theme.CockTails</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/cocktails</item>
<!--Add branding image here when you have one, works only from android 12-->
<!--<item name="android:windowSplashScreenBrandingImage">@drawable/cocktails</item>-->
</style>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
<style name="Theme.App.Starting" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/purple_700</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/cocktails</item>
<item name="windowSplashScreenAnimationDuration">1000</item>
<item name="postSplashScreenTheme">@style/Theme.CockTails</item>
</style>
</resources>
1 change: 1 addition & 0 deletions scripts/versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def ui = [:]
ui.material = "com.google.android.material:material:$versions.material"
ui.constraint_layout = "androidx.constraintlayout:constraintlayout:$versions.constraint_layout"
ui.appcompat = "androidx.appcompat:appcompat:$versions.androidx_appcompat"
ui.splash_screen = "androidx.core:core-splashscreen:1.0.0-rc01"
deps.ui = ui

def square_up = [:]
Expand Down