mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 09:11:52 +01:00
Add back haptic feedback long tap to fav
- add back haptic when long tap on manga to add to library
This commit is contained in:
parent
1e93d785e5
commit
81486e30e9
@ -8,6 +8,8 @@ import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.State
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.ui.hapticfeedback.HapticFeedbackType
|
||||
import androidx.compose.ui.platform.LocalHapticFeedback
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.paging.LoadState
|
||||
@ -65,6 +67,8 @@ fun BrowseSourceComfortableGridItem(
|
||||
onClick: () -> Unit = {},
|
||||
onLongClick: () -> Unit = onClick,
|
||||
) {
|
||||
val haptic = LocalHapticFeedback.current
|
||||
|
||||
MangaComfortableGridItem(
|
||||
title = manga.title,
|
||||
coverData = MangaCover(
|
||||
@ -80,7 +84,10 @@ fun BrowseSourceComfortableGridItem(
|
||||
Badge(text = stringResource(R.string.in_library))
|
||||
}
|
||||
},
|
||||
onLongClick = onLongClick,
|
||||
onLongClick = {
|
||||
onLongClick()
|
||||
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
|
||||
},
|
||||
onClick = onClick,
|
||||
)
|
||||
}
|
||||
|
@ -8,6 +8,8 @@ import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.State
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.ui.hapticfeedback.HapticFeedbackType
|
||||
import androidx.compose.ui.platform.LocalHapticFeedback
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.paging.LoadState
|
||||
@ -65,6 +67,8 @@ private fun BrowseSourceCompactGridItem(
|
||||
onClick: () -> Unit = {},
|
||||
onLongClick: () -> Unit = onClick,
|
||||
) {
|
||||
val haptic = LocalHapticFeedback.current
|
||||
|
||||
MangaCompactGridItem(
|
||||
title = manga.title,
|
||||
coverData = MangaCover(
|
||||
@ -80,7 +84,10 @@ private fun BrowseSourceCompactGridItem(
|
||||
Badge(text = stringResource(R.string.in_library))
|
||||
}
|
||||
},
|
||||
onLongClick = onLongClick,
|
||||
onLongClick = {
|
||||
onLongClick()
|
||||
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
|
||||
},
|
||||
onClick = onClick,
|
||||
)
|
||||
}
|
||||
|
@ -4,6 +4,8 @@ import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.State
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.ui.hapticfeedback.HapticFeedbackType
|
||||
import androidx.compose.ui.platform.LocalHapticFeedback
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.paging.LoadState
|
||||
@ -59,6 +61,8 @@ fun BrowseSourceListItem(
|
||||
onClick: () -> Unit = {},
|
||||
onLongClick: () -> Unit = onClick,
|
||||
) {
|
||||
val haptic = LocalHapticFeedback.current
|
||||
|
||||
MangaListItem(
|
||||
title = manga.title,
|
||||
coverData = MangaCover(
|
||||
@ -74,7 +78,10 @@ fun BrowseSourceListItem(
|
||||
Badge(text = stringResource(R.string.in_library))
|
||||
}
|
||||
},
|
||||
onLongClick = onLongClick,
|
||||
onLongClick = {
|
||||
onLongClick()
|
||||
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
|
||||
},
|
||||
onClick = onClick,
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user