[HOLD for payment 2021-11-09] Reduce the haptic feedback vibration to a short bip
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Upwork posting: https://www.upwork.com/jobs/~0105c031baf3dfd3df
Action Performed:
- Navigate to a conversation in mobile
- Press and hold on a message
Expected Result:
There should be a short blip of vibration.
Actual Result:
Current vibration is longer that it should be.
To achieve the desired result, we should:
- Update our app to use react-native-haptic-feedback
- Fork the library, and update the forked lib to have the same vibration as slack does when selecting messages
- Once the PR is merged into our codebase, create a PR upstream so that the functionality can be merged into react-native-haptic-feedback
Workaround:
N/A
Platform:
Where is this issue occurring?
- iOS
- Android
Version Number: 1.0.82-0
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL:
From @quinthar https://expensify.slack.com/archives/C01GTK53T8Q/p1627669368027700
I love the new haptic feedback when you long tap on mobile. However, it uses a kind of strange vibration. Can we match the same vibration that slack uses with long tap? It's just a incredibly short blip.
Triggered auto assignment to @pecanoro (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
Triggered auto assignment to @Jag96 (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
It looks like there's some more context on this issue in this slack thread. cc @rushatgabhane since you had some good thoughts here.
@Jag96 I'm not able to find any npm package which matches the short blip of Slack.
However, I can get the exact haptic feedback as Slack's using native code for Android.
Here are our options for adding native code.
- Directly into New Expensify using NativeModules.
- Create a new npm package.
Which one do you prefer?
Alternatively, we could settle for a shorter duration of the strange vibration using rn-haptic-feedback.
We've used NativeModules before here so I think that would be fine, but I'd reply to the thread in slack (and send to the main channel as well by ticking Also send to expensify-open-source) just to see if anybody has any opinions.
And just to confirm, using NativeModules would you just override the index.android.js functionality and continue using the current lib for iOS?
And just to confirm, using NativeModules would you just override the index.android.js functionality and continue using the current lib for iOS?
No. I won't using the current lib (expo-haptics) at all. NativeModules will be used for both iOS and Android.
I forgot to mention, simulators don't support haptics and I don't own an iPhone. I'm gonna use apple's haptics docs for reference if that's fine.
Update from slack thread
We decided to add bip() method to Vibration API by creating a PR for React Native.
I won't be available for a few weeks. So I won't be taking this issue. But here are things that might help with implementation.
Android: Vibrate(createPredefined(VibrationEffect.EFFECT_CLICK))
iOS: Selection
Correction: bip() not blip()
Tiny thing: I vote naming the API call "bip" instead of "blip". When you say it out loud, "bip" is closer to the actual vibrate we're going for.
On Tue, Aug 3, 2021 at 1:34 PM Rushat Gabhane @.***> wrote:
Update from slack thread https://expensify.slack.com/archives/C01GTK53T8Q/p1627669368027700
We decided to add blip() method to Vibration https://reactnative.dev/docs/vibration API by creating a PR for React Native.
I won't be available for a few weeks. So I won't be taking this issue. But here are things that might help with implementation.
Android: Vibrate(createPredefined(VibrationEffect.EFFECT_CLICK)) iOS: Selection https://developer.apple.com/design/human-interface-guidelines/ios/user-interaction/haptics/
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Expensify/App/issues/4355#issuecomment-892146985, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEMNURFQSCEDCPEFWASKN3T3BHD7ANCNFSM5BLKL4VA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .
@Jag96 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
In this case we add the code
{<TouchableOpacity
onLongPress={() => Vibration.vibrate(1 * ONE_SECOND_IN_MS)}
>
....
</TouchableOpacity>}
in InvertedFlatList in "/src/pages/home/report/ReportActionsView.js"
change src\components\PressableWithSecondaryInteraction\index.native.js
import {Vibration} from 'react-native';
<Pressable
...
onLongPress={(e) => {
e.preventDefault();
Vibration.vibrate(20);
props.onSecondaryInteraction(e);
}}
...
>
{props.children}
</Pressable> ````
in src\components\PressableWithSecondaryInteraction
it will reduce time from 50 (with haptics library) millisecond to 20 millisecond
@arpitdeveloper @chira37 please see the description of this issue for the desired implementation:
To achieve the desired result, we should:
- Update the Vibration lib in our react native fork to add a new function
bipthat will use the shortest, strongest vibration possible (see slack thread) - Once the PR is merged, create a PR upstream so that the functionality can be merged into React Native's Vibration library
We can reduce the time of vibration. This is possible in React Native.
Doubled price to $500 in Upwork.
@arpitdeveloper @chira37 please see the description of this issue for the desired implementation:
To achieve the desired result, we should:
- Update the Vibration lib in our react native fork to add a new function
bipthat will use the shortest, strongest vibration possible (see slack thread)- Once the PR is merged, create a PR upstream so that the functionality can be merged into React Native's Vibration library
I have added the bip() function to the expensify react native fork. PR was created
@chira37 please ensure you've read through the slack thread, and please refrain from making PRs until your proposal has been accepted.
From the slack thread, the current vibrate function does not allow for any customization on iOS, and the vibration on Android is not the vibration we want. The bip function should make use of the native libraries mentioned in the slack thread. If you have any questions, feel free to ask!
@Jag96 it looks like no one is assigned to work on this job. Please double the price or add a comment stating why the job isn't being doubled.
Doubled the price: https://www.upwork.com/jobs/~0105c031baf3dfd3df
Hello @Jag96. I can't reproduce this issue, can you explain a better about testcase?