catchthecows / AndroidImageMap

An HTML map like widget in an Android view
199 stars 74 forks source link

adding button functuality to areas #5

Open ctarimli opened 10 years ago

ctarimli commented 10 years ago

I want that areas to act like button to show different image or go to a different class or activity instead of showing bubbles. But i cant figure it out. whatever i tried gives an error or just a black screen when app is running. any advice?

fess89 commented 10 years ago

It seems that the way to do it is to override onScreenTapped() to not draw bubbles (and probably not check for a bubble to be clicked) but do the stuff you want it to do. Unfortunately the method seems to be package-private by default, so it is not straightforward to override it. Of course it is possible to monkey-patch the source code of the library to make that method protected. I suggest also sending a pull request for the onScreenTapped() method to become protected so one could subclass ImageMap and override its functionality.