Skip to content

Commit b6aca34

Browse files
authored
Merge pull request #38 from Nexters/feature/home-v2
변경된 홈 디자인과 바텀 시트를 구현합니다.
2 parents 174d249 + 8897011 commit b6aca34

File tree

19 files changed

+417
-132
lines changed

19 files changed

+417
-132
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.plottwist.core.data.mapper
2+
3+
import com.plottwist.core.domain.model.MemberInfo
4+
import com.plottwist.core.network.model.onboarding.MemberInfoData
5+
6+
fun MemberInfoData.toDomainModel() : MemberInfo {
7+
return MemberInfo(
8+
memberId = this.memberId,
9+
email = this.email,
10+
name = this.name
11+
)
12+
}

core/data/src/main/java/com/plottwist/core/data/onboarding/OnboardingRepositoryImpl.kt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.plottwist.core.data.onboarding
22

3+
import com.plottwist.core.data.mapper.toDomainModel
4+
import com.plottwist.core.domain.model.MemberInfo
35
import com.plottwist.core.domain.onboarding.OnboardingRepository
46
import com.plottwist.core.network.model.onboarding.UpdateOnboardingInfoRequest
57
import com.plottwist.core.network.service.OnboardingService
@@ -27,4 +29,18 @@ class OnboardingRepositoryImpl @Inject constructor(
2729
return Result.failure(Exception(e))
2830
}
2931
}
32+
33+
override suspend fun getMemberInfo(): Result<MemberInfo> {
34+
try {
35+
val result = onboardingService.getMemberInfo()
36+
37+
if (result.success) {
38+
return Result.success(result.data.toDomainModel())
39+
}
40+
41+
return Result.failure(Exception("Fail to get member info"))
42+
} catch (e:Exception) {
43+
return Result.failure(Exception(e))
44+
}
45+
}
3046
}

core/designsystem/src/main/java/com/plottwist/core/designsystem/component/Button.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import androidx.compose.ui.graphics.Color
1414
import androidx.compose.ui.graphics.Shape
1515
import androidx.compose.ui.text.TextStyle
1616
import androidx.compose.ui.tooling.preview.Preview
17+
import androidx.compose.ui.unit.Dp
1718
import androidx.compose.ui.unit.dp
1819
import com.plottwist.core.designsystem.foundation.TukColorTokens.Gray000
1920
import com.plottwist.core.designsystem.foundation.TukColorTokens.Gray200
@@ -85,21 +86,22 @@ fun TukOutlinedButton(
8586
}
8687

8788
@Composable
88-
private fun TukButton(
89+
fun TukButton(
8990
containerColor: Color,
9091
disabledContainerColor: Color,
9192
contentColor: Color,
9293
disabledContentColor: Color,
9394
onClick: () -> Unit,
9495
modifier: Modifier = Modifier,
96+
height: Dp = 52.dp,
9597
enabled: Boolean = true,
9698
shape:Shape = RoundedCornerShape(15.dp),
9799
contentPadding: PaddingValues = PaddingValues(vertical = 10.dp, horizontal = 10.dp),
98100
border: BorderStroke? = null,
99101
content: @Composable () -> Unit
100102
) {
101103
Button(
102-
modifier = modifier.height(52.dp),
104+
modifier = modifier.height(height),
103105
enabled = enabled,
104106
shape = shape,
105107
border = border,

core/designsystem/src/main/java/com/plottwist/core/designsystem/component/TopAppBar.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fun TukTopAppBar(
3333
Row(
3434
modifier = modifier
3535
.statusBarsPadding()
36-
.height(64.dp)
36+
.height(TOP_APP_BAR_HEIGHT.dp)
3737
.fillMaxWidth()
3838
.padding(
3939
start = if(type == TukTopAppBarType.PLAIN) 20.dp else 12.dp,
@@ -78,8 +78,9 @@ fun TopAppBarBackButton(
7878
}
7979
}
8080

81+
const val TOP_APP_BAR_HEIGHT = 64
8182

8283
enum class TukTopAppBarType {
8384
DEPTH,
8485
PLAIN
85-
}
86+
}

core/designsystem/src/main/java/com/plottwist/core/designsystem/foundation/type/SerifType.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ val TukSerifTypography = SerifTypography(
4141
letterSpacing = (-1.5).sp,
4242
fontWeight = FontWeight.Medium
4343
),
44+
title18M = SerifStyle.copy(
45+
fontSize = 18.sp,
46+
lineHeight = 25.sp,
47+
letterSpacing = (-1.5).sp,
48+
fontWeight = FontWeight.Medium
49+
),
4450
body18M = SerifStyle.copy(
4551
fontSize = 18.sp,
4652
lineHeight = 24.sp,
@@ -65,6 +71,7 @@ val TukSerifTypography = SerifTypography(
6571
data class SerifTypography(
6672
val title24M: TextStyle,
6773
val title22M: TextStyle,
74+
val title18M: TextStyle,
6875
val body18M: TextStyle,
6976
val body16M: TextStyle,
7077
val body14R: TextStyle,
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="16dp"
3+
android:height="16dp"
4+
android:viewportWidth="16"
5+
android:viewportHeight="16">
6+
<path
7+
android:pathData="M8,0C12.418,0 16,3.582 16,8C16,12.418 12.418,16 8,16C3.582,16 0,12.418 0,8C0,3.582 3.582,0 8,0ZM7.209,4.779L9.875,7.445H4V8.555H9.875L7.209,11.221L8,12L12,8L8,4L7.209,4.779Z"
8+
android:fillColor="#ffffff"/>
9+
</vector>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="24"
5+
android:viewportHeight="24">
6+
<path
7+
android:pathData="M14,18V6H17.5V18H14ZM6.5,18V6H10V18H6.5Z"
8+
android:fillColor="#ffffff"/>
9+
</vector>

core/designsystem/src/main/res/values/strings.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3-
<string name="home_title">누군가 나의 연락을\n기다리고 있을지도</string>
3+
<string name="home_title">친구들은 요즘\n어떻게 지내고 있을까요</string>
4+
<string name="home_subtitle">%s 님,</string>
45
<string name="home_bottom_sheet_nudging_text">툭, 찔러만봐</string>
6+
<string name="home_bottom_sheet_stop_text">멈추기</string>
57
<string name="home_bottom_create_gathering_description">모임을 생성하고\n넌지시 만남을 제안해 보세요</string>
68
<string name="home_bottom_create_gathering_button_text">모임 생성하기</string>
79
<string name="home_last_alarm">마지막 알람</string>
8-
<string name="home_random_proposal_description_prefix">연락이 뜸해진 우리</string>
10+
<string name="home_random_proposal_description_prefix">웃긴거 아는데, 우리</string>
911
<string name="home_random_proposal_description_suffix">어때</string>
1012
<string name="home_proposals">받은 초대장</string>
1113

@@ -44,5 +46,5 @@
4446

4547

4648
<string name="common_next">다음</string>
47-
49+
<string name="common_confirm">다음</string>
4850
</resources>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.plottwist.core.domain.model
2+
3+
data class MemberInfo(
4+
val memberId: Long,
5+
val email: String,
6+
val name: String
7+
)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
package com.plottwist.core.domain.onboarding
22

3+
import com.plottwist.core.domain.model.MemberInfo
4+
35
interface OnboardingRepository {
46
suspend fun updateOnboardingInfo(
57
name: String
68
): Result<Unit>
9+
10+
suspend fun getMemberInfo(): Result<MemberInfo>
711
}

0 commit comments

Comments
 (0)