Skip to content

Adds fix for NAN value and pressure values outside of device reported min and max - #26659

Merged
jslavitz merged 13 commits into
flutter:masterfrom
jslavitz:force-fix
Feb 21, 2019
Merged

jslavitz merged 13 commits into
flutter:masterfrom
jslavitz:force-fix

Conversation

@jslavitz

Copy link
Copy Markdown
Contributor

Fixes #26624, also adds fix for nan values causing update to incorrectly trigger.

@zoechi zoechi added framework flutter/packages/flutter repository. See also f: labels. f: gestures flutter/packages/flutter/gestures repository. labels Jan 17, 2019
Comment thread packages/flutter/lib/src/gestures/force_press.dart Outdated
@jslavitz
jslavitz requested a review from Hixie January 29, 2019 02:44
Comment thread packages/flutter/lib/src/gestures/force_press.dart Outdated
Comment thread packages/flutter/lib/src/gestures/force_press.dart
Comment thread packages/flutter/lib/src/gestures/force_press.dart Outdated
Comment thread packages/flutter/test/gestures/force_press_test.dart Outdated
Comment thread packages/flutter/test/gestures/force_press_test.dart

@xster xster left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Comment thread packages/flutter/lib/src/gestures/force_press.dart
Comment thread packages/flutter/lib/src/gestures/force_press.dart Outdated
Comment thread packages/flutter/test/widgets/gesture_detector_test.dart Outdated
@zoechi zoechi added the a: text input Entering text in a text field or keyboard related problems label Feb 20, 2019
@jslavitz
jslavitz merged commit 2c558fd into flutter:master Feb 21, 2019
});

testGesture('Force presses are not recognized on devices with low maxmium pressure', (GestureTester tester) {
// Device specific constants that represent those from the iPhone X

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This comment isn't right right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I may have been referring to the .4 and the .85 being the start and peak pressure values as perceived on the iPhone X relative to a pressure max of 1.0. But yah, that is not the clearest comment given there is interpolation happening behind the scenes.

@ovidiu-anghelina

Copy link
Copy Markdown

Will this handle Android devices that have no pressure touch features as well? I can see comments about the gesture recognizer only being triggered for devices that have this feature, but my Samsung J7 and OnePlus 6T both report every PointerEvent as having a pressure of 1. This completely breaks CupertinoTextFields on Android as they react to every touch down as if it's a pressure touch, and the widget does not allow disabling or overriding the pressure touch functionality. Sorry if this has been fixed elsewhere already, I'm on the stable branch.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a: text input Entering text in a text field or keyboard related problems f: gestures flutter/packages/flutter/gestures repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gestures/force_press.dart': 'pressure.isNaN ? true : (pressure <= 1.0 && pressure >= 0.0)': is not true.

7 participants