Skip to content
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

[Android]timestamp in gesture event different from iOS #8104

Closed
ldn0x7dc opened this issue Jun 14, 2016 · 8 comments
Closed

[Android]timestamp in gesture event different from iOS #8104

ldn0x7dc opened this issue Jun 14, 2016 · 8 comments
Labels
Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Help Wanted :octocat: Issues ideal for external contributors. Resolution: Locked This issue was locked by the bot.

Comments

@ldn0x7dc
Copy link

Two problems:

  1. Android is using 'timeStamp' while iOS is using 'timestamp'; (Seems an old issue)
  2. Android is using nano seconds while iOS is using milliseconds.(Brought in by this commit)

Those problems force us to check the platform when using the timestamp, which could be avoided.

@ldn0x7dc ldn0x7dc changed the title [Android]timestamp in Gesture event different from iOS [Android]timestamp in gesture event different from iOS Jun 14, 2016
@satya164
Copy link
Contributor

It would be awesome if you can send a PR by changing both to timeStamp and fix android to use milliseconds.

@janicduplessis janicduplessis added Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Help Wanted :octocat: Issues ideal for external contributors. labels Jun 14, 2016
ldn0x7dc added a commit to ldn0x7dc/react-native-view-transformer that referenced this issue Jun 15, 2016
1. fix android gesture problems due to [issue](facebook/react-native#8104)
2. make pixels prop optional on RN0.28 and above
@christopherdro
Copy link
Contributor

Related #4627

@0rland0
Copy link

0rland0 commented Jul 5, 2016

The timestamp accuracy will be fixed with this pull request #8199
Is anyone working on renaming 'timestamp' to 'timeStamp' in iOS already?

@satya164
Copy link
Contributor

satya164 commented Jul 5, 2016

@0rland0 There was a PR, but I don't think it's active. Send a new PR please :)

@0rland0
Copy link

0rland0 commented Jul 5, 2016

Ok I will try to do that.
@ldn0x7dc Would it be possible to upload the code where you used the gesture so I can directly test on that?

@0rland0
Copy link

0rland0 commented Jul 5, 2016

Does this issue really still exist? I just did some debugging on the PanResponderExample which uses touch events. On Android AND iOS I could access the timestamp of the touch event with
e.timeStamp. Calling e.timestamp gave me on both platforms an 'undefined'.
I tested it with setting a breakpoint in different methods in the PanResponderExample e.g. in th _handlePanResponderMove method. So seems to work on both platforms now with the same command.

@ldn0x7dc
Copy link
Author

ldn0x7dc commented Jul 6, 2016

@0rland0
I've just tested with RN 0.28 and on android it's 'timeStamp' while on iOS it's 'timestamp'.
You can check file TouchesHelper, which assign 'timeStamp' to TIMESTAMP_KEY.

My test code snippets:

 onResponderGrant: (evt) => {
        const {timestamp, timeStamp} = evt.nativeEvent;
        console.log('onResponderGrant...' + JSON.stringify({timestamp, timeStamp}));
      },

output:
android: onResponderGrant...{"timeStamp":1305172663942}
iOs: onResponderGrant...{"timestamp":850859171.5499631}

@sharnik
Copy link
Contributor

sharnik commented Oct 18, 2016

The naming on Android has been changed to timestamp (iOS style) in this commit: 8aeeb4d

It's already on master.

@facebook facebook locked as resolved and limited conversation to collaborators Jul 19, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Help Wanted :octocat: Issues ideal for external contributors. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants