Skip to content
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

Merged
merged 8 commits into from
Feb 15, 2025

Conversation

yangsooplus
Copy link

πŸš€ 1단계 - μž₯λ°”κ΅¬λ‹ˆ(μƒν’ˆ λͺ©λ‘)

  • coil μ˜μ‘΄μ„±, 인터넷 κΆŒν•œ μ„€μ •
  • μƒν’ˆ 데이터 클래슀 μ •μ˜
  • μƒν’ˆ μ•„μ΄ν…œ UI μ»΄ν¬λ„ŒνŠΈ κ΅¬ν˜„
  • μƒν’ˆ λͺ©λ‘ 상단 μ•±λ°” κ΅¬ν˜„
  • μƒν’ˆ λͺ©λ‘ ν™”λ©΄ κ΅¬ν˜„

  • μ§ˆλ¬Έμ€ ν•΄λ‹Ή 뢀뢄에 μ½”λ©˜νŠΈλ‘œ λ‹¬μ•„λ‘κ² μŠ΅λ‹ˆλ‹€!

Comment on lines +41 to +54
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)
)
}
Copy link
Author

@yangsooplus yangsooplus Feb 14, 2025

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λ₯Ό κ·Έλ ΈλŠ”λ°μš”,
νšŒμ‚¬ ν”„λ‘œλ•νŠΈμ—μ„œλ„ μ›¬λ§Œν•œ μ•„μ΄μ½˜μ€ 이와 같은 ν˜•μ‹μœΌλ‘œ λ””μžμΈμ΄ 주어지고, 항상 이런 λ°©μ‹μœΌλ‘œ μ½”λ“œλ₯Ό μž‘μ„±ν–ˆμŠ΅λ‹ˆλ‹€~
λ―Έμ…˜μ„ ν•˜λ‹€λ³΄λ‹ˆ 문득 λ‹€λ₯Έ κ³³μ—μ„œλŠ” μ–΄λ–»κ²Œ μ²˜λ¦¬ν•˜λŠ”μ§€ κΆκΈˆν•΄μ‘ŒμŠ΅λ‹ˆλ‹€

ν˜Ήμ‹œ 이런 κ²½μš°μ—λŠ” μ–΄λ–»κ²Œ μ²˜λ¦¬ν•˜μ‹œλŠ” νŽΈμ΄μ‹ κ°€μš”?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저희 νšŒμ‚¬μ—μ„œλŠ” μ•„μ΄μ½˜μ˜ 크기가 곧 ν„°μΉ˜ λ°•μŠ€μ˜ ν¬κΈ°μ—¬μ„œμš”! κ·Έλž˜μ„œ λ”°λ‘œ ν„°μΉ˜ μ˜μ—­μ„ μ§€μ •ν•˜μ§€λŠ” μ•Šκ³  μžˆμ–΄μš”.
μ•„μ΄μ½˜μ˜ ν„°μΉ˜ μ˜μ—­μ΄ μ»€μ§€λŠ” κ²½μš°λŠ” λŒ€λΆ€λΆ„ λ‹€λ₯Έ μ»΄ν¬λ„ŒνŠΈμ˜ μ‘°ν•©μœΌλ‘œ ν’€μ–΄μ„œ λ””μžμΈμ„ κ΅¬μ„±ν•΄μ£Όμ‹œλŠ” νŽΈμ΄μ—μš”.

Boxλ₯Ό λž˜ν•‘ν•΄λ³Ό μˆ˜λ„ μžˆμ§€λ§Œ, modifier의 νŒ¨λ”©λ“±μ„ ν™œμš©ν•΄μ„œλ„ ν„°μΉ˜μ˜μ—­μ„ μ‘°μ ˆν•΄λ³Ό 수 μžˆμ„ 것 κ°™λ„€μš”!

Comment on lines +59 to +72
@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)
)
}
}
Copy link
Author

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λ₯Ό ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€

λ­”κ°€.. ν”„λ¦¬λ·°μ—μ„œ μ•Œμ•„λ³΄κΈ° 쒋은 방법 μžˆμ„κΉŒμš”?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이것... 정말 λΆˆνŽΈν•˜μ£ 
저희 νŒ€μ—μ„œλŠ” 이미지λ₯Ό λΆˆλŸ¬μ˜€λŠ” μ»΄ν¬λ„ŒνŠΈκ°€ 거의 μ •ν•΄μ Έμžˆμ–΄μ„œ, ν•΄λ‹Ή λ””μžμΈ μ»΄ν¬λ„ŒνŠΈμ— 프리뷰인 경우 둜컬 이미지λ₯Ό 보여주도둝 μ„€μ •ν•΄λ’€μ–΄μš”.
원격 이미지λ₯Ό 보여쀄 μˆ˜λŠ” μ—†μ§€λ§Œ 이미지 μžμ²΄κ°€ μ•„μ˜ˆ 보이지 μ•ŠλŠ” 문제λ₯Ό LocalInspectionMode.currentλ₯Ό ν™œμš©ν•΄μ„œ ν•΄κ²°ν–ˆμ–΄μš”!

Copy link
Member

@malibinYun malibinYun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1단계 λ―Έμ…˜ 고생 λ§ŽμœΌμ…¨μ–΄μš”!
λ―Έμ…˜ μš”κ΅¬μ‚¬ν•­μ„ λ„ˆλ¬΄ 잘 κ΅¬ν˜„ν•΄μ£Όμ…”μ„œ 크게 ν”Όλ“œλ°± λ“œλ¦΄ 뢀뢄이 μ—†μ—ˆλ„€μš” πŸ‘
λ‹€μŒ λ―Έμ…˜ 진행을 μœ„ν•΄ λ¨Έμ§€ν•˜κ² μŠ΅λ‹ˆλ‹€! μ™„μ£ΌκΉŒμ§€ ν™”μ΄νŒ…μ΄μ—μš” πŸ’ͺ

Comment on lines +59 to +72
@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)
)
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이것... 정말 λΆˆνŽΈν•˜μ£ 
저희 νŒ€μ—μ„œλŠ” 이미지λ₯Ό λΆˆλŸ¬μ˜€λŠ” μ»΄ν¬λ„ŒνŠΈκ°€ 거의 μ •ν•΄μ Έμžˆμ–΄μ„œ, ν•΄λ‹Ή λ””μžμΈ μ»΄ν¬λ„ŒνŠΈμ— 프리뷰인 경우 둜컬 이미지λ₯Ό 보여주도둝 μ„€μ •ν•΄λ’€μ–΄μš”.
원격 이미지λ₯Ό 보여쀄 μˆ˜λŠ” μ—†μ§€λ§Œ 이미지 μžμ²΄κ°€ μ•„μ˜ˆ 보이지 μ•ŠλŠ” 문제λ₯Ό LocalInspectionMode.currentλ₯Ό ν™œμš©ν•΄μ„œ ν•΄κ²°ν–ˆμ–΄μš”!

Comment on lines +41 to +54
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)
)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저희 νšŒμ‚¬μ—μ„œλŠ” μ•„μ΄μ½˜μ˜ 크기가 곧 ν„°μΉ˜ λ°•μŠ€μ˜ ν¬κΈ°μ—¬μ„œμš”! κ·Έλž˜μ„œ λ”°λ‘œ ν„°μΉ˜ μ˜μ—­μ„ μ§€μ •ν•˜μ§€λŠ” μ•Šκ³  μžˆμ–΄μš”.
μ•„μ΄μ½˜μ˜ ν„°μΉ˜ μ˜μ—­μ΄ μ»€μ§€λŠ” κ²½μš°λŠ” λŒ€λΆ€λΆ„ λ‹€λ₯Έ μ»΄ν¬λ„ŒνŠΈμ˜ μ‘°ν•©μœΌλ‘œ ν’€μ–΄μ„œ λ””μžμΈμ„ κ΅¬μ„±ν•΄μ£Όμ‹œλŠ” νŽΈμ΄μ—μš”.

Boxλ₯Ό λž˜ν•‘ν•΄λ³Ό μˆ˜λ„ μžˆμ§€λ§Œ, modifier의 νŒ¨λ”©λ“±μ„ ν™œμš©ν•΄μ„œλ„ ν„°μΉ˜μ˜μ—­μ„ μ‘°μ ˆν•΄λ³Ό 수 μžˆμ„ 것 κ°™λ„€μš”!

Comment on lines +28 to +29
onClickCart: () -> Unit = {}
) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

λ¦¬μŠ€λ„ˆ 이름은 on + λͺ©μ μ–΄ + 동사 ν˜•νƒœλ‘œ μž‘μ„±ν•΄λ³΄λŠ” 건 μ–΄λ–¨κΉŒμš”?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

μ»΄ν¬λ„ŒνŠΈλ“€μ„ μ˜λ―ΈμžˆλŠ” λ‹¨μœ„λ‘œ 잘 λΆ„λ¦¬ν•΄μ£Όμ…¨λ„€μš” πŸ‘

Comment on lines +29 to +33
) { innerPadding ->
LazyVerticalGrid(
modifier = Modifier.fillMaxSize()
.background(color = Color.White)
.padding(innerPadding),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scaffold의 innerPadding 값을 잘 ν™œμš©ν•΄μ£Όμ…¨λ„€μš”! πŸ‘

@malibinYun malibinYun merged commit 3c33739 into next-step:yangsooplus Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants