-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7844671
commit cb20a6b
Showing
6 changed files
with
93 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
app/src/main/java/org/nitri/opentopo/overlay/GestureOverlay.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.nitri.opentopo.overlay; | ||
|
||
import android.view.MotionEvent; | ||
|
||
import org.osmdroid.views.MapView; | ||
import org.osmdroid.views.overlay.Overlay; | ||
|
||
public class GestureOverlay extends Overlay { | ||
|
||
GestureCallback gestureCallback; | ||
|
||
public GestureOverlay(GestureCallback gestureCallback) { | ||
this.gestureCallback = gestureCallback; | ||
} | ||
|
||
@Override | ||
public boolean onFling(MotionEvent pEvent1, MotionEvent pEvent2, float pVelocityX, float pVelocityY, MapView pMapView) { | ||
gestureCallback.onUserMapInteraction(); | ||
return super.onFling(pEvent1, pEvent2, pVelocityX, pVelocityY, pMapView); | ||
} | ||
|
||
@Override | ||
public boolean onScroll(MotionEvent pEvent1, MotionEvent pEvent2, float pDistanceX, float pDistanceY, MapView pMapView) { | ||
gestureCallback.onUserMapInteraction(); | ||
return super.onScroll(pEvent1, pEvent2, pDistanceX, pDistanceY, pMapView); | ||
} | ||
|
||
public interface GestureCallback { | ||
void onUserMapInteraction(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters