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 e85800e8..f4e0ff33 100644 --- a/app/src/main/java/com/lxj/xpopupdemo/fragment/QuickStartDemo.java +++ b/app/src/main/java/com/lxj/xpopupdemo/fragment/QuickStartDemo.java @@ -142,7 +142,6 @@ public void onClick(View v) { case R.id.btnShowConfirm: //带确认和取消按钮的弹窗 /*if(popupView==null)*/ popupView = new XPopup.Builder(getContext()) -// .hasStatusBar(false) .isDestroyOnDismiss(true) // .isTouchThrough(true) // .dismissOnBackPressed(false) @@ -306,7 +305,7 @@ public void onSelect(int position, String text) { popupView = new ZhihuCommentPopup(getContext()); new XPopup.Builder(getContext()) .moveUpToKeyboard(false) //如果不加这个,评论弹窗会移动到软键盘上面 - .isViewMode(true) +// .isViewMode(true) // .enableDrag(false) .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 // .isThreeDrag(true) //是否开启三阶拖拽,如果设置enableDrag(false)则无效 diff --git a/library/src/main/java/com/lxj/xpopup/core/FullScreenDialog.java b/library/src/main/java/com/lxj/xpopup/core/FullScreenDialog.java index 9edc05a8..67c1a1da 100644 --- a/library/src/main/java/com/lxj/xpopup/core/FullScreenDialog.java +++ b/library/src/main/java/com/lxj/xpopup/core/FullScreenDialog.java @@ -67,11 +67,6 @@ protected void onCreate(Bundle savedInstanceState) { getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); //尝试兼容部分手机上的状态栏空白问题 } - //隐藏导航栏 - if (!contentView.popupInfo.hasNavigationBar) { - hideNavigationBar(); - } - if(!contentView.popupInfo.isRequestFocus){//不获取焦点 int flag = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; if(contentView.popupInfo.isCoverSoftInput){ @@ -178,6 +173,10 @@ private String getResNameById(int id) { } public void setNavBarLightMode() { + //隐藏导航栏 + if (!contentView.popupInfo.hasNavigationBar) { + hideNavigationBar(); + } int light = contentView.popupInfo.isLightNavigationBar == 0 ? XPopup.isLightNavigationBar : contentView.popupInfo.isLightNavigationBar; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && light!=0) { View decorView = getWindow().getDecorView(); @@ -203,6 +202,8 @@ public FullScreenDialog setContent(BasePopupView view) { @Override public void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(hasFocus); + setStatusBarLightMode(); + setNavBarLightMode(); if(hasFocus && contentView!=null && contentView.hasMoveUp && contentView.popupStatus== PopupStatus.Show){ contentView.focusAndProcessBackPress(); KeyboardUtils.showSoftInput(contentView);