Skip to content

Commit

Permalink
send vibration on log long press
Browse files Browse the repository at this point in the history
  • Loading branch information
qimiko committed Jan 30, 2024
1 parent b67be09 commit 2494bda
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.hapticfeedback.HapticFeedbackType
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalHapticFeedback
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontFamily
Expand Down Expand Up @@ -165,12 +167,16 @@ fun SelectLogLevelDialog(
fun LogCard(logLine: LogLine, modifier: Modifier = Modifier) {
val context = LocalContext.current

val haptics = LocalHapticFeedback.current


Column(
modifier = modifier
.padding(8.dp)
.pointerInput(Unit) {
detectTapGestures(
onLongPress = {
haptics.performHapticFeedback(HapticFeedbackType.LongPress)
copyLogText(context, logLine.asSimpleString)
}
)
Expand Down

0 comments on commit 2494bda

Please sign in to comment.