File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed
composeApp/src/commonMain/kotlin
miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ fun UITest(
145145 coroutineScope.launch {
146146 pagerState.animateScrollToPage(index)
147147 }
148- hapticFeedback.performHapticFeedback(HapticFeedbackType .ContextClick )
148+ hapticFeedback.performHapticFeedback(HapticFeedbackType .Confirm )
149149 dismissPopup(showTopPopup)
150150 isTopPopupExpanded.value = false
151151 },
@@ -194,7 +194,7 @@ fun UITest(
194194 coroutineScope.launch {
195195 pagerState.animateScrollToPage(index)
196196 }
197- hapticFeedback.performHapticFeedback(HapticFeedbackType .ContextClick )
197+ hapticFeedback.performHapticFeedback(HapticFeedbackType .Confirm )
198198 dismissPopup(showTopPopup)
199199 isTopPopupExpanded.value = false
200200 },
@@ -248,7 +248,7 @@ fun UITest(
248248 coroutineScope.launch {
249249 pagerState.animateScrollToPage(index)
250250 }
251- hapticFeedback.performHapticFeedback(HapticFeedbackType .ContextClick )
251+ hapticFeedback.performHapticFeedback(HapticFeedbackType .Confirm )
252252 dismissPopup(showBottomPopup)
253253 isBottomPopupExpanded.value = false
254254 },
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ fun Switch(
7272 val isHovered by interactionSource.collectIsHoveredAsState()
7373
7474 val hapticFeedback = LocalHapticFeedback .current
75- var hasVibrated by remember { mutableStateOf(true ) }
75+ var hasVibrated by remember { mutableStateOf(false ) }
7676 var hasVibratedOnce by remember { mutableStateOf(false ) }
7777
7878 val springSpec = remember {
@@ -193,7 +193,8 @@ fun Switch(
193193 detectHorizontalDragGestures(
194194 onDragStart = {
195195 interactionSource.tryEmit(dragInteraction)
196- hasVibrated = false
196+ hasVibrated = true
197+ hasVibratedOnce = false
197198 },
198199 onDragEnd = {
199200 if (dragOffset.absoluteValue > 21f / 2 ) onCheckedChange?.invoke(! isChecked)
@@ -205,8 +206,6 @@ fun Switch(
205206 }
206207 }
207208 interactionSource.tryEmit(DragInteraction .Stop (dragInteraction))
208- hasVibrated = true
209- hasVibratedOnce = false
210209 dragOffset = 0f
211210 },
212211 onDragCancel = {
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ fun SuperSpinner(
166166 index = index,
167167 dialogMode = false
168168 ) {
169- hapticFeedback.performHapticFeedback(HapticFeedbackType .LongPress )
169+ hapticFeedback.performHapticFeedback(HapticFeedbackType .Confirm )
170170 onSelectedIndexChange?.let { it1 -> it1(it) }
171171 dismissPopup(showPopup)
172172 isDropdownExpanded.value = false
@@ -204,7 +204,7 @@ fun SuperSpinner(
204204 if (enabled) {
205205 onClick?.invoke()
206206 isDropdownExpanded.value = enabled
207- hapticFeedback.performHapticFeedback(HapticFeedbackType .LongPress )
207+ hapticFeedback.performHapticFeedback(HapticFeedbackType .ContextClick )
208208 coroutineScope.launch {
209209 interactionSource.emit(HoldDownInteraction .Hold ().also {
210210 held.value = it
You can’t perform that action at this time.
0 commit comments