diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/screens/ManageBlockedNumbersScreen.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/screens/ManageBlockedNumbersScreen.kt index 9171668b6..44dc4c9c7 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/compose/screens/ManageBlockedNumbersScreen.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/compose/screens/ManageBlockedNumbersScreen.kt @@ -26,6 +26,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.toArgb +import androidx.compose.ui.hapticfeedback.HapticFeedbackType import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.platform.LocalHapticFeedback import androidx.compose.ui.res.stringResource @@ -85,6 +86,7 @@ internal fun ManageBlockedNumbersScreen( ) { val startingPadding = remember { Modifier.padding(horizontal = 4.dp) } val selectedIds: MutableState> = rememberSaveable { mutableStateOf(emptySet()) } + val hapticFeedback = LocalHapticFeedback.current val isInActionMode by remember { derivedStateOf { selectedIds.value.isNotEmpty() } } val clearSelection = remember { { selectedIds.value = emptySet() } @@ -235,12 +237,14 @@ internal fun ManageBlockedNumbersScreen( when { indexOfLastValueInSelection == index -> {} indexOfLastValueInSelection < index -> { + hapticFeedback.performHapticFeedback(HapticFeedbackType.LongPress) selectedIds.value += blockedNumbers .subList(indexOfLastValueInSelection, index) .map { number -> number.id } } else -> { + hapticFeedback.performHapticFeedback(HapticFeedbackType.LongPress) selectedIds.value += blockedNumbers .subList(index, indexOfLastValueInSelection) .map { number -> number.id }