mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-04 22:56:32 +08:00
Reverted commit D3528215
Summary: So `PanReponder.onPanResponderRelease/onPanResponderTerminate` receive a `gestureState` object containing a `onPanResponderTerminate.vx/vy` property. On Android and iOS, they appear to be orders of magnitude different, which appear to be due to the different scale of timestamps that are used when generating touch events. This pull request fixes the timestamps to be milliseconds on both platforms (since I assume iOS is the more authoritative one, and is the one that `react-native-viewpager`'s vx thresholds written written to compare against.) As far as I can tell, the RN code doesn't use the `vx/vy` properties, so they should be okay. And looks like the RN code only cares about relative values of `startTimestamp/currentTimestamp/previousTimestamp` though, so should be fine too. it's quite possible there will be downstream android breakage with this change, particularly for those who are already compensating for the RN discrepancy. Closes https://github.com/facebook/react-native/pull/8199 Differential Revision: D3528215 Pulled By: davidaurelio fbshipit-source-id: d81732e50a5ece2168e8347309d8d52a0db42951
This commit is contained in:
committed by
Facebook Github Bot 9
parent
97299260b6
commit
6779d13dcb
@@ -116,7 +116,7 @@ public class TextInputTestCase extends ReactAppInstrumentationTestCase {
|
||||
eventDispatcher.dispatchEvent(
|
||||
new ReactTextChangedEvent(
|
||||
reactEditText.getId(),
|
||||
SystemClock.elapsedRealtime(),
|
||||
SystemClock.nanoTime(),
|
||||
newText.toString(),
|
||||
(int) PixelUtil.toDIPFromPixel(contentWidth),
|
||||
(int) PixelUtil.toDIPFromPixel(contentHeight),
|
||||
@@ -125,7 +125,7 @@ public class TextInputTestCase extends ReactAppInstrumentationTestCase {
|
||||
eventDispatcher.dispatchEvent(
|
||||
new ReactTextInputEvent(
|
||||
reactEditText.getId(),
|
||||
SystemClock.elapsedRealtime(),
|
||||
SystemClock.nanoTime(),
|
||||
newText.toString(),
|
||||
"",
|
||||
start,
|
||||
@@ -150,7 +150,7 @@ public class TextInputTestCase extends ReactAppInstrumentationTestCase {
|
||||
eventDispatcher.dispatchEvent(
|
||||
new ReactTextChangedEvent(
|
||||
reactEditText.getId(),
|
||||
SystemClock.elapsedRealtime(),
|
||||
SystemClock.nanoTime(),
|
||||
newText.toString(),
|
||||
(int) PixelUtil.toDIPFromPixel(contentWidth),
|
||||
(int) PixelUtil.toDIPFromPixel(contentHeight),
|
||||
@@ -159,7 +159,7 @@ public class TextInputTestCase extends ReactAppInstrumentationTestCase {
|
||||
eventDispatcher.dispatchEvent(
|
||||
new ReactTextInputEvent(
|
||||
reactEditText.getId(),
|
||||
SystemClock.elapsedRealtime(),
|
||||
SystemClock.nanoTime(),
|
||||
moreText,
|
||||
"",
|
||||
start,
|
||||
@@ -184,7 +184,7 @@ public class TextInputTestCase extends ReactAppInstrumentationTestCase {
|
||||
eventDispatcher.dispatchEvent(
|
||||
new ReactTextChangedEvent(
|
||||
reactEditText.getId(),
|
||||
SystemClock.elapsedRealtime(),
|
||||
SystemClock.nanoTime(),
|
||||
newText.toString(),
|
||||
(int) PixelUtil.toDIPFromPixel(contentWidth),
|
||||
(int) PixelUtil.toDIPFromPixel(contentHeight),
|
||||
@@ -193,7 +193,7 @@ public class TextInputTestCase extends ReactAppInstrumentationTestCase {
|
||||
eventDispatcher.dispatchEvent(
|
||||
new ReactTextInputEvent(
|
||||
reactEditText.getId(),
|
||||
SystemClock.elapsedRealtime(),
|
||||
SystemClock.nanoTime(),
|
||||
moreText,
|
||||
"",
|
||||
start,
|
||||
|
||||
Reference in New Issue
Block a user