From 9a1a213f5ccbbf16cac35ff712cc604747b87400 Mon Sep 17 00:00:00 2001 From: li-xiaojun <16167479@qq.com> Date: Sat, 19 Nov 2022 17:14:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DDrawer=E5=BC=B9=E7=AA=97dismi?= =?UTF-8?q?ssOnTouchOutside(false)=E6=97=A0=E6=95=88=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/lxj/xpopupdemo/fragment/QuickStartDemo.java | 2 ++ library/src/main/java/com/lxj/xpopup/core/DrawerPopupView.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/lxj/xpopupdemo/fragment/QuickStartDemo.java b/app/src/main/java/com/lxj/xpopupdemo/fragment/QuickStartDemo.java index 9d4d294a..1f97b72a 100644 --- a/app/src/main/java/com/lxj/xpopupdemo/fragment/QuickStartDemo.java +++ b/app/src/main/java/com/lxj/xpopupdemo/fragment/QuickStartDemo.java @@ -394,6 +394,7 @@ public void onSelect(int position, String text) { // .asCustom(new CustomDrawerPopupView(getContext())) // .hasShadowBg(false) // .maxWidth(100) + .dismissOnTouchOutside(false) .isViewMode(true) //使用了Fragment,必须开启View模式 .asCustom(new PagerDrawerPopup(getContext())) // .asCustom(new ListDrawerPopupView(getContext())) @@ -404,6 +405,7 @@ public void onSelect(int position, String text) { // .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 .autoOpenSoftInput(true) // .popupWidth(300) + .dismissOnTouchOutside(false) .popupPosition(PopupPosition.Right)//右边 // .hasStatusBarShadow(true) //启用状态栏阴影 .setPopupCallback(new DemoXPopupListener()) diff --git a/library/src/main/java/com/lxj/xpopup/core/DrawerPopupView.java b/library/src/main/java/com/lxj/xpopup/core/DrawerPopupView.java index cb0d0e92..6e476fb9 100644 --- a/library/src/main/java/com/lxj/xpopup/core/DrawerPopupView.java +++ b/library/src/main/java/com/lxj/xpopup/core/DrawerPopupView.java @@ -105,7 +105,7 @@ public void onClick(View v) { if(popupInfo.xPopupCallback!=null){ popupInfo.xPopupCallback.onClickOutside(DrawerPopupView.this); } - if(popupInfo.isDismissOnTouchOutside!=null){ + if(popupInfo.isDismissOnTouchOutside){ dismiss(); } }