-
Notifications
You must be signed in to change notification settings - Fork 2
[feat/#35] onboarding signup 뷰 구현 #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7d45082
53f8d20
46d5f24
46cddf1
f07c21c
26ad086
3586351
32762e8
f90b4c4
33d3d76
7234c02
8bfe2c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ import androidx.compose.foundation.layout.width | |
| import androidx.compose.foundation.lazy.LazyColumn | ||
| import androidx.compose.foundation.shape.RoundedCornerShape | ||
| import androidx.compose.material3.Divider | ||
| import androidx.compose.material3.HorizontalDivider | ||
| import androidx.compose.material3.Icon | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
|
|
@@ -152,7 +153,7 @@ fun CourseDetail( | |
| style = PawKeyTheme.typography.caption12Sb1, | ||
| color = PawKeyTheme.colors.gray200 | ||
| ) | ||
| Divider(modifier = Modifier.padding(10.dp)) | ||
| HorizontalDivider(modifier = Modifier.padding(10.dp)) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 굿 |
||
|
|
||
| Text( | ||
| text = "이런 점이 좋았어요", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| @file:Suppress("DEPRECATION") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ? 확인예정 |
||
|
|
||
| package com.paw.key.presentation.ui.home | ||
|
|
||
| import android.app.Activity | ||
|
|
@@ -14,15 +16,17 @@ import androidx.compose.foundation.layout.fillMaxSize | |
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.layout.width | ||
| import androidx.compose.material3.SnackbarHostState | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.runtime.SideEffect | ||
| import androidx.compose.runtime.collectAsState | ||
| import androidx.compose.runtime.getValue | ||
| import androidx.compose.runtime.remember | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.graphics.Color | ||
| import androidx.compose.ui.graphics.toArgb | ||
| import androidx.compose.ui.platform.LocalView | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
| import androidx.core.view.ViewCompat | ||
| import androidx.hilt.navigation.compose.hiltViewModel | ||
|
|
@@ -37,21 +41,28 @@ import com.paw.key.presentation.ui.home.component.TrackingCard | |
| import com.paw.key.presentation.ui.home.component.WeatherCard | ||
| import com.paw.key.presentation.ui.home.viewmodel.HomeViewModel | ||
|
|
||
| @Preview | ||
| @Composable | ||
| private fun HomeScreenPreview() { | ||
| PawKeyTheme { | ||
| HomeScreen( | ||
| paddingValues = PaddingValues(), | ||
| navigateNext = {},) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| @Composable | ||
| fun HomeRoute( | ||
| paddingValues: PaddingValues, | ||
| navigateUp: () -> Unit, | ||
| navigateNext: () -> Unit, | ||
| snackBarHostState: SnackbarHostState, | ||
| modifier: Modifier = Modifier, | ||
| viewModel: HomeViewModel = hiltViewModel(), | ||
| ) { | ||
|
|
||
| HomeScreen( | ||
| paddingValues = paddingValues, | ||
| navigateUp = navigateUp, | ||
| navigateNext = navigateNext, | ||
| snackBarHostState = snackBarHostState, | ||
| modifier = modifier, | ||
| viewModel = viewModel | ||
| ) | ||
|
|
@@ -60,13 +71,11 @@ fun HomeRoute( | |
| @Composable | ||
| fun HomeScreen( | ||
| paddingValues: PaddingValues, | ||
| navigateUp: () -> Unit, | ||
| navigateNext: () -> Unit, | ||
| snackBarHostState: SnackbarHostState, | ||
| modifier: Modifier = Modifier, | ||
| viewModel: HomeViewModel, | ||
| viewModel: HomeViewModel = hiltViewModel(), | ||
| ) { | ||
| val isLocationMenuVisible = viewModel.isLocationMenuVisible | ||
| val state by viewModel.state.collectAsState() | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. collectAsState는 Composable 앱이 백그라운드로 가거나 화면이 가려져도 Flow는 계속 데이터를 발행하고 이에 따라 UI 상태도 계속 업데이트될 수 있습ㄴ니다 그렇기에?! 안드로이드 생명주기에 맞게 조정될 수 있도록 collectAsStateWithLifecycle로 해주세요
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 생명주기 생각하면서 적용해보겠습니답 |
||
| val view = LocalView.current | ||
| val window = (view.context as? Activity)?.window | ||
|
|
||
|
|
@@ -113,7 +122,7 @@ fun HomeScreen( | |
|
|
||
| Spacer(modifier = Modifier.width(12.dp)) | ||
|
|
||
| TrackingCard(onClick = {navigateNext()}) | ||
| TrackingCard(onClick = { navigateNext() }) | ||
| } | ||
|
|
||
| Spacer(modifier = Modifier.height(12.dp)) | ||
|
|
@@ -124,7 +133,7 @@ fun HomeScreen( | |
| } | ||
|
|
||
| } | ||
| if (isLocationMenuVisible) { | ||
| if (state.isLocationMenuVisible) { | ||
| Box( | ||
| modifier = Modifier | ||
| .fillMaxSize() | ||
|
|
@@ -146,20 +155,3 @@ fun HomeScreen( | |
| } | ||
| } | ||
| } | ||
|
|
||
| //@Preview | ||
| //@Composable | ||
| //private fun HomeScreenPreview() { | ||
| // PawKeyTheme { | ||
| // HomeScreen( | ||
| // paddingValues = PaddingValues(), | ||
| // navigateUp = {}, | ||
| // navigateNext = {}, | ||
| // snackBarHostState = SnackbarHostState(), | ||
| // | ||
| // ) | ||
| // | ||
| // } | ||
| // | ||
| //} | ||
| // viewmodel 을 파라미터로 넣으면 못본다! 알고싶지않았음 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,7 +30,7 @@ private fun PreviewSettingButton() { | |
| } | ||
|
|
||
| @Composable | ||
| internal fun SettingButton(){ | ||
| fun SettingButton(){ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 상위에서 하위 컴ㅁ포넌트를 아직은 조절하지 않더라도 꼭 선언해서 사용해주세요 재사용성을 위해 통로를 열어두는 것을 위해! |
||
| Box( | ||
| modifier = Modifier | ||
| .height(64.dp) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,7 @@ private fun PreviewTrackingCard() { | |
| } | ||
|
|
||
| @Composable | ||
| internal fun TrackingCard( | ||
| fun TrackingCard( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. modifier .. ㅡㅡ |
||
| onClick: () -> Unit, | ||
| ) { | ||
| Box( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
뺏으니까 확인 필요하면 toml에 설정할 수 있도록 해주세요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넹!