Skip to content

Commit

Permalink
🐛 :: 클릭 후 다시 재 클릭 전까지 바뀐 background 색깔이 유지 되는 문제 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
Cjsghkd committed Sep 13, 2023
1 parent e5f82a3 commit 5e852dd
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand All @@ -34,6 +35,8 @@ import com.dotori.dotori_components.theme.MeatballIcon
import com.dotori.dotori_components.theme.White
import com.example.dus.R
import com.skydoves.landscapist.glide.GlideImage
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch

@Composable
fun DotoriStudentInfoListItem(
Expand All @@ -46,6 +49,7 @@ fun DotoriStudentInfoListItem(
onOptionClicked: () -> Unit
) {
var isClicked by remember { mutableStateOf(false) }
val coroutineScope = rememberCoroutineScope()

Row(
modifier = modifier
Expand Down Expand Up @@ -86,13 +90,11 @@ fun DotoriStudentInfoListItem(
if (gender == GenderType.MAN.toString()) {
MaleIcon(
modifier = Modifier.size(14.dp),
contentDescription = "MaleIcon",
tint = DotoriTheme.colors.neutral20
)
} else {
FemaleIcon(
modifier = Modifier.size(14.dp),
contentDescription = "FemaleIcon",
tint = DotoriTheme.colors.neutral20
)
}
Expand All @@ -106,11 +108,14 @@ fun DotoriStudentInfoListItem(
interactionSource = remember { MutableInteractionSource() },
indication = null,
onClick = {
isClicked = !isClicked
isClicked = true
onOptionClicked()
coroutineScope.launch {
delay(700L)
isClicked = false
}
}
),
contentDescription = "MeatballIcon",
tint = DotoriTheme.colors.neutral30
)
}
Expand Down

0 comments on commit 5e852dd

Please sign in to comment.