Skip to content

Commit 1122784

Browse files
authored
[MERGE] #343 -> develop
[FEAT/#343] ํ™ˆ ๋ทฐ / pressed ๋ฒ„ํŠผ ์ถ”๊ฐ€
2 parents 23024ac + e09c22b commit 1122784

4 files changed

Lines changed: 80 additions & 29 deletions

File tree

โ€Žfeature/home/src/main/java/com/terning/feature/home/component/HomeFilteringScreen.ktโ€Ž

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
package com.terning.feature.home.component
22

3+
import androidx.compose.foundation.background
34
import androidx.compose.foundation.border
5+
import androidx.compose.foundation.clickable
6+
import androidx.compose.foundation.interaction.MutableInteractionSource
7+
import androidx.compose.foundation.interaction.collectIsPressedAsState
48
import androidx.compose.foundation.layout.Row
59
import androidx.compose.foundation.layout.padding
610
import androidx.compose.foundation.shape.RoundedCornerShape
711
import androidx.compose.material3.Icon
812
import androidx.compose.material3.Text
913
import androidx.compose.runtime.Composable
14+
import androidx.compose.runtime.getValue
15+
import androidx.compose.runtime.remember
1016
import androidx.compose.ui.Alignment
1117
import androidx.compose.ui.Modifier
18+
import androidx.compose.ui.graphics.Color
1219
import androidx.compose.ui.res.painterResource
1320
import androidx.compose.ui.res.stringResource
1421
import androidx.compose.ui.text.style.TextAlign
1522
import androidx.compose.ui.unit.dp
1623
import com.terning.core.analytics.EventType
1724
import com.terning.core.analytics.LocalTracker
18-
import com.terning.core.designsystem.extension.noRippleClickable
1925
import com.terning.core.designsystem.theme.TerningMain
26+
import com.terning.core.designsystem.theme.TerningSub5
2027
import com.terning.core.designsystem.theme.TerningTheme
2128
import com.terning.feature.home.R
2229

@@ -25,6 +32,9 @@ fun HomeFilteringScreen(
2532
onChangeFilterClick: () -> Unit,
2633
modifier: Modifier = Modifier,
2734
) {
35+
val interactionSource = remember { MutableInteractionSource() }
36+
val isPressed by interactionSource.collectIsPressedAsState()
37+
2838
val amplitudeTracker = LocalTracker.current
2939

3040
Row(
@@ -35,13 +45,21 @@ fun HomeFilteringScreen(
3545
color = TerningMain,
3646
shape = RoundedCornerShape(5.dp)
3747
)
38-
.noRippleClickable {
39-
amplitudeTracker.track(
40-
type = EventType.CLICK,
41-
name = "filtering"
42-
)
43-
onChangeFilterClick()
44-
},
48+
.background(
49+
color = if (isPressed) TerningSub5 else Color.Transparent,
50+
shape = RoundedCornerShape(5.dp)
51+
)
52+
.clickable(
53+
interactionSource = interactionSource,
54+
indication = null,
55+
onClick = {
56+
amplitudeTracker.track(
57+
type = EventType.CLICK,
58+
name = "filtering"
59+
)
60+
onChangeFilterClick()
61+
}
62+
)
4563
) {
4664
Icon(
4765
painter = painterResource(id = R.drawable.ic_home_filtering_28),

โ€Žfeature/home/src/main/java/com/terning/feature/home/component/HomeSortingButton.ktโ€Ž

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
package com.terning.feature.home.component
22

3+
import androidx.compose.foundation.background
34
import androidx.compose.foundation.border
5+
import androidx.compose.foundation.clickable
6+
import androidx.compose.foundation.interaction.MutableInteractionSource
7+
import androidx.compose.foundation.interaction.collectIsPressedAsState
48
import androidx.compose.foundation.layout.Row
59
import androidx.compose.foundation.layout.padding
610
import androidx.compose.foundation.layout.size
711
import androidx.compose.foundation.shape.RoundedCornerShape
812
import androidx.compose.material3.Icon
913
import androidx.compose.material3.Text
1014
import androidx.compose.runtime.Composable
15+
import androidx.compose.runtime.getValue
16+
import androidx.compose.runtime.remember
1117
import androidx.compose.ui.Alignment
1218
import androidx.compose.ui.Modifier
19+
import androidx.compose.ui.graphics.Color
1320
import androidx.compose.ui.graphics.vector.ImageVector
1421
import androidx.compose.ui.res.stringResource
1522
import androidx.compose.ui.res.vectorResource
1623
import androidx.compose.ui.unit.dp
1724
import com.terning.core.designsystem.R
18-
import com.terning.core.designsystem.extension.noRippleClickable
25+
import com.terning.core.designsystem.theme.Grey100
1926
import com.terning.core.designsystem.theme.Grey350
2027
import com.terning.core.designsystem.theme.TerningTheme
2128
import com.terning.core.designsystem.type.SortBy
@@ -26,15 +33,28 @@ internal fun HomeSortingButton(
2633
sortBy: Int = 0,
2734
onCLick: () -> Unit,
2835
) {
36+
val interactionSource = remember { MutableInteractionSource() }
37+
val isPressed by interactionSource.collectIsPressedAsState()
38+
39+
val backgroundColor = if (isPressed) Grey100 else Color.Transparent
40+
2941
Row(
3042
verticalAlignment = Alignment.CenterVertically,
3143
modifier = modifier
44+
.clickable(
45+
interactionSource = interactionSource,
46+
indication = null,
47+
onClick = onCLick
48+
)
3249
.border(
3350
width = 1.dp,
3451
color = Grey350,
3552
shape = RoundedCornerShape(5.dp)
3653
)
37-
.noRippleClickable(onCLick),
54+
.background(
55+
backgroundColor,
56+
RoundedCornerShape(5.dp)
57+
),
3858
) {
3959
Icon(
4060
imageVector = ImageVector.vectorResource(id = R.drawable.ic_down_18),

โ€Žfeature/home/src/main/java/com/terning/feature/home/component/HomeUpcomingEmptyIntern.ktโ€Ž

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,30 @@ package com.terning.feature.home.component
22

33
import androidx.compose.foundation.background
44
import androidx.compose.foundation.border
5+
import androidx.compose.foundation.clickable
6+
import androidx.compose.foundation.interaction.MutableInteractionSource
7+
import androidx.compose.foundation.interaction.collectIsPressedAsState
58
import androidx.compose.foundation.layout.Column
69
import androidx.compose.foundation.layout.fillMaxWidth
710
import androidx.compose.foundation.layout.padding
11+
import androidx.compose.foundation.shape.CircleShape
812
import androidx.compose.foundation.shape.RoundedCornerShape
9-
import androidx.compose.material3.Card
10-
import androidx.compose.material3.CardDefaults
1113
import androidx.compose.material3.Text
1214
import androidx.compose.runtime.Composable
15+
import androidx.compose.runtime.getValue
16+
import androidx.compose.runtime.remember
1317
import androidx.compose.ui.Alignment
1418
import androidx.compose.ui.Modifier
19+
import androidx.compose.ui.graphics.Color
1520
import androidx.compose.ui.res.stringResource
1621
import androidx.compose.ui.text.style.TextAlign
1722
import androidx.compose.ui.unit.dp
1823
import com.terning.core.designsystem.extension.customShadow
19-
import com.terning.core.designsystem.extension.noRippleClickable
2024
import com.terning.core.designsystem.theme.Grey150
2125
import com.terning.core.designsystem.theme.Grey500
2226
import com.terning.core.designsystem.theme.TerningMain
27+
import com.terning.core.designsystem.theme.TerningSub1
28+
import com.terning.core.designsystem.theme.TerningSub5
2329
import com.terning.core.designsystem.theme.TerningTheme
2430
import com.terning.core.designsystem.theme.White
2531
import com.terning.feature.home.R
@@ -29,6 +35,9 @@ fun HomeUpcomingEmptyIntern(
2935
modifier: Modifier = Modifier,
3036
navigateToCalendar: () -> Unit,
3137
) {
38+
val interactionSource = remember { MutableInteractionSource() }
39+
val isPressed by interactionSource.collectIsPressedAsState()
40+
3241
Column(
3342
modifier = modifier
3443
.fillMaxWidth()
@@ -56,25 +65,29 @@ fun HomeUpcomingEmptyIntern(
5665
style = TerningTheme.typography.detail2,
5766
color = Grey500,
5867
)
59-
Card(
60-
colors = CardDefaults.cardColors(White),
68+
69+
Text(
70+
text = stringResource(id = R.string.home_upcoming_check_schedule),
71+
style = TerningTheme.typography.button4,
72+
color = TerningMain,
6173
modifier = modifier
6274
.padding(top = 8.dp, bottom = 25.dp)
6375
.border(
6476
width = 1.dp,
65-
color = TerningMain,
66-
shape = RoundedCornerShape(14.dp),
77+
color = if (isPressed) TerningSub1 else TerningMain,
78+
shape = CircleShape,
6779
)
68-
.noRippleClickable(navigateToCalendar),
69-
) {
70-
Text(
71-
text = stringResource(id = R.string.home_upcoming_check_schedule),
72-
style = TerningTheme.typography.button4,
73-
color = TerningMain,
74-
modifier = modifier
75-
.padding(vertical = 8.dp, horizontal = 10.dp)
76-
)
77-
}
80+
.background(
81+
color = if (isPressed) TerningSub5 else Color.Transparent,
82+
shape = CircleShape
83+
)
84+
.clickable(
85+
interactionSource = interactionSource,
86+
indication = null,
87+
onClick = navigateToCalendar
88+
)
89+
.padding(vertical = 8.dp, horizontal = 10.dp)
90+
)
7891
}
7992
}
8093
}

โ€Žfeature/home/src/main/java/com/terning/feature/home/component/bottomsheet/JobFilteringScreen.ktโ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import androidx.compose.ui.res.stringResource
2424
import androidx.compose.ui.res.vectorResource
2525
import androidx.compose.ui.unit.dp
2626
import com.terning.core.designsystem.extension.noRippleClickable
27-
import com.terning.core.designsystem.theme.Grey200
27+
import com.terning.core.designsystem.theme.Grey150
2828
import com.terning.core.designsystem.theme.Grey300
2929
import com.terning.core.designsystem.theme.Grey350
3030
import com.terning.core.designsystem.theme.TerningMain
@@ -74,7 +74,7 @@ private fun JobTypeItem(
7474
modifier = modifier
7575
.border(
7676
width = 1.dp,
77-
color = if (isSelected) TerningMain else Grey200,
77+
color = if (isSelected) TerningMain else Grey150,
7878
shape = RoundedCornerShape(10.dp)
7979
)
8080
.noRippleClickable { onButtonClick(jobType) }

0 commit comments

Comments
ย (0)