Skip to content

Feat/add haptics to Drawer #1266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 23, 2021
Merged

Feat/add haptics to Drawer #1266

merged 6 commits into from
May 23, 2021

Conversation

lidord-wix
Copy link
Contributor

@lidord-wix lidord-wix commented Apr 18, 2021

Description

Add haptic feedback to the Drawer component
Jira 1201

Depending on #1277

Changelog

Add haptic feedback to the Drawer component

@lidord-wix lidord-wix requested a review from ethanshar April 18, 2021 08:39
@ethanshar ethanshar requested review from Inbal-Tish and removed request for ethanshar April 23, 2021 12:25
@ethanshar ethanshar assigned Inbal-Tish and unassigned ethanshar Apr 23, 2021
@@ -123,7 +125,8 @@ export default class Swipeable extends Component<Props, StateType> {
if (!this.dragThresholdReached && x >= threshold && x < threshold + 10) {
// move item right
this.dragThresholdReached = true;
onToggleSwipeLeft({rowWidth, leftWidth, dragX: x, triggerHaptic: true});
HapticService.triggerHaptic(HAPTIC_METHOD, 'Drawer');
onToggleSwipeLeft({rowWidth, leftWidth, dragX: x});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep the haptic optional, not all users will want to use it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not get the haptic method from the HapticService, i.e. HapticMethods.impactMedium?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll be able to do that only when I'll fix the HapticMethods in the HapticService as we talked about in our dev sync.
I'm waiting for this PR to be merged to do so

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Add the other PR as a dependency and we'll merge this after it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the dependency merged?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes :)



const DRAG_TOSS = 0.05;
const LEFT_TOGGLE_THRESHOLD = 0.6;
const HAPTIC_METHOD = HapticType.impactMedium;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this working? The other PR merged?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not merged yet - I added a link in the description.
And yes it works, I checked it..

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're using HAPTIC_METHOD only once, why store it in a const?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, why impactMedium is the default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the UX guidelines.
We can open it to a discussion in the future if any user will ask to change it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm asking because our private config (Drawer.config) is setting it to impactLight, so it should be the default or it should be open for user's change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has updated to impactMedium, which is the default now.

@lidord-wix lidord-wix requested a review from Inbal-Tish April 27, 2021 13:00
@lidord-wix lidord-wix requested a review from Inbal-Tish May 2, 2021 10:59
@lidord-wix lidord-wix removed the pending label May 3, 2021
@Inbal-Tish Inbal-Tish merged commit a1563e2 into master May 23, 2021
@lidord-wix lidord-wix deleted the feat/drawer_haptics branch May 31, 2021 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants