Skip to content
Snippets Groups Projects
Commit 40e723ad authored by Baryshnikov Oleg's avatar Baryshnikov Oleg
Browse files

Add the splashscreen with the rick face.

parent aac6a3fe
No related branches found
No related tags found
No related merge requests found
......@@ -71,7 +71,6 @@ dependencies {
// Compose integration with RxJava
implementation 'androidx.compose.runtime:runtime-rxjava2'
// Navigation component
def nav_version = "2.6.0"
implementation "androidx.navigation:navigation-compose:$nav_version"
//splash screen
implementation "androidx.core:core-splashscreen:1.0.1"
}
\ No newline at end of file
......@@ -6,17 +6,16 @@
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:icon="@drawable/app_logo"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:roundIcon="@drawable/app_logo"
android:supportsRtl="true"
android:theme="@style/Theme.AckeeTestTask"
android:theme="@style/Theme.App.Starting"
tools:targetApi="31" >
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.AckeeTestTask" >
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
......
......@@ -43,10 +43,13 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import cz.fel.barysole.ackeetesttask.ui.theme.AckeeTestTaskTheme
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
// Handle the splash screen transition.
val splashScreen = installSplashScreen()
super.onCreate(savedInstanceState)
setContent {
MainScreen(listOf(Character("Rick", "Sanchez", true), Character("Morty", "", false)))
......
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:width="100dp"
android:height="100dp"
android:drawable="@drawable/app_logo"
android:gravity="center" />
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--Splash screen theme-->
<style name="Theme.App.Starting" parent="Theme.SplashScreen">
<!-- Splash screen background -->
<item name="windowSplashScreenBackground">@color/white</item>
<!-- WindowSplashScreenAnimatedIcon to add a drawable. -->
<item name="windowSplashScreenAnimatedIcon">@drawable/splashscreen_icon</item>
<!-- The theme of the Activity that directly follows your splash screen. -->
<item name="postSplashScreenTheme">@style/Theme.AckeeTestTask</item>
</style>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--Main theme-->
<style name="Theme.AckeeTestTask" parent="android:Theme.Material.Light.NoActionBar" />
<!--Splash screen theme-->
<style name="Theme.App.Starting" parent="Theme.SplashScreen">
<!-- The splash screen background -->
<item name="windowSplashScreenBackground">@color/white</item>
<!-- WindowSplashScreenAnimatedIcon to add a drawable. -->
<item name="windowSplashScreenAnimatedIcon">@drawable/splashscreen_icon</item>
<!-- The theme of the Activity that directly follows your splash screen. -->
<item name="postSplashScreenTheme">@style/Theme.AckeeTestTask</item>
</style>
</resources>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment