burhanrashid52 / PhotoEditor

A Photo Editor library with simple, easy support for image editing using paints,text,filters,emoji and Sticker like stories.
MIT License
4.13k stars 991 forks source link

Get a callback when the image source is touched #383

Closed stephanepechard closed 3 years ago

stephanepechard commented 3 years ago

Feature description Depending on the way adding elements (text, stickers, etc.) are added to the view, it may be useful to get a way to know where the user has touched the source image.

Solution description A callback to OnPhotoEditorListener should be sufficient. It can be triggered from imageView.setOnTouchListener of PhotoEditorImpl.

anderbytes commented 3 years ago

Good, would be nice to know how useful this is. Can you tell some examples?

stephanepechard commented 3 years ago

My use case is the following: I want my user to add text not with a dedicated button as with the demo app, but on touch on the image when text tool is selected (my UI is quite different). But currently, there's no way to catch any event on the image when Brush mode is off.