Skip to content

Commit 4a8b8b0

Browse files
authored
Merge pull request #18 from YAPP-Github/feature/NDGL-61
[NDGL-61] 홈 화면 UI 구현
2 parents e9b6ca1 + c8c179a commit 4a8b8b0

28 files changed

Lines changed: 1601 additions & 107 deletions

File tree

.coderabbit.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ reviews:
1010
auto_review:
1111
enabled: true
1212
drafts: false
13+
auto_incremental_review: false
1314
chat:
14-
auto_reply: true
15+
auto_reply: true

app/src/main/java/com/yapp/ndgl/NDGLApplication.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ class NDGLApplication : Application() {
1010
super.onCreate()
1111

1212
if (BuildConfig.DEBUG) {
13-
Timber.plant(Timber.DebugTree())
13+
Timber.plant(
14+
object : Timber.DebugTree() {
15+
override fun log(priority: Int, tag: String?, message: String, t: Throwable?) {
16+
super.log(priority, "Debug[$tag]", message, t)
17+
}
18+
},
19+
)
1420
}
1521
}
1622
}

build-logic/src/main/kotlin/NDGLFeaturePlugin.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class NDGLFeaturePlugin : Plugin<Project> {
2525
"implementation"(libs.findLibrary("lifecycle-viewmodel-compose").get())
2626
"implementation"(libs.findLibrary("lifecycle-runtime-compose").get())
2727
"implementation"(libs.findLibrary("androidx-navigation3-runtime").get())
28+
"implementation"(libs.findLibrary("coil-compose").get())
29+
"implementation"(libs.findLibrary("coil-network-okhttp").get())
2830
}
2931
}
3032
}

core/ui/src/main/res/drawable/img_empty_calendar.xml

Lines changed: 193 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.yapp.ndgl.core.util
2+
3+
import java.util.Locale
4+
5+
object FlagEmojiUtil {
6+
private const val FLAG_EMOJI_OFFSET = 127397
7+
8+
fun String.toFlagEmoji() = if (length == 2 && all { it in ('a'..'z') + ('A'..'Z') }) {
9+
uppercase(Locale.ROOT).map { character ->
10+
String(intArrayOf(character.code + FLAG_EMOJI_OFFSET), 0, 1)
11+
}.joinToString("")
12+
} else {
13+
this
14+
}
15+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.yapp.ndgl.data.travel.model
2+
3+
import java.time.LocalDate
4+
5+
// FIXME: API 스펙에 맞춰서 모델 재설계
6+
data class InProgressTravel(
7+
val title: String,
8+
val dayCount: Int,
9+
val startDate: LocalDate,
10+
val endDate: LocalDate,
11+
val currentPlace: TravelPlace,
12+
) {
13+
data class TravelPlace(
14+
val category: String,
15+
val estimatedTime: String,
16+
val name: String,
17+
val thumbnailUrl: String,
18+
)
19+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.yapp.ndgl.data.travel.model
2+
3+
data class TravelSummary(
4+
val travelId: String,
5+
val country: String,
6+
val city: String,
7+
val nights: Int,
8+
val days: Int,
9+
val youtube: YoutubeInfo,
10+
) {
11+
data class YoutubeInfo(
12+
val title: String,
13+
val youtuber: String,
14+
val thumbnail: String,
15+
)
16+
}
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
package com.yapp.ndgl.data.travel.repository
2+
3+
import com.yapp.ndgl.data.travel.model.InProgressTravel
4+
import com.yapp.ndgl.data.travel.model.TravelSummary
5+
import java.time.LocalDate
6+
import javax.inject.Inject
7+
import kotlin.random.Random
8+
9+
// FIXME: Sample data 제거 및 API 호출
10+
class HomeRepository @Inject constructor() {
11+
suspend fun getMyTravel(): InProgressTravel {
12+
return InProgressTravel(
13+
title = "인도 여행",
14+
dayCount = 1,
15+
startDate = LocalDate.of(2024, 12, 23),
16+
endDate = LocalDate.of(2024, 12, 26),
17+
currentPlace = InProgressTravel.TravelPlace(
18+
category = "교통수단",
19+
estimatedTime = "1시간 체류 예상",
20+
name = "인도 국제 공항",
21+
thumbnailUrl = randomImageUrl(),
22+
),
23+
)
24+
}
25+
26+
suspend fun getPopularTravels(): List<TravelSummary> {
27+
return listOf(
28+
TravelSummary(
29+
travelId = "Popular1",
30+
country = "FR",
31+
city = "파리",
32+
nights = 7,
33+
days = 9,
34+
youtube = TravelSummary.YoutubeInfo(
35+
title = "곽준빈의 신혼여행",
36+
youtuber = "곽준빈",
37+
thumbnail = randomImageUrl(),
38+
),
39+
),
40+
TravelSummary(
41+
travelId = "Popular2",
42+
country = "CH",
43+
city = "취리히",
44+
nights = 5,
45+
days = 6,
46+
youtube = TravelSummary.YoutubeInfo(
47+
title = "스위스 여행",
48+
youtuber = "곽준빈",
49+
thumbnail = randomImageUrl(),
50+
),
51+
),
52+
TravelSummary(
53+
travelId = "Popular3",
54+
country = "DK",
55+
city = "코펜하겐",
56+
nights = 4,
57+
days = 6,
58+
youtube = TravelSummary.YoutubeInfo(
59+
title = "충격적인 북유럽 물가",
60+
youtuber = "곽준빈",
61+
thumbnail = randomImageUrl(),
62+
),
63+
),
64+
TravelSummary(
65+
travelId = "Popular4",
66+
country = "MX",
67+
city = "멕시코시티",
68+
nights = 4,
69+
days = 6,
70+
youtube = TravelSummary.YoutubeInfo(
71+
title = "샘플 데이터 1",
72+
youtuber = "콩콩팡팡",
73+
thumbnail = randomImageUrl(),
74+
),
75+
),
76+
TravelSummary(
77+
travelId = "Popular5",
78+
country = "IN",
79+
city = "뭄바이",
80+
nights = 4,
81+
days = 6,
82+
youtube = TravelSummary.YoutubeInfo(
83+
title = "샘플 데이터 2",
84+
youtuber = "콩콩팡팡",
85+
thumbnail = randomImageUrl(),
86+
),
87+
),
88+
TravelSummary(
89+
travelId = "Popular6",
90+
country = "KR",
91+
city = "서울",
92+
nights = 4,
93+
days = 6,
94+
youtube = TravelSummary.YoutubeInfo(
95+
title = "샘플 데이터 3",
96+
youtuber = "콩콩팡팡",
97+
thumbnail = randomImageUrl(),
98+
),
99+
),
100+
)
101+
}
102+
103+
suspend fun getRecommendedTravels(): List<TravelSummary> {
104+
return listOf(
105+
TravelSummary(
106+
travelId = "Recommended1",
107+
country = "IN",
108+
city = "뭄바이",
109+
nights = 5,
110+
days = 6,
111+
youtube = TravelSummary.YoutubeInfo(
112+
title = "생각보다 깨끗한 인도 경험하기",
113+
youtuber = "빠니보틀",
114+
thumbnail = randomImageUrl(),
115+
),
116+
),
117+
TravelSummary(
118+
travelId = "Recommended2",
119+
country = "FR",
120+
city = "파리",
121+
nights = 5,
122+
days = 7,
123+
youtube = TravelSummary.YoutubeInfo(
124+
title = "적나라한 파리",
125+
youtuber = "빠니보틀",
126+
thumbnail = randomImageUrl(),
127+
),
128+
),
129+
)
130+
}
131+
132+
private fun randomImageUrl(): String {
133+
val randomId = Random.nextInt(0, 500)
134+
return "https://picsum.photos/id/$randomId/200/300"
135+
}
136+
}

feature/home/src/main/java/com/yapp/ndgl/feature/home/HomeContract.kt

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

feature/home/src/main/java/com/yapp/ndgl/feature/home/HomeScreen.kt

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

0 commit comments

Comments
 (0)