-
Notifications
You must be signed in to change notification settings - Fork 2
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
[UI/#31] 탐색 뷰 / 검색 텍스트 필드 클릭 뷰 구현 #40
Changes from 8 commits
eb44238
04aab33
eef2bee
e9f0e90
e5e0099
9b856f5
35e4462
db3154b
a4673e2
bbddbbe
1d22fc0
9c1620e
8b4289b
6e5e813
a812c10
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 |
---|---|---|
@@ -1,14 +1,18 @@ | ||
package com.terning.core.designsystem.component.topappbar | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
|
||
@Composable | ||
fun BackButtonTopAppBar( | ||
title: String, onBackButtonClick: (() -> Unit), | ||
title: String, | ||
modifier: Modifier, | ||
onBackButtonClick: (() -> Unit), | ||
) { | ||
TerningBasicTopAppBar( | ||
title = title, | ||
showBackButton = true, | ||
modifier = modifier, | ||
onBackButtonClick = { onBackButtonClick.invoke() }, | ||
) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,14 +6,17 @@ import androidx.compose.material3.IconButton | |
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.text.style.TextAlign | ||
import com.terning.core.R | ||
import com.terning.core.designsystem.theme.TerningTheme | ||
|
||
@Composable | ||
fun MyPageTopAppBar() { | ||
fun MyPageTopAppBar( | ||
modifier: Modifier, | ||
) { | ||
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. LogoTopAppBar에는 Modifier 기본값을 주고, 여기선 안 준 이유가 있나용,,? 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. 꼼꼼하다,..! MyPage에도 추가하겠습니닷 |
||
TerningBasicTopAppBar( | ||
showBackButton = false, | ||
actions = listOf( | ||
|
@@ -36,6 +39,7 @@ fun MyPageTopAppBar() { | |
} | ||
} | ||
} | ||
) | ||
), | ||
modifier = modifier, | ||
) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package com.terning.core.designsystem.component.topappbar | ||
|
||
import androidx.compose.foundation.layout.WindowInsets | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material3.CenterAlignedTopAppBar | ||
import androidx.compose.material3.ExperimentalMaterial3Api | ||
|
@@ -21,6 +22,7 @@ import com.terning.core.designsystem.theme.White | |
@Composable | ||
fun TerningBasicTopAppBar( | ||
title: String = "", | ||
modifier: Modifier, | ||
showBackButton: Boolean = false, | ||
actions: List<@Composable () -> Unit> = emptyList(), | ||
onBackButtonClick: () -> Unit = {}, | ||
|
@@ -35,14 +37,17 @@ fun TerningBasicTopAppBar( | |
) | ||
|
||
}, | ||
modifier = modifier, | ||
navigationIcon = { | ||
if (showBackButton) { | ||
IconButton(onClick = { | ||
onBackButtonClick.invoke() | ||
}) { | ||
IconButton( | ||
onClick = { | ||
onBackButtonClick.invoke() | ||
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.
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. 빠른 삭제했읍니다. |
||
}) { | ||
Icon( | ||
painter = painterResource(id = R.drawable.ic_back), | ||
contentDescription = stringResource(id = R.string.ic_back) | ||
contentDescription = stringResource(id = R.string.ic_back), | ||
modifier = Modifier.padding(start = 8.dp) | ||
) | ||
} | ||
} else { | ||
|
@@ -55,6 +60,6 @@ fun TerningBasicTopAppBar( | |
} | ||
}, | ||
colors = TopAppBarDefaults.topAppBarColors(White), | ||
modifier = Modifier.padding(horizontal = 16.dp) | ||
windowInsets = WindowInsets(0, 0, 0, 0), | ||
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. named argument 작성해주세요!! 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. 넹! |
||
) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,12 @@ package com.terning.feature.home | |
|
||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material3.Scaffold | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import com.terning.core.designsystem.component.topappbar.LogoTopAppBar | ||
|
||
@Composable | ||
fun HomeRoute() { | ||
|
@@ -13,7 +16,18 @@ fun HomeRoute() { | |
|
||
@Composable | ||
fun HomeScreen() { | ||
Column(modifier = Modifier.fillMaxSize()) { | ||
Text(text = "홈 스크린") | ||
Scaffold( | ||
modifier = Modifier, | ||
topBar = { | ||
LogoTopAppBar() | ||
} | ||
) { paddingValues -> | ||
Column( | ||
modifier = Modifier | ||
.fillMaxSize() | ||
Comment on lines
+25
to
+27
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 변수 가져와도 될 것 같아요..!! 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. 이게 사실 효빈님 뷰라서 탑바만 적용한거라 효빈님이 바꿔주신다고합니당ㅎㅎ |
||
.padding(paddingValues) | ||
) { | ||
Text(text = "홈 스크린") | ||
} | ||
} | ||
} |
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.
요거 String 기본값 추가하신 이유가 궁금해요!!
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.
BasicTextField 기본 속성이라서 삭제하면 에러가 납니당..!