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

Add onDoublePress callback #2937

Merged

Conversation

nabati
Copy link
Contributor

@nabati nabati commented Jul 3, 2019

Does any other open PR do the same thing?

Adds onDoublePress callback to Google Maps on Android and Apple Maps on iOS. Previous related work in #2692 and #2935. Created this PR as an alternative to #2692 with the reasoning that

  • the API is more explicit; adds a new onDoublePress callback instead of mixing multiple gestures to be handled by a single callback.
  • the PR only does a single thing rather than multiple changes at once
  • the previous PR has stalled

What issue is this PR fixing?

Adds onDoublePress callback to Google Maps on Android and Apple Maps on iOS.

This can be used for multiple things, but primarily, to know when the user has interacted with the map by double tapping the screen.

How did you test this PR?

Tested with emulator on Android and simulator on iOS.

  1. Add onPress and onDoublePress callback handlers to the map
  2. Observe that tapping once fires only onPress once, and tapping twice fires only onDoublePress once.

I did not include changes for Google Maps on iOS since this does not match our use case. Let me know if it's a requirement to get it merged.

Add to Google Maps on Android and Apple Maps on iOS
[map addGestureRecognizer:tap];
[map addGestureRecognizer:doubleTap];
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 wanted to shuffle around the above code - I think it would make more sense to initialise and configure them type-wise rather than operation-wise, but I didn't want to make the review harder than it has to be.

@nabati
Copy link
Contributor Author

nabati commented Aug 8, 2019

Any way to get this reviewed @rborn ?

@nabati
Copy link
Contributor Author

nabati commented Aug 29, 2019

Since you're on a roll @christopherdro, could you please have a look at this as well?

@rborn
Copy link
Collaborator

rborn commented Aug 29, 2019

@nabati could you please fix the conflicts? Thnx

@nabati
Copy link
Contributor Author

nabati commented Aug 29, 2019

Fixed 👌 @rborn

@christopherdro christopherdro merged commit 094f864 into react-native-maps:master Aug 29, 2019
@nabati
Copy link
Contributor Author

nabati commented Aug 29, 2019

Thanks @christopherdro !

@nabati nabati deleted the pn/add-ondoublepress-callback branch August 29, 2019 14:21
netmaxt3r pushed a commit to netmaxt3r/react-native-maps that referenced this pull request Oct 6, 2019
* commit '3ae31e4a336102538ee422a0d4e71a2ea32647bb': (24 commits)
  [0.26.1] Release
  rn 0.60.5 support (react-native-maps#3020)
  "AIRMap" was not found in the UIManager IN "0.26.0" (react-native-maps#3103)
  [0.26.0] Release
  Add Heatmap back in (react-native-maps#3064)
  Fixes NPE while removing already removed marker. (react-native-maps#3032)
  Add flat property binding on Marker for iOS (react-native-maps#3051)
  Add heading to the onUserLocationChange listener (react-native-maps#3045)
  Add onDoublePress callback (react-native-maps#2937)
  Allow using onPanDrag while scrollEnabled=true (react-native-maps#2935)
  updating pods for compile error (react-native-maps#3011)
  add overlay onPress event (react-native-maps#3007)
  Fix playServicesVersion name in installation docs (react-native-maps#3016)
  Update index.d.ts (react-native-maps#2887)
  Add @ReactModule annotation to help turbomodules processor (react-native-maps#3001)
  Google Maps - Heatmaps for Android and iOS (react-native-maps#2960)
  Added GeoJSON support by default (react-native-maps#2959)
  Update GoogleMaps pos to 3.2.0 (react-native-maps#2999)
  convert to new react native config format (RN 0.60 (react-native-maps#2975)
  fix select annotation when show/hide callout view (react-native-maps#2973)
  ...

# Conflicts:
#	package.json
yuheidapperapps added a commit to yuheidapperapps/react-native-maps that referenced this pull request Oct 15, 2019
* master: (31 commits)
  Wider Note column (prevent horisontal scroll) (react-native-maps#3130)
  replaced deprecated bridge.imageLoader calls with moduleForClass API (react-native-maps#3125)
  Implement onUserLocationChange in AIRMap (react-native-maps#2889)
  keep current mapType when taking snapshot (react-native-maps#3120)
  Add mapPadding on iOS maps (react-native-maps#3119)
  [iOS] Expose isAccessibilityElement as a prop (react-native-maps#3115)
  Add supportLibVersion safeguard in gradle build (react-native-maps#3106)
  [0.26.1] Release
  rn 0.60.5 support (react-native-maps#3020)
  "AIRMap" was not found in the UIManager IN "0.26.0" (react-native-maps#3103)
  [0.26.0] Release
  Add Heatmap back in (react-native-maps#3064)
  Fixes NPE while removing already removed marker. (react-native-maps#3032)
  Add flat property binding on Marker for iOS (react-native-maps#3051)
  Add heading to the onUserLocationChange listener (react-native-maps#3045)
  Add onDoublePress callback (react-native-maps#2937)
  Allow using onPanDrag while scrollEnabled=true (react-native-maps#2935)
  updating pods for compile error (react-native-maps#3011)
  add overlay onPress event (react-native-maps#3007)
  Fix playServicesVersion name in installation docs (react-native-maps#3016)
  ...
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