-
Notifications
You must be signed in to change notification settings - Fork 39
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
π 4λ¨κ³ - μ₯λ°κ΅¬λ(μλ) #126
base: sana-20
Are you sure you want to change the base?
Conversation
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.
μ΄μ λ¨κ³ νΌλλ°±κ³Ό μ₯λ°κ΅¬λ(μλ) λ―Έμ
νμλλΌ κ³ μνμ
¨μ΅λλ€. π
κ³ λ―Όν΄λ³Όλ§ν μ견λ€μ μ½λ§¨νΈλ‘ μμ±νμμΌλ, μΆ©λΆν κ³ λ―Όν΄λ³΄μκ³ λμ ν΄λ³΄μΈμ. πͺ
private val _items = mutableStateListOf<CartItem>() | ||
val items: SnapshotStateList<CartItem> get() = _items |
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.
StateListμ SnapshotListλ‘ λ³κ²½νμ μ΄μ κ° λ¬΄μμΈκ°μ?
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.
μ λ² λ―Έμ μμ #122 (comment) μ½λ§¨νΈλ₯Ό μμ±νλλ° λ΅λ³μ΄ κ°λ₯νμ€κΉμ?
IconButton( | ||
onClick = onClickRemoveOne, | ||
modifier = Modifier.size(42.dp) | ||
) { | ||
Text( | ||
text = "-", | ||
fontSize = 22.sp, | ||
fontWeight = FontWeight.Bold | ||
) | ||
} |
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.
+
λ²νΌκ³Ό -
λ²νΌμ 곡ν΅μ μ΄ λ§μ κ² κ°μ΅λλ€.
λ°λ³΅λλ λ·°λ₯Ό μ¬μ¬μ©ν μ μλλ‘ κ°μ ν΄λ³΄λ©΄ μ΄λ¨κΉμ?
ProductCount( | ||
count = 2, | ||
onClickAddOne = {}, | ||
onClickRemoveOne = {} | ||
) |
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.
Previewμλ Interactive modeλΌλ κΈ°λ₯μ μ 곡νκ³ μμ΅λλ€.
Interactive modeλ₯Ό ν΅ν΄ +
λ²νΌκ³Ό -
λ²νΌμ΄ μ λμνλμ§ νμΈν μ μλλ‘ κ°μ ν΄λ³΄λ©΄ μ΄λ¨κΉμ?
import androidx.compose.ui.unit.sp | ||
|
||
@Composable | ||
fun ProductCount( |
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.
μ₯λ°κ΅¬λ νλ©΄μμλ ProductCountλ₯Ό μ¬μ©νκ³ μλλ°μ.
μ₯λ°κ΅¬λ νλ©΄μμ μνμ μ κ±°νκ² λλ©΄ μνμ μ΄ν©μ΄ κ°±μ λμ§ μλ κ² κ°μ΅λλ€.
μ₯λ°κ΅¬λ νλ©΄μμ μνμ μ κ±°νμ κ²½μ° μνμ μ΄ν©μ΄ κ°±μ λ μ μλλ‘ κ°μ ν΄λ³΄λ©΄ μ΄λ¨κΉμ?
μλ νμΈμ! μ₯λ°κ΅¬λ 4λ¨κ³ κ³Όμ μ μΆμ΄ λ¦μλ€μγ γ μ λΆνλ립λλ€!