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

Long click listener ? #29

Closed Eteokles closed 10 years ago

Eteokles commented 10 years ago

Can i listen a long click type action ? I don't see it in TileViewEventListener.

moagrius commented 10 years ago

Actually I never anticipated the need for it and it was not included... However @Tristus1er has implemented it in a fork (maybe this one?), which hasn't been submitted for merge request at this point (and probably wouldn't qualify since (unforturnately) it's an API breaking change)

If you don't want to hack the core, I'd suggest starting a timer in onFingerDown, a cancel in onDrag, and check the timer against a duration in onFingerUp.

Eteokles commented 10 years ago

Ok this is what I thought so, but I wanted to ensure that the function does not yet exist. Thank you for your quick reply :)... and sorry for my bad english

Tristus1er commented 10 years ago

You'll find what I have done there: https://github.com/Tristus1er/TileView/commit/cf801a2dbe324272f4d0fdabe56bf26aef5147d8

I have tryed to be as clean as possible.

Eteokles commented 10 years ago

Thx. @moagrius, after seeing @Tristus1er's modifications, i don't understand why this add is considered api breaker ( sorry if my question seems stupid :p ) ?

Tristus1er commented 10 years ago

Cause there are some motifications to do in the interfaces = API => API broken

moagrius commented 10 years ago

API breaking means a member (method or property) has been removed or a signature has changed, or an interface has been altered. You can add a method or property, or do some work behind the scenes with private stuff, but still have to be careful.

Consider that, if I implemented those changes, everyone using the lib currently would immediately have compiler errors if they grabbed the latest version and were using TileViewEventListeners, because any TileViewEventListener implementations would hot have the new methods implemented. Thus, it's API-breaking - that's not saying it's not good or not useful, just that it'd cause all existing implementations to (potentially) break.

Hope that makes sense.

Eteokles commented 10 years ago

Ok I understand. I didn't seen this aspect ;) Thank you for this complete answer

moagrius commented 10 years ago

No problem :)