Skip to content

Cannot use setOnTouchListener #11

@africantearoa

Description

@africantearoa

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions