Add haptic feedback before actions (#1636)
* perform haptic before doing action * Perform haptic feedback call in UI/main thread instead of IO * Haptic feedback on both cases of long press action
This commit is contained in:
parent
21cb1921a3
commit
19f8fa203d
8 changed files with 8 additions and 8 deletions
|
|
@ -142,8 +142,8 @@ private fun LibraryUpdateErrorUiItem(
|
|||
.combinedClickable(
|
||||
onClick = onClick,
|
||||
onLongClick = {
|
||||
onLongClick()
|
||||
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
|
||||
onLongClick()
|
||||
},
|
||||
)
|
||||
.padding(horizontal = MaterialTheme.padding.medium),
|
||||
|
|
|
|||
|
|
@ -1372,8 +1372,8 @@ private fun LazyListScope.sharedChapterItems(
|
|||
chapterSwipeStartAction = chapterSwipeStartAction,
|
||||
chapterSwipeEndAction = chapterSwipeEndAction,
|
||||
onLongClick = {
|
||||
onChapterSelected(item, !item.selected, true)
|
||||
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
|
||||
onChapterSelected(item, !item.selected, true)
|
||||
},
|
||||
onClick = {
|
||||
onChapterItemClick(
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ fun BaseMangaListItem(
|
|||
onClick = onClickItem,
|
||||
// KMK -->
|
||||
onLongClick = {
|
||||
onLongClick()
|
||||
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
|
||||
onLongClick()
|
||||
},
|
||||
// KMK <--
|
||||
)
|
||||
|
|
|
|||
|
|
@ -286,8 +286,8 @@ private fun UpdatesUiItem(
|
|||
.combinedClickable(
|
||||
onClick = onClick,
|
||||
onLongClick = {
|
||||
onLongClick()
|
||||
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
|
||||
onLongClick()
|
||||
},
|
||||
)
|
||||
.padding(top = if (isLeader) MaterialTheme.padding.small else 0.dp)
|
||||
|
|
|
|||
|
|
@ -375,6 +375,7 @@ data class BrowseSourceScreen(
|
|||
},
|
||||
onMangaLongClick = { manga ->
|
||||
// KMK -->
|
||||
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
|
||||
if (bulkFavoriteState.selectionMode) {
|
||||
navigator.push(MangaScreen(manga.id, true))
|
||||
} else {
|
||||
|
|
@ -388,7 +389,6 @@ data class BrowseSourceScreen(
|
|||
)
|
||||
else -> screenModel.addFavorite(manga)
|
||||
}
|
||||
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -329,8 +329,8 @@ data object LibraryTab : Tab {
|
|||
}.takeIf { state.showMangaContinueButton },
|
||||
onToggleSelection = screenModel::toggleSelection,
|
||||
onToggleRangeSelection = { category, manga ->
|
||||
screenModel.toggleRangeSelection(category, manga)
|
||||
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
|
||||
screenModel.toggleRangeSelection(category, manga)
|
||||
},
|
||||
onRefresh = { onClickRefresh(state.activeCategory) },
|
||||
onGlobalSearchClicked = {
|
||||
|
|
|
|||
|
|
@ -278,8 +278,8 @@ class MangaScreen(
|
|||
onChapterClicked = { openChapter(context, it) },
|
||||
onDownloadChapter = screenModel::runChapterDownloadActions.takeIf { !successState.source.isLocalOrStub() },
|
||||
onAddToLibraryClicked = {
|
||||
screenModel.toggleFavorite()
|
||||
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
|
||||
screenModel.toggleFavorite()
|
||||
},
|
||||
// SY -->
|
||||
onWebViewClicked = {
|
||||
|
|
|
|||
|
|
@ -127,6 +127,7 @@ class MangaDexFollowsScreen(private val sourceId: Long) : Screen() {
|
|||
},
|
||||
onMangaLongClick = { manga ->
|
||||
// KMK -->
|
||||
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
|
||||
if (bulkFavoriteState.selectionMode) {
|
||||
navigator.push(MangaScreen(manga.id, true))
|
||||
} else {
|
||||
|
|
@ -140,7 +141,6 @@ class MangaDexFollowsScreen(private val sourceId: Long) : Screen() {
|
|||
)
|
||||
else -> screenModel.addFavorite(manga)
|
||||
}
|
||||
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue