AndroidImagePopup icon indicating copy to clipboard operation
AndroidImagePopup copied to clipboard

Cannot use setOnTouchListener

Open africantearoa opened this issue 8 years ago • 2 comments

Using .setOnTouchListener() on the ImagePopup object does not seem to work - the the code within the OnTouchListener is never reached.

To try counter this, I tried manually pulling the files from this repository and creating my own custom ImagePopup class, adding the .setOnTouchListener() to the 'layout' field object. While that did execute the code correctly, the popup wouldn't go fullscreen so I abandoned whole custom class. I'm a rookie at this, anyone know what I might be doing wrong? Would being able to access the layout field within the ImagePopup object in order to add the .setOnTouchListener() directly to it be bad code? I'm guessing that would solve my issue, at least.

what I'm trying to do:

                            imagePopup.setOnTouchListener(new View.OnTouchListener() {
                                @Override
                                public boolean onTouch(View v, MotionEvent event) {
                                    //This code is never reached
                                    return false;
                                }
                            });

Also, what I'm aiming to do is when the user scrolls up or down on the imagePopup, the image source changes, creating a controllable gif-like effect. Provided I figure out how to detect the scroll, is there a way to change the image source in this manner?

africantearoa avatar Jul 23 '17 17:07 africantearoa

@africantearoa yes the code is not support for touchListener yet. and in default popup doesnt go full screen. you can see it in the popup window section how it has coded. anyway ill look on to it. hope you can come up with a great solution as well

chathuralakmal avatar Jul 23 '17 19:07 chathuralakmal

I wonder if we could include a onTouchListener setter method for the layout object in the popupImage class?

On 24/07/2017 7:10 AM, "Chathura Lakmal" [email protected] wrote:

@africantearoa https://github.com/africantearoa yes the code is not support for touchListener yet. and in default popup doesnt go full screen. you can see it in the popup window section how it has coded. anyway ill look on to it. hope you can come up with a great solution as well

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/chathuralakmal/AndroidImagePopup/issues/11#issuecomment-317275070, or mute the thread https://github.com/notifications/unsubscribe-auth/AV2b-ThiH8LltrF7_Ykeel3lzZZgUfGGks5sQ5q1gaJpZM4OghSP .

africantearoa avatar Jul 23 '17 21:07 africantearoa