Question about onTouchListeners

1112
8
05-24-2017 10:57 AM
DexterMorgan
New Contributor II

In the ArcGIS runtime SDK 100.0.0 for iOS there is a function called: 

- (void)geoView:(AGSGeoView *)geoView didMoveLongPressToScreenPoint:(CGPoint)screenPoint mapPoint:(AGSPoint *)mapPoint

What is the Android equivalent?

arcgis runtime sdk 100.0.0‌ #android runtime sdk 100.0.0

0 Kudos
8 Replies
AlexanderNohe1
Occasional Contributor III

I think you would need to combine the onFling listener and the onLongPress listener to achieve the same effect in Android.  Implement these separately with some unique combination so you know when the action is taken.

I hope this helps!

0 Kudos
DexterMorgan
New Contributor II

Ok but how would I call onFling from onLongPress? 

0 Kudos
AlexanderNohe1
Occasional Contributor III

Have a field that called isLongPress and have it as a type boolean.  When you start the onFling, it would check to see if isLongPress is set to true and then do the expected behavior if it is true. When you then lift your finger, you would use onUp to reset isLongPress to false.  Its a tricky workflow, but this is one way that comes to mind on how to achieve this.

0 Kudos
DexterMorgan
New Contributor II

Is there a way to drag a graphic around the map? I'm using the onFling method to update the geometry of a polyline, however when I try to drag the graphic it stays in place and the map just pans around. Can I disable map panning when I'm trying to update a graphic?

0 Kudos
AlexanderNohe1
Occasional Contributor III

Are you calling the super.onFling method in your override?

0 Kudos
AlexanderNohe1
Occasional Contributor III

And you may want to override onTouch rather than onFling,  I may have misspoken the first time

0 Kudos
DexterMorgan
New Contributor II

Yes I was calling super.onFling in the method, but I haven't tried using onTouch.

0 Kudos
AlexanderNohe1
Occasional Contributor III

I would not call the super method if you can help it.  Also, based on some additional research, onTouch may be the better choice to stop the map from panning.

0 Kudos