Skip to content

Commit 1797a44

Browse files
Merge pull request #26 from CodandoTV/feature/17-splash
[ISSUE-17] - create splash, module core-shared-ui and feature-onboarding
2 parents e6ee028 + 244b717 commit 1797a44

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+325
-256
lines changed

app/build.gradle.kts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
1+
android {
2+
namespace = "${Config.packageName}app"
3+
4+
buildFeatures {
5+
compose = true
6+
}
7+
8+
composeOptions {
9+
kotlinCompilerExtensionVersion = Versions.composeCompilerVersion
10+
}
11+
}
112
dependencies {
213
implementation(project(Dependencies.Module.feature_list_streams))
314
implementation(project(Dependencies.Module.core_networking))
15+
implementation(project(Dependencies.Module.core_shared_ui))
416
implementation(Dependencies.Koin.koin)
517
Dependencies.Kotlin.list.forEach { implementation(it) }
618
Dependencies.Support.list.forEach { implementation(it) }
719
Dependencies.UnitTest.list.forEach { testImplementation(it) }
820
Dependencies.AndroidTest.list.forEach { androidTestImplementation(it) }
21+
22+
val composeBom = platform(Dependencies.Compose.composeBomVersion)
23+
implementation(composeBom)
24+
Dependencies.Compose.list.forEach { implementation(it) }
25+
implementation(Dependencies.lottie)
926
}

app/src/main/AndroidManifest.xml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:tools="http://schemas.android.com/tools">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
43

54
<application
65
android:allowBackup="true"
76
android:dataExtractionRules="@xml/data_extraction_rules"
87
android:fullBackupContent="@xml/backup_rules"
9-
android:icon="@mipmap/ic_launcher"
8+
android:icon="@mipmap/ic_netflix"
9+
android:roundIcon="@mipmap/ic_netflix_round"
1010
android:label="@string/app_name"
1111
android:supportsRtl="true"
12-
android:theme="@style/Theme.StreamPlayerApp"
13-
tools:targetApi="31"
14-
android:name=".CustomApplication">
12+
android:name="com.codandotv.streamplayerapp.CustomApplication">
13+
14+
<activity
15+
android:name="com.codandotv.streamplayerapp.MainActivity"
16+
android:exported="true"
17+
android:theme="@style/SplashScreenTheme">
18+
<intent-filter>
19+
<action android:name="android.intent.action.MAIN" />
20+
21+
<category android:name="android.intent.category.LAUNCHER" />
22+
</intent-filter>
23+
</activity>
1524
</application>
1625

1726
</manifest>
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
package com.codandotv.streamplayerapp
22

3-
import androidx.appcompat.app.AppCompatActivity
43
import android.os.Bundle
4+
import androidx.activity.ComponentActivity
5+
import androidx.activity.compose.setContent
6+
import com.codandotv.streamplayerapp.screens.SplashScreen
57

6-
class MainActivity : AppCompatActivity() {
8+
class MainActivity : ComponentActivity() {
79
override fun onCreate(savedInstanceState: Bundle?) {
810
super.onCreate(savedInstanceState)
9-
setContentView(R.layout.activity_main)
11+
12+
setContent{
13+
SplashScreen()
14+
}
1015
}
1116
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package com.codandotv.streamplayerapp.screens
2+
3+
import androidx.compose.foundation.background
4+
import androidx.compose.foundation.layout.Box
5+
import androidx.compose.foundation.layout.Column
6+
import androidx.compose.foundation.layout.fillMaxSize
7+
import androidx.compose.runtime.Composable
8+
import androidx.compose.runtime.getValue
9+
import androidx.compose.ui.Alignment
10+
import androidx.compose.ui.Modifier
11+
import androidx.compose.ui.graphics.Color
12+
import androidx.compose.ui.tooling.preview.Preview
13+
import com.airbnb.lottie.compose.LottieAnimation
14+
import com.airbnb.lottie.compose.LottieCompositionSpec
15+
import com.airbnb.lottie.compose.animateLottieCompositionAsState
16+
import com.airbnb.lottie.compose.rememberLottieComposition
17+
import com.codandotv.streamplayerapp.core_shared_ui.R
18+
19+
@Composable
20+
fun SplashScreen() {
21+
Column(
22+
modifier = Modifier.fillMaxSize()
23+
) {
24+
Box(
25+
contentAlignment = Alignment.Center,
26+
modifier = Modifier
27+
.fillMaxSize()
28+
.background(Color.Black)
29+
) {
30+
val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.logo))
31+
val logoAnimationState = animateLottieCompositionAsState(composition = composition)
32+
LottieAnimation(composition = composition, progress = { logoAnimationState.progress })
33+
if (logoAnimationState.isAtEnd && logoAnimationState.isPlaying) {
34+
println("faz alguma coisa")
35+
}
36+
}
37+
}
38+
}
39+
40+
@Composable
41+
@Preview
42+
fun SplashScreenPreview() {
43+
SplashScreen()
44+
}

app/src/main/res/drawable-v24/ic_launcher_foreground.xml

Lines changed: 0 additions & 30 deletions
This file was deleted.

app/src/main/res/drawable/ic_launcher_background.xml

Lines changed: 0 additions & 170 deletions
This file was deleted.

app/src/main/res/layout/activity_main.xml

Lines changed: 0 additions & 18 deletions
This file was deleted.

app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml

Lines changed: 0 additions & 5 deletions
This file was deleted.

app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml

Lines changed: 0 additions & 5 deletions
This file was deleted.

app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)