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

最新的源码,getContentView().setOnClickListener 响应了两次点击事件 #95

Closed
tpnet opened this issue Nov 2, 2018 · 0 comments

Comments

@tpnet
Copy link

tpnet commented Nov 2, 2018

重现步骤

在ScalePopupd的构造方法的bindEvent()下面添加代码如下,,点击根view,会发现响应了两次点击事件。


    boolean canDismiss = false;
    public ScalePopup(Activity context) {
        super(context);
        bindEvent();
        setAllowDismissWhenTouchOutside(false);
        getContentView().setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Log.e("@@","点击了根view");
                if(canDismiss) {
                    dismiss();
                }
                canDismiss = true;
            }
        });
    }

报错信息/系统版本

Android5.1 ,flyme6

建议或优化点

razerdp added a commit that referenced this issue Nov 2, 2018
@razerdp razerdp closed this as completed Nov 2, 2018
razerdp added a commit that referenced this issue Dec 7, 2018
razerdp added a commit that referenced this issue Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants