Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On cancelling targetview, background screen is getting blocked. #285

Closed
2 tasks done
NeerajaReddyKomma opened this issue Apr 12, 2018 · 10 comments
Closed
2 tasks done

Comments

@NeerajaReddyKomma
Copy link

NeerajaReddyKomma commented Apr 12, 2018

  • I have verified the issue exists on the latest version
  • I am able to reproduce it

Version used: 1.11.0

Stack trace: On cancelling targetview, Background view is blocked unable to do any other action on that.

Android version: 6.0.1

@jitarun
Copy link

jitarun commented May 11, 2018

I'm also facing same issue, any updates?.

@NeerajaReddyKomma
Copy link
Author

@jitarun No.. Waiting for author to figure what might be solution.

@bellierjonathan
Copy link

capture d ecran 2018-06-14 a 15 38 36

When my background is blocked, I still have the view on the top 😶 but nothing is visible.

@canouser
Copy link

same issue i am also facing ...

@xiphirx
Copy link
Collaborator

xiphirx commented Jul 5, 2018

Do you have a case that reproduces this issue? I'm not sure what would be going wrong here. At the very least, you should be able to remove that view yourself.

@NeerajaReddyKomma
Copy link
Author

As soon as we tap on target view, screen gets blocked i mean untouchable. So we can't perform any further actions. Either we should close app and reopen it or we should finish and recreate activity.

@JandemX
Copy link

JandemX commented Aug 10, 2018

Not enough Info but: can it be that you overwrite the onTargeClick Listener Method? If so, then the isInteractable Boolean is set false and never set true again, all further onClick actions get ignored.

@KrunalNumbertank
Copy link

In my case this happens mostly in RecyclerView ViewHolder.
Here are the steps to generate test case:
step 1: Show tapTargetView for view A in row R10. ( This will work properly )
step 2: Show tapTargetView for view B in row R10 (or any other row). ( Here code to display tapTargetView will execute properly, but tapTargetView will not be displayed and app goes untappable. )

@KrunalNumbertank
Copy link

Finally I've handled this issue with below little updates...

  1. Update ViewUtil > onLaidOut method as below :
static void onLaidOut(final View view, final Runnable runnable) {

        if (isLaidOut(view)) {
            runnable.run();
            return;
        }

        if (view.getWidth() > 0 && view.getHeight() > 0) {

            runnable.run();

        } else {

            final ViewTreeObserver observer = view.getViewTreeObserver();

            observer.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
                @Override
                public void onGlobalLayout() {

                    final ViewTreeObserver trueObserver;

                    if (observer.isAlive()) {
                        trueObserver = observer;
                    } else {
                        trueObserver = view.getViewTreeObserver();
                    }

                    removeOnGlobalLayoutListener(trueObserver, this);

                    runnable.run();
                }
            });
        }
    }
  1. Update TapTargetView > setOnClickListener as below :
setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                if (listener == null || outerCircleCenter == null || !isInteractable) {
                    dismiss(false);
                    return;
                }
            ...........
           ............ other code as it is....
            }
        });

@xiphirx
Copy link
Collaborator

xiphirx commented Oct 1, 2018

It seems like onTargetClick is being overridden and the overridden implementation is not calling super, and so the view is never dismissed. If you are going to override onTargetClick then you need to ensure you dismiss the view.

Closing now, if there is new info or if this is not the case then please open a new issue.

@xiphirx xiphirx closed this as completed Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants