moagrius / TileView

TileView is a subclass of android.view.ViewGroup that asynchronously displays, pans and zooms tile-based images. Plugins are available for features like markers, hotspots, and path drawing.
MIT License
1.46k stars 337 forks source link

marker onlongclick listener #473

Closed anhtuanBk closed 6 years ago

anhtuanBk commented 6 years ago

Hi, I'm trying to add OnLongClickListener to marker view like bellow:

pinpointView.setOnLongClickListener {
                val dragData = ClipData.newPlainText("pinpoint_id", pinpoint.id)
                val shadow = PinpointShadowBuilder(it)
                if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
                    it.startDrag(dragData, shadow, pinpoint, 0)
                } else {
                    it.startDragAndDrop(dragData, shadow, pinpoint, 0)
                }
                return@setOnLongClickListener false
            }
            addMarker(pinpointView, x, y)

but then the TileView's MarkerTapListener was overwrite. How can i resolve this problem ? Thank you.

moagrius commented 6 years ago

use normal click listeners instead of MarkerTapListener