Skip to content

Commit 2b5b654

Browse files
Merge remote-tracking branch 'origin/master' into feature/22_tratamento_networking
# Conflicts: # feature-list-streams/build.gradle.kts
2 parents 39c44f6 + 0499035 commit 2b5b654

File tree

6 files changed

+231
-18
lines changed

6 files changed

+231
-18
lines changed

buildSrc/src/main/java/Dependencies.kt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ interface GroupLibs {
66

77
object Dependencies {
88
const val runnerPackage = "androidx.test.runner.AndroidJUnitRunner"
9+
const val coil = "io.coil-kt:coil-compose:${Versions.coilVersion}"
910

1011
object Module {
1112
const val core_networking = ":core-networking"
@@ -134,10 +135,21 @@ object Dependencies {
134135
}
135136

136137
object Compose: GroupLibs {
137-
const val composeFoundation = "androidx.compose.foundation:foundation:${Versions.compose_version}"
138+
const val composeBomVersion = "androidx.compose:compose-bom:${Versions.composeBomVersion}"
139+
const val composeUI = "androidx.compose.ui:ui"
140+
const val coposeUIToolingPreview = "androidx.compose.ui:ui-tooling-preview"
141+
const val composeActivityCompose = "androidx.activity:activity-compose"
142+
const val composeUITooling = "androidx.compose.ui:ui-tooling"
143+
const val composeMaterial3 = "androidx.compose.material3:material3:" +
144+
"${Versions.composeMaterial3Version}"
145+
138146
override val list: List<String>
139147
get() = listOf(
140-
Compose.composeFoundation
148+
Compose.composeUI,
149+
Compose.coposeUIToolingPreview,
150+
Compose.composeActivityCompose,
151+
Compose.composeUITooling,
152+
Compose.composeMaterial3
141153
)
142154
}
143155
}

buildSrc/src/main/java/Versions.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,17 @@ object Versions {
1919
const val okhttp_version = "4.10.0"
2020
const val mockk = "1.10.0"
2121
const val constraint_motion_version = "2.1.3"
22-
const val kotlin_version = "1.8.0"
22+
const val kotlin_version = "1.8.10"
2323
const val androidx_core_ktx = "1.1.0"
2424
const val viewmodel_version = "2.2.0"
2525
const val mockWebServer = "4.10.0"
2626
const val koin = "3.4.0"
2727
const val compose_version = "1.4.2"
2828
const val retrofit = "2.9.0"
29+
30+
const val composeBomVersion = "2023.01.00"
31+
const val composeCompilerVersion = "1.4.2"
32+
const val composeMaterial3Version = "1.0.1"
33+
34+
const val coilVersion = "2.3.0"
2935
}
Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
1+
@file:Suppress("UnstableApiUsage")
12
android {
23
namespace = "${Config.packageName}feature_list_streams"
3-
}
4-
5-
dependencies {
6-
implementation(project(Dependencies.Module.core_networking))
7-
implementation(Dependencies.Koin.koin)
8-
Dependencies.Retrofit.list.forEach { implementation(it) }
9-
Dependencies.Kotlin.list.forEach { implementation(it) }
10-
Dependencies.Support.list.forEach { implementation(it) }
11-
Dependencies.Compose.list.forEach { implementation(it) }
12-
13-
Dependencies.UnitTest.list.forEach { testImplementation(it) }
14-
Dependencies.AndroidTest.list.forEach { androidTestImplementation(it) }
4+
5+
buildFeatures {
6+
compose = true
7+
}
8+
9+
composeOptions {
10+
kotlinCompilerExtensionVersion = Versions.composeCompilerVersion
11+
}
12+
13+
dependencies {
14+
implementation(project(Dependencies.Module.core_networking))
15+
implementation(Dependencies.Koin.koin)
16+
Dependencies.Retrofit.list.forEach { implementation(it) }
17+
Dependencies.Kotlin.list.forEach { implementation(it) }
18+
Dependencies.Support.list.forEach { implementation(it) }
19+
20+
val composeBom = platform(Dependencies.Compose.composeBomVersion)
21+
implementation(composeBom)
22+
Dependencies.Compose.list.forEach { implementation(it) }
23+
24+
Dependencies.UnitTest.list.forEach { testImplementation(it) }
25+
26+
implementation(Dependencies.coil)
27+
}
1528
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
package com.codandotv.streamplayerapp.feature_list_streams.presentation.screens
2+
3+
import androidx.compose.foundation.background
4+
import androidx.compose.foundation.layout.Column
5+
import androidx.compose.foundation.layout.Row
6+
import androidx.compose.foundation.layout.Spacer
7+
import androidx.compose.foundation.layout.fillMaxSize
8+
import androidx.compose.foundation.layout.fillMaxWidth
9+
import androidx.compose.foundation.layout.height
10+
import androidx.compose.foundation.layout.padding
11+
import androidx.compose.foundation.layout.size
12+
import androidx.compose.foundation.lazy.LazyRow
13+
import androidx.compose.material3.Text
14+
import androidx.compose.runtime.Composable
15+
import androidx.compose.ui.Modifier
16+
import androidx.compose.ui.graphics.Color
17+
import androidx.compose.ui.tooling.preview.Preview
18+
import androidx.compose.ui.unit.dp
19+
import com.codandotv.streamplayerapp.feature_list_streams.presentation.widgets.StreamsCard
20+
import com.codandotv.streamplayerapp.feature_list_streams.presentation.widgets.StreamsCardContent
21+
import com.codandotv.streamplayerapp.feature_list_streams.presentation.widgets.StreamsCarousel
22+
23+
val streamsCategoryX = listOf(
24+
StreamsCardContent(
25+
contentDescription = "test",
26+
url = "https://image.tmdb.org/t/p/w300/gU84Leiw6dYyxcx3S7kfneLnVJH.jpg"
27+
),
28+
StreamsCardContent(
29+
contentDescription = "test",
30+
url = "https://image.tmdb.org/t/p/w300/evgwd37VHBJhXvSr88Mrx5riFil.jpg"
31+
),
32+
StreamsCardContent(
33+
contentDescription = "test",
34+
url = "https://image.tmdb.org/t/p/w300/wAKExQIBBiApsucimUIv6aiJsWF.jpg"
35+
),
36+
StreamsCardContent(
37+
contentDescription = "test",
38+
url = "https://image.tmdb.org/t/p/w300/mKEDE9r2ggqtGv5krCFLuELh7ED.jpg"
39+
),
40+
StreamsCardContent(
41+
contentDescription = "test",
42+
url = "https://image.tmdb.org/t/p/w300/ojCfQ8syImYWJ38sta46BOz00PC.jpg"
43+
)
44+
)
45+
46+
val streamsCategoryY = listOf(
47+
StreamsCardContent(
48+
contentDescription = "test",
49+
url = "https://image.tmdb.org/t/p/w300/lOrPcXLAfdtWFSeMPdMiBLwlvtv.jpg"
50+
),
51+
StreamsCardContent(
52+
contentDescription = "test",
53+
url = "https://image.tmdb.org/t/p/w300/yjs9NikrKZUmIX3ou3J9QiUcQUP.jpg"
54+
), StreamsCardContent(
55+
contentDescription = "test",
56+
url = "https://image.tmdb.org/t/p/w300/vfdO4lUxZaUrRhI60Gvf5WEqdhY.jpg"
57+
),
58+
StreamsCardContent(
59+
contentDescription = "test",
60+
url = "https://image.tmdb.org/t/p/w300/qdzIpsDH1D0uiFTvFQL9WW4MEZ4.jpg"
61+
),
62+
StreamsCardContent(
63+
contentDescription = "test",
64+
url = "https://image.tmdb.org/t/p/w300/i17CbxJ8GrGvPneiknjGyJrbqvp.jpg"
65+
)
66+
)
67+
68+
@Composable
69+
fun ListStreamsScreen() {
70+
Column(
71+
modifier = Modifier
72+
.background(Color.Black)
73+
.fillMaxSize()
74+
) {
75+
StreamsCarousel(
76+
title = "Category X",
77+
contentList = streamsCategoryX,
78+
modifier = Modifier.padding(vertical = 8.dp)
79+
)
80+
81+
Spacer(modifier = Modifier.height(12.dp))
82+
83+
StreamsCarousel(
84+
title = "Category Y",
85+
contentList = streamsCategoryY,
86+
modifier = Modifier.padding(vertical = 8.dp)
87+
)
88+
}
89+
}
90+
91+
@Composable
92+
@Preview
93+
fun ListStreamsScreenPreview() {
94+
ListStreamsScreen()
95+
}
Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,47 @@
11
package com.codandotv.streamplayerapp.feature_list_streams.presentation.widgets
22

3-
import androidx.compose.ui.text.TextRange
3+
import androidx.compose.foundation.layout.padding
4+
import androidx.compose.foundation.layout.size
5+
import androidx.compose.foundation.shape.RoundedCornerShape
6+
import androidx.compose.material3.Card
7+
import androidx.compose.runtime.Composable
8+
import androidx.compose.ui.Modifier
9+
import androidx.compose.ui.layout.ContentScale
10+
import androidx.compose.ui.tooling.preview.Preview
11+
import androidx.compose.ui.unit.dp
12+
import coil.compose.AsyncImage
413

5-
fun StreamsCard() {
6-
TextRange(0)
14+
data class StreamsCardContent(
15+
val url: String,
16+
val contentDescription: String,
17+
)
18+
19+
@Composable
20+
fun StreamsCard(content: StreamsCardContent) {
21+
Card(
22+
shape = RoundedCornerShape(6.dp),
23+
modifier = Modifier.size(
24+
width = 100.dp,
25+
height = 140.dp
26+
).padding(
27+
horizontal = 4.dp
28+
)
29+
) {
30+
AsyncImage(
31+
model = content.url,
32+
contentScale = ContentScale.FillBounds,
33+
contentDescription = content.contentDescription
34+
)
35+
}
36+
}
37+
38+
@Preview
39+
@Composable
40+
fun StreamsCardPreview() {
41+
StreamsCard(
42+
StreamsCardContent(
43+
url = "https://image.tmdb.org/t/p/w300/evgwd37VHBJhXvSr88Mrx5riFil.jpg",
44+
contentDescription = "Test 1"
45+
)
46+
)
747
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package com.codandotv.streamplayerapp.feature_list_streams.presentation.widgets
2+
3+
import androidx.compose.foundation.layout.Column
4+
import androidx.compose.foundation.layout.Spacer
5+
import androidx.compose.foundation.layout.fillMaxWidth
6+
import androidx.compose.foundation.layout.size
7+
import androidx.compose.foundation.lazy.LazyRow
8+
import androidx.compose.material3.MaterialTheme
9+
import androidx.compose.material3.Text
10+
import androidx.compose.runtime.Composable
11+
import androidx.compose.ui.Modifier
12+
import androidx.compose.ui.graphics.Color
13+
import androidx.compose.ui.text.font.FontWeight
14+
import androidx.compose.ui.tooling.preview.Preview
15+
import androidx.compose.ui.unit.dp
16+
import androidx.compose.ui.unit.sp
17+
18+
@Composable
19+
fun StreamsCarousel(title: String, contentList: List<StreamsCardContent>, modifier: Modifier = Modifier) {
20+
Column(modifier = modifier) {
21+
Text(
22+
title,
23+
style = MaterialTheme.typography.headlineMedium.copy(
24+
color = Color.White,
25+
fontWeight = FontWeight.Bold,
26+
fontSize = 20.sp
27+
)
28+
)
29+
30+
Spacer(modifier = Modifier.size(8.dp))
31+
32+
LazyRow(modifier = Modifier.fillMaxWidth()) {
33+
items(contentList.size) {
34+
StreamsCard(contentList[it])
35+
}
36+
}
37+
}
38+
}
39+
40+
@Composable
41+
@Preview
42+
fun StreamsCarouselPreview() {
43+
StreamsCarousel(
44+
title = "Ação",
45+
contentList = emptyList()
46+
)
47+
}

0 commit comments

Comments
 (0)