Skip to content

Commit eec3207

Browse files
authored
Merge pull request #47 from PAW-KEY/feat/#35-onboarding-signup
[feat/#35] onboarding signup 뷰 구현
2 parents e9e8f77 + 8bfe2c3 commit eec3207

Some content is hidden

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

43 files changed

+1669
-112
lines changed

app/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,8 @@ dependencies {
9292

9393
//실시간 위치
9494
implementation(libs.play.services.location)
95+
96+
// 회원가입
97+
implementation ("androidx.compose.foundation:foundation:1.4.0")
98+
9599
}

app/src/main/java/com/paw/key/core/designsystem/component/CourseDetail.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import androidx.compose.foundation.layout.width
1515
import androidx.compose.foundation.lazy.LazyColumn
1616
import androidx.compose.foundation.shape.RoundedCornerShape
1717
import androidx.compose.material3.Divider
18+
import androidx.compose.material3.HorizontalDivider
1819
import androidx.compose.material3.Icon
1920
import androidx.compose.material3.Text
2021
import androidx.compose.runtime.Composable
@@ -152,7 +153,7 @@ fun CourseDetail(
152153
style = PawKeyTheme.typography.caption12Sb1,
153154
color = PawKeyTheme.colors.gray200
154155
)
155-
Divider(modifier = Modifier.padding(10.dp))
156+
HorizontalDivider(modifier = Modifier.padding(10.dp))
156157

157158
Text(
158159
text = "이런 점이 좋았어요",

app/src/main/java/com/paw/key/core/designsystem/component/PawkeyButton.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package com.paw.key.core.designsystem.component
22

33
import androidx.compose.foundation.BorderStroke
4+
import androidx.compose.foundation.background
5+
import androidx.compose.foundation.border
6+
import androidx.compose.foundation.layout.Box
47
import androidx.compose.foundation.layout.Column
58
import androidx.compose.foundation.layout.Spacer
69
import androidx.compose.foundation.layout.fillMaxWidth
@@ -11,11 +14,14 @@ import androidx.compose.material3.Button
1114
import androidx.compose.material3.ButtonDefaults
1215
import androidx.compose.material3.Text
1316
import androidx.compose.runtime.Composable
17+
import androidx.compose.ui.Alignment
1418
import androidx.compose.ui.Modifier
1519
import androidx.compose.ui.graphics.Color
20+
import androidx.compose.ui.draw.clip
1621
import androidx.compose.ui.tooling.preview.Preview
1722
import androidx.compose.ui.unit.dp
1823
import com.paw.key.core.designsystem.theme.PawKeyTheme
24+
import com.paw.key.core.util.noRippleClickable
1925

2026

2127
@Preview(showBackground = true)
@@ -91,7 +97,6 @@ fun PawkeyButton(
9197
}
9298

9399
val borderColor = when {
94-
isBorder -> Color.Transparent
95100
enabled && isBackGround -> PawKeyTheme.colors.green500
96101
!enabled && isBackGround -> PawKeyTheme.colors.gray200
97102
else -> PawKeyTheme.colors.white1

app/src/main/java/com/paw/key/core/designsystem/component/SubChip.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ private fun PreviewSubChip() {
1717
SubChip(
1818
text = "4km"
1919
)
20-
2120
}
2221

2322
@Composable
@@ -36,9 +35,7 @@ fun SubChip(
3635
Text(
3736
text = text,
3837
color = PawKeyTheme.colors.gray300,
39-
4038
style = PawKeyTheme.typography.body14M
4139
)
4240
}
43-
4441
}

app/src/main/java/com/paw/key/core/designsystem/theme/Type.kt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ val PretendardRegular = FontFamily(Font(R.font.pretendard_regular, FontWeight.No
2222
// Todo : 네이밍과 함께 나중에 lineHeight 등 변경 예정
2323
@Stable
2424
class PawKeyTypography internal constructor(
25+
head24B: TextStyle,
26+
head24Sb: TextStyle,
2527
head22B: TextStyle,
2628
head22Sb: TextStyle,
2729
head20B1: TextStyle,
@@ -38,6 +40,10 @@ class PawKeyTypography internal constructor(
3840
caption12M: TextStyle,
3941
caption12R: TextStyle
4042
) {
43+
var head24B: TextStyle by mutableStateOf(head24B)
44+
private set
45+
var head24Sb: TextStyle by mutableStateOf(head24B)
46+
private set
4147
var head22B: TextStyle by mutableStateOf(head22B)
4248
private set
4349
var head22Sb: TextStyle by mutableStateOf(head22Sb)
@@ -70,6 +76,8 @@ class PawKeyTypography internal constructor(
7076
private set
7177

7278
fun copy(
79+
head24B: TextStyle = this.head24B,
80+
head24Sb: TextStyle = this.head24Sb,
7381
head22B: TextStyle = this.head22B,
7482
head22Sb: TextStyle = this.head22Sb,
7583
head20B1: TextStyle = this.head20B1,
@@ -86,6 +94,8 @@ class PawKeyTypography internal constructor(
8694
caption12M: TextStyle = this.caption12M,
8795
caption12R: TextStyle = this.caption12R
8896
): PawKeyTypography = PawKeyTypography(
97+
head24B,
98+
head24Sb,
8999
head22B,
90100
head22Sb,
91101
head20B1,
@@ -104,6 +114,8 @@ class PawKeyTypography internal constructor(
104114
)
105115

106116
fun update(other: PawKeyTypography) {
117+
head24B = other.head24B
118+
head24Sb = other.head24Sb
107119
head22B = other.head22B
108120
head22Sb = other.head22Sb
109121
head20B1 = other.head20B1
@@ -143,6 +155,20 @@ fun pawKeyTextStyle(
143155
@Composable
144156
fun pawKeyTypography(): PawKeyTypography {
145157
return PawKeyTypography(
158+
head24B = pawKeyTextStyle(
159+
fontFamily = PretendardBold,
160+
fontWeight = FontWeight.Bold,
161+
fontSize = 24.sp,
162+
lineHeight = (24 * 1.0).sp,
163+
letterSpacing = TextUnit.Unspecified
164+
),
165+
head24Sb = pawKeyTextStyle(
166+
fontFamily = PretendardSemiBold,
167+
fontWeight = FontWeight.SemiBold,
168+
fontSize = 24.sp,
169+
lineHeight = (24 * 1.4).sp,
170+
letterSpacing = TextUnit.Unspecified
171+
),
146172
head22B = pawKeyTextStyle(
147173
fontFamily = PretendardBold,
148174
fontWeight = FontWeight.Bold,

app/src/main/java/com/paw/key/presentation/ui/home/HomeScreen.kt

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@file:Suppress("DEPRECATION")
2+
13
package com.paw.key.presentation.ui.home
24

35
import android.app.Activity
@@ -14,15 +16,17 @@ import androidx.compose.foundation.layout.fillMaxSize
1416
import androidx.compose.foundation.layout.height
1517
import androidx.compose.foundation.layout.padding
1618
import androidx.compose.foundation.layout.width
17-
import androidx.compose.material3.SnackbarHostState
1819
import androidx.compose.runtime.Composable
1920
import androidx.compose.runtime.SideEffect
21+
import androidx.compose.runtime.collectAsState
22+
import androidx.compose.runtime.getValue
2023
import androidx.compose.runtime.remember
2124
import androidx.compose.ui.Alignment
2225
import androidx.compose.ui.Modifier
2326
import androidx.compose.ui.graphics.Color
2427
import androidx.compose.ui.graphics.toArgb
2528
import androidx.compose.ui.platform.LocalView
29+
import androidx.compose.ui.tooling.preview.Preview
2630
import androidx.compose.ui.unit.dp
2731
import androidx.core.view.ViewCompat
2832
import androidx.hilt.navigation.compose.hiltViewModel
@@ -37,21 +41,28 @@ import com.paw.key.presentation.ui.home.component.TrackingCard
3741
import com.paw.key.presentation.ui.home.component.WeatherCard
3842
import com.paw.key.presentation.ui.home.viewmodel.HomeViewModel
3943

44+
@Preview
45+
@Composable
46+
private fun HomeScreenPreview() {
47+
PawKeyTheme {
48+
HomeScreen(
49+
paddingValues = PaddingValues(),
50+
navigateNext = {},)
51+
}
52+
53+
}
54+
4055
@Composable
4156
fun HomeRoute(
4257
paddingValues: PaddingValues,
43-
navigateUp: () -> Unit,
4458
navigateNext: () -> Unit,
45-
snackBarHostState: SnackbarHostState,
4659
modifier: Modifier = Modifier,
4760
viewModel: HomeViewModel = hiltViewModel(),
4861
) {
4962

5063
HomeScreen(
5164
paddingValues = paddingValues,
52-
navigateUp = navigateUp,
5365
navigateNext = navigateNext,
54-
snackBarHostState = snackBarHostState,
5566
modifier = modifier,
5667
viewModel = viewModel
5768
)
@@ -60,13 +71,11 @@ fun HomeRoute(
6071
@Composable
6172
fun HomeScreen(
6273
paddingValues: PaddingValues,
63-
navigateUp: () -> Unit,
6474
navigateNext: () -> Unit,
65-
snackBarHostState: SnackbarHostState,
6675
modifier: Modifier = Modifier,
67-
viewModel: HomeViewModel,
76+
viewModel: HomeViewModel = hiltViewModel(),
6877
) {
69-
val isLocationMenuVisible = viewModel.isLocationMenuVisible
78+
val state by viewModel.state.collectAsState()
7079
val view = LocalView.current
7180
val window = (view.context as? Activity)?.window
7281

@@ -113,7 +122,7 @@ fun HomeScreen(
113122

114123
Spacer(modifier = Modifier.width(12.dp))
115124

116-
TrackingCard(onClick = {navigateNext()})
125+
TrackingCard(onClick = { navigateNext() })
117126
}
118127

119128
Spacer(modifier = Modifier.height(12.dp))
@@ -124,7 +133,7 @@ fun HomeScreen(
124133
}
125134

126135
}
127-
if (isLocationMenuVisible) {
136+
if (state.isLocationMenuVisible) {
128137
Box(
129138
modifier = Modifier
130139
.fillMaxSize()
@@ -146,20 +155,3 @@ fun HomeScreen(
146155
}
147156
}
148157
}
149-
150-
//@Preview
151-
//@Composable
152-
//private fun HomeScreenPreview() {
153-
// PawKeyTheme {
154-
// HomeScreen(
155-
// paddingValues = PaddingValues(),
156-
// navigateUp = {},
157-
// navigateNext = {},
158-
// snackBarHostState = SnackbarHostState(),
159-
//
160-
// )
161-
//
162-
// }
163-
//
164-
//}
165-
// viewmodel 을 파라미터로 넣으면 못본다! 알고싶지않았음

app/src/main/java/com/paw/key/presentation/ui/home/component/DaytimeCard.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,20 @@ import com.paw.key.core.designsystem.theme.PawKeyTheme
2020

2121
@Preview(showBackground = true)
2222
@Composable
23-
private fun previewDaytimeCard() {
23+
private fun PreviewDaytimeCard() {
2424
PawKeyTheme {
2525
DaytimeCard(daytime = "05:06", daystate = "일출")
2626
}
2727
}
2828

2929
@Composable
30-
internal fun DaytimeCard(
30+
fun DaytimeCard(
3131
daytime: String,
3232
daystate: String,
33+
modifier: Modifier = Modifier,
3334
) {
3435
Box(
35-
modifier = Modifier
36+
modifier = modifier
3637
.width(81.dp)
3738
.height(110.dp)
3839
.background(color = PawKeyTheme.colors.white1)
@@ -42,7 +43,6 @@ internal fun DaytimeCard(
4243
horizontalAlignment = Alignment.CenterHorizontally,
4344
verticalArrangement = Arrangement.spacedBy(31.dp),
4445
modifier = Modifier
45-
.fillMaxWidth()
4646
.fillMaxWidth()
4747
.padding(horizontal = 11.dp, vertical = 12.dp),
4848
) {

app/src/main/java/com/paw/key/presentation/ui/home/component/HistoryCard.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@ private fun PreviewHistoryCard() {
3333
}
3434

3535
@Composable
36-
internal fun HistoryCard(
37-
36+
fun HistoryCard(
37+
modifier: Modifier = Modifier,
3838
) {
3939
Box(
40-
modifier = Modifier
40+
modifier = modifier
4141
.fillMaxWidth()
4242
.height(298.dp)
43+
.clip(RoundedCornerShape(12.dp))
4344
.background(
4445
color = PawKeyTheme.colors.white2,
45-
shape = RoundedCornerShape(12.dp)
4646
),
47+
4748
) {
48-
Column()
49-
{
49+
Column {
5050
Box(
5151
modifier = Modifier
5252
.fillMaxWidth()

app/src/main/java/com/paw/key/presentation/ui/home/component/HistoryChip.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ private fun PreviewHistoryChip() {
2222
}
2323

2424
@Composable
25-
internal fun HistoryChip(
25+
fun HistoryChip(
2626
text: String,
2727
modifier: Modifier = Modifier,
2828
) {

app/src/main/java/com/paw/key/presentation/ui/home/component/RowCalendar.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,12 @@ private fun PreviewRowCalendar() {
5252
}
5353

5454
@Composable
55-
internal fun RowCalendar(
55+
fun RowCalendar(
5656
date: String,
57+
modifier: Modifier = Modifier,
5758
) {
5859
Box(
59-
modifier = Modifier
60+
modifier = modifier
6061
.fillMaxWidth()
6162
.height(103.dp)
6263
.border(
@@ -100,11 +101,12 @@ internal fun RowCalendar(
100101
private fun CalendarItem(
101102
date: String,
102103
day: String,
104+
modifier: Modifier = Modifier,
103105
state: Boolean = false,
104106
) {
105107
Column(
106108
horizontalAlignment = Alignment.CenterHorizontally,
107-
modifier = Modifier
109+
modifier = modifier
108110
.width(42.dp)
109111
.height(74.dp),
110112
) {

0 commit comments

Comments
 (0)