-
Notifications
You must be signed in to change notification settings - Fork 34
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
π 1λ¨κ³ - μ₯λ°κ΅¬λ(μν λͺ©λ‘) #80
Conversation
μν λͺ©λ‘ κ΄λ ¨ μ½λλ₯Ό ν¨ν€μ§λ‘ λΆλ¦¬
Box( | ||
modifier = Modifier | ||
.padding(end = 8.dp) | ||
.size(48.dp) | ||
.align(Alignment.CenterEnd) | ||
.clickable(onClick = onClickCart), | ||
contentAlignment = Alignment.Center | ||
) { | ||
Icon( | ||
modifier = Modifier.size(24.dp), | ||
imageVector = Icons.Filled.ShoppingCart, | ||
contentDescription = stringResource(R.string.shopping_cart) | ||
) | ||
} |
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.
μμ΄μ½ μ체μ ν¬κΈ°λ 24, ν΄λ¦ λ²μμ ν΄λΉνλ μμ ν¬κΈ°λ 48μ΄μ΄μ μ΄λ κ² Boxλ‘ Iconμ κ°μΈλ ννλ‘ UIλ₯Ό κ·Έλ Έλλ°μ,
νμ¬ νλ‘λνΈμμλ μ¬λ§ν μμ΄μ½μ μ΄μ κ°μ νμμΌλ‘ λμμΈμ΄ μ£Όμ΄μ§κ³ , νμ μ΄λ° λ°©μμΌλ‘ μ½λλ₯Ό μμ±νμ΅λλ€~
λ―Έμ
μ νλ€λ³΄λ λ¬Έλ λ€λ₯Έ κ³³μμλ μ΄λ»κ² μ²λ¦¬νλμ§ κΆκΈν΄μ‘μ΅λλ€
νΉμ μ΄λ° κ²½μ°μλ μ΄λ»κ² μ²λ¦¬νμλ νΈμ΄μ κ°μ?
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.
μ ν¬ νμ¬μμλ μμ΄μ½μ ν¬κΈ°κ° 곧 ν°μΉ λ°μ€μ ν¬κΈ°μ¬μμ! κ·Έλμ λ°λ‘ ν°μΉ μμμ μ§μ νμ§λ μκ³ μμ΄μ.
μμ΄μ½μ ν°μΉ μμμ΄ μ»€μ§λ κ²½μ°λ λλΆλΆ λ€λ₯Έ μ»΄ν¬λνΈμ μ‘°ν©μΌλ‘ νμ΄μ λμμΈμ ꡬμ±ν΄μ£Όμλ νΈμ΄μμ.
Boxλ₯Ό λνν΄λ³Ό μλ μμ§λ§, modifierμ ν¨λ©λ±μ νμ©ν΄μλ ν°μΉμμμ μ‘°μ ν΄λ³Ό μ μμ κ² κ°λ€μ!
@Preview(showBackground = true) | ||
@Composable | ||
private fun ProductItemPreview() { | ||
ShoppingCartTheme { | ||
ProductItem( | ||
product = Product( | ||
imageUrl = "https://picsum.photos/200", | ||
name = "μ ν λ§λΌν (κΈ°λ³Έ 12000μ)", | ||
price = 85000000 | ||
), | ||
modifier = Modifier.width(150.dp) | ||
) | ||
} | ||
} |
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.
coil μ΄λ―Έμ§κ° Previewμμ νμλμ§ μμ ν리뷰λ₯Ό 보면μ μ΄λ―Έμ§ λ²μλ₯Ό κ°λ νκΈ°κ° νλ€μμ΅λλ€
κ·Έλμ placeHolderλ₯Ό μ£Όκ³ λλ°μ΄μ€μ Previewλ₯Ό μ€νμν€λ©΄μ UIλ₯Ό νμΈνμ΅λλ€
λκ°.. ν리뷰μμ μμ보기 μ’μ λ°©λ² μμκΉμ?
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.
μ΄κ²... μ λ§ λΆνΈνμ£
μ ν¬ νμμλ μ΄λ―Έμ§λ₯Ό λΆλ¬μ€λ μ»΄ν¬λνΈκ° κ±°μ μ ν΄μ Έμμ΄μ, ν΄λΉ λμμΈ μ»΄ν¬λνΈμ νλ¦¬λ·°μΈ κ²½μ° λ‘컬 μ΄λ―Έμ§λ₯Ό 보μ¬μ£Όλλ‘ μ€μ ν΄λμ΄μ.
μ격 μ΄λ―Έμ§λ₯Ό 보μ¬μ€ μλ μμ§λ§ μ΄λ―Έμ§ μμ²΄κ° μμ 보μ΄μ§ μλ λ¬Έμ λ₯Ό LocalInspectionMode.currentλ₯Ό νμ©ν΄μ ν΄κ²°νμ΄μ!
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.
1λ¨κ³ λ―Έμ
κ³ μ λ§μΌμ
¨μ΄μ!
λ―Έμ
μꡬμ¬νμ λ무 μ ꡬνν΄μ£Όμ
μ ν¬κ² νΌλλ°± λ릴 λΆλΆμ΄ μμλ€μ π
λ€μ λ―Έμ
μ§νμ μν΄ λ¨Έμ§νκ² μ΅λλ€! μμ£ΌκΉμ§ νμ΄ν
μ΄μμ πͺ
@Preview(showBackground = true) | ||
@Composable | ||
private fun ProductItemPreview() { | ||
ShoppingCartTheme { | ||
ProductItem( | ||
product = Product( | ||
imageUrl = "https://picsum.photos/200", | ||
name = "μ ν λ§λΌν (κΈ°λ³Έ 12000μ)", | ||
price = 85000000 | ||
), | ||
modifier = Modifier.width(150.dp) | ||
) | ||
} | ||
} |
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.
μ΄κ²... μ λ§ λΆνΈνμ£
μ ν¬ νμμλ μ΄λ―Έμ§λ₯Ό λΆλ¬μ€λ μ»΄ν¬λνΈκ° κ±°μ μ ν΄μ Έμμ΄μ, ν΄λΉ λμμΈ μ»΄ν¬λνΈμ νλ¦¬λ·°μΈ κ²½μ° λ‘컬 μ΄λ―Έμ§λ₯Ό 보μ¬μ£Όλλ‘ μ€μ ν΄λμ΄μ.
μ격 μ΄λ―Έμ§λ₯Ό 보μ¬μ€ μλ μμ§λ§ μ΄λ―Έμ§ μμ²΄κ° μμ 보μ΄μ§ μλ λ¬Έμ λ₯Ό LocalInspectionMode.currentλ₯Ό νμ©ν΄μ ν΄κ²°νμ΄μ!
Box( | ||
modifier = Modifier | ||
.padding(end = 8.dp) | ||
.size(48.dp) | ||
.align(Alignment.CenterEnd) | ||
.clickable(onClick = onClickCart), | ||
contentAlignment = Alignment.Center | ||
) { | ||
Icon( | ||
modifier = Modifier.size(24.dp), | ||
imageVector = Icons.Filled.ShoppingCart, | ||
contentDescription = stringResource(R.string.shopping_cart) | ||
) | ||
} |
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.
μ ν¬ νμ¬μμλ μμ΄μ½μ ν¬κΈ°κ° 곧 ν°μΉ λ°μ€μ ν¬κΈ°μ¬μμ! κ·Έλμ λ°λ‘ ν°μΉ μμμ μ§μ νμ§λ μκ³ μμ΄μ.
μμ΄μ½μ ν°μΉ μμμ΄ μ»€μ§λ κ²½μ°λ λλΆλΆ λ€λ₯Έ μ»΄ν¬λνΈμ μ‘°ν©μΌλ‘ νμ΄μ λμμΈμ ꡬμ±ν΄μ£Όμλ νΈμ΄μμ.
Boxλ₯Ό λνν΄λ³Ό μλ μμ§λ§, modifierμ ν¨λ©λ±μ νμ©ν΄μλ ν°μΉμμμ μ‘°μ ν΄λ³Ό μ μμ κ² κ°λ€μ!
onClickCart: () -> Unit = {} | ||
) { |
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.
리μ€λ μ΄λ¦μ on + λͺ©μ μ΄ + λμ¬
ννλ‘ μμ±ν΄λ³΄λ 건 μ΄λ¨κΉμ?
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.
μ»΄ν¬λνΈλ€μ μλ―Έμλ λ¨μλ‘ μ λΆλ¦¬ν΄μ£Όμ ¨λ€μ π
) { innerPadding -> | ||
LazyVerticalGrid( | ||
modifier = Modifier.fillMaxSize() | ||
.background(color = Color.White) | ||
.padding(innerPadding), |
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.
Scaffoldμ innerPadding κ°μ μ νμ©ν΄μ£Όμ ¨λ€μ! π
π 1λ¨κ³ - μ₯λ°κ΅¬λ(μν λͺ©λ‘)