Skip to content

Commit

Permalink
Add haptic feedback to marking activity items read
Browse files Browse the repository at this point in the history
  • Loading branch information
micahlt committed Jun 13, 2024
1 parent 362d120 commit 49bd408
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE"/>

<application
android:name=".MainApplication"
Expand Down
6 changes: 5 additions & 1 deletion src/components/ActivityItem.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useNavigation } from '@react-navigation/native';
import * as React from 'react';
import { View } from 'react-native';
import { View, Vibration } from 'react-native';
import {
Card,
Icon,
Expand Down Expand Up @@ -174,6 +174,10 @@ function ActivityItem({ activity }) {
return (
<TouchableRipple
onPress={() => readActivity(() => nav.push(linkRoute, linkProps))}
onLongPress={() => {
Vibration.vibrate(50);
readActivity(() => null);
}}
borderless={true}
style={{ borderRadius: 10 }}>
<Card mode="contained">
Expand Down

0 comments on commit 49bd408

Please sign in to comment.