@@ -11,7 +11,7 @@ import {
11
11
} from "react-native" ;
12
12
import "react-native-gesture-handler" ;
13
13
import { LinearGradient } from "expo-linear-gradient" ;
14
-
14
+ import * as Haptics from "expo-haptics" ;
15
15
export default function App ( { navigation } ) {
16
16
const Algorithms = [
17
17
{ id : "0" , name : "FCFS" } ,
@@ -36,7 +36,10 @@ export default function App({ navigation }) {
36
36
< View style = { styles . container } >
37
37
< TouchableHighlight
38
38
style = { styles . algoBox }
39
- onPress = { ( ) => navigation . navigate ( "FCFS Algorithm" , Algorithms [ 0 ] ) }
39
+ onPress = { ( ) => [
40
+ navigation . navigate ( "FCFS Algorithm" , Algorithms [ 0 ] ) ,
41
+ Haptics . impactAsync ( Haptics . ImpactFeedbackStyle . Light ) ,
42
+ ] }
40
43
>
41
44
< View
42
45
style = { [ styles . algoBox , { backgroundColor : "rgb(5, 116, 95)" } ] }
@@ -56,7 +59,10 @@ export default function App({ navigation }) {
56
59
57
60
< TouchableHighlight
58
61
style = { styles . algoBox }
59
- onPress = { ( ) => navigation . navigate ( "SJF Algorithm" , Algorithms [ 1 ] ) }
62
+ onPress = { ( ) => [
63
+ navigation . navigate ( "SJF Algorithm" , Algorithms [ 1 ] ) ,
64
+ Haptics . impactAsync ( Haptics . ImpactFeedbackStyle . Light ) ,
65
+ ] }
60
66
>
61
67
< View
62
68
style = { [ styles . algoBox , { backgroundColor : "rgb(25,84,123)" } ] }
@@ -76,7 +82,10 @@ export default function App({ navigation }) {
76
82
77
83
< TouchableHighlight
78
84
style = { styles . algoBox }
79
- onPress = { ( ) => navigation . navigate ( "SRTF Algorithm" , Algorithms [ 2 ] ) }
85
+ onPress = { ( ) => [
86
+ navigation . navigate ( "SRTF Algorithm" , Algorithms [ 2 ] ) ,
87
+ Haptics . impactAsync ( Haptics . ImpactFeedbackStyle . Light ) ,
88
+ ] }
80
89
>
81
90
< View
82
91
style = { [ styles . algoBox , { backgroundColor : "rgb(1, 95, 223)" } ] }
@@ -96,9 +105,10 @@ export default function App({ navigation }) {
96
105
97
106
< TouchableHighlight
98
107
style = { styles . algoBox }
99
- onPress = { ( ) =>
100
- navigation . navigate ( "Round Robin Algorithm" , Algorithms [ 3 ] )
101
- }
108
+ onPress = { ( ) => [
109
+ navigation . navigate ( "Round Robin Algorithm" , Algorithms [ 3 ] ) ,
110
+ Haptics . impactAsync ( Haptics . ImpactFeedbackStyle . Light ) ,
111
+ ] }
102
112
>
103
113
< View
104
114
style = { [ styles . algoBox , { backgroundColor : "rgb(255, 170, 34)" } ] }
@@ -121,7 +131,10 @@ export default function App({ navigation }) {
121
131
122
132
< TouchableHighlight
123
133
style = { styles . algoBox }
124
- onPress = { ( ) => navigation . navigate ( "LJF Algorithm" , Algorithms [ 4 ] ) }
134
+ onPress = { ( ) => [
135
+ navigation . navigate ( "LJF Algorithm" , Algorithms [ 4 ] ) ,
136
+ Haptics . impactAsync ( Haptics . ImpactFeedbackStyle . Light ) ,
137
+ ] }
125
138
>
126
139
< View
127
140
style = { [
@@ -144,7 +157,10 @@ export default function App({ navigation }) {
144
157
145
158
< TouchableHighlight
146
159
style = { styles . algoBox }
147
- onPress = { ( ) => navigation . navigate ( "LRTF Algorithm" , Algorithms [ 5 ] ) }
160
+ onPress = { ( ) => [
161
+ navigation . navigate ( "LRTF Algorithm" , Algorithms [ 5 ] ) ,
162
+ Haptics . impactAsync ( Haptics . ImpactFeedbackStyle . Light ) ,
163
+ ] }
148
164
>
149
165
< View
150
166
style = { [ styles . algoBox , { backgroundColor : "rgb(255, 170, 34)" } ] }
@@ -164,9 +180,11 @@ export default function App({ navigation }) {
164
180
165
181
< TouchableHighlight
166
182
style = { styles . algoBox_P }
167
- onPress = { ( ) =>
168
- navigation . navigate ( "PRIORITY SCHEDULING(P)" , Algorithms [ 6 ] )
169
- }
183
+ onPress = { ( ) => [
184
+ navigation . navigate ( "PRIORITY SCHEDULING(P)" , Algorithms [ 6 ] ) ,
185
+ ,
186
+ Haptics . impactAsync ( Haptics . ImpactFeedbackStyle . Light ) ,
187
+ ] }
170
188
>
171
189
< View
172
190
style = { [
@@ -199,9 +217,10 @@ export default function App({ navigation }) {
199
217
</ TouchableHighlight >
200
218
< TouchableHighlight
201
219
style = { styles . algoBox_P }
202
- onPress = { ( ) =>
203
- navigation . navigate ( "PRIORITY SCHEDULING(NP)" , Algorithms [ 7 ] )
204
- }
220
+ onPress = { ( ) => [
221
+ navigation . navigate ( "PRIORITY SCHEDULING(NP)" , Algorithms [ 7 ] ) ,
222
+ Haptics . impactAsync ( Haptics . ImpactFeedbackStyle . Light ) ,
223
+ ] }
205
224
>
206
225
< View
207
226
style = { [
@@ -234,7 +253,10 @@ export default function App({ navigation }) {
234
253
</ TouchableHighlight >
235
254
< TouchableHighlight
236
255
style = { styles . historyBox }
237
- onPress = { ( ) => navigation . navigate ( "Input History" ) }
256
+ onPress = { ( ) => [
257
+ navigation . navigate ( "Input History" ) ,
258
+ Haptics . impactAsync ( Haptics . ImpactFeedbackStyle . Light ) ,
259
+ ] }
238
260
>
239
261
< View
240
262
style = { [ styles . historyBoxView , { backgroundColor : "#45B649" } ] }
0 commit comments