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 41038575..450ef3f9 100644 --- a/app/src/main/java/com/lxj/xpopupdemo/fragment/QuickStartDemo.java +++ b/app/src/main/java/com/lxj/xpopupdemo/fragment/QuickStartDemo.java @@ -143,6 +143,7 @@ public void onClick(View v) { new XPopup.Builder(getContext()) .isDestroyOnDismiss(true) .hasStatusBar(false) + .isRequestFocus(false) .asCustom(new CustomCenter1(getContext())) .show(); break; diff --git a/build.gradle b/build.gradle index 4cc7326f..8a534776 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.xpopup_version = "2.9.17-beta2" + ext.xpopup_version = "2.9.17" repositories { google() mavenCentral() 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 3d3ed7d9..d2751da6 100644 --- a/library/src/main/java/com/lxj/xpopup/core/FullScreenDialog.java +++ b/library/src/main/java/com/lxj/xpopup/core/FullScreenDialog.java @@ -7,6 +7,7 @@ import android.graphics.PixelFormat; import android.os.Build; import android.os.Bundle; +import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; @@ -15,13 +16,12 @@ import com.lxj.xpopup.R; import com.lxj.xpopup.XPopup; import com.lxj.xpopup.enums.PopupStatus; -import com.lxj.xpopup.util.FuckRomUtils; import com.lxj.xpopup.util.KeyboardUtils; import com.lxj.xpopup.util.XPermission; import com.lxj.xpopup.util.XPopupUtils; /** - * 所有弹窗的宿主 + * 弹窗的宿主 */ public class FullScreenDialog extends Dialog { public FullScreenDialog(@NonNull Context context) { @@ -81,22 +81,7 @@ protected void onCreate(Bundle savedInstanceState) { setStatusBarLightMode(); setNavBarLightMode(); - - //处理VIVO手机8.0以上系统部分机型的状态栏问题和弹窗下移问题 - boolean isPortrait = getContext().getResources().getConfiguration().orientation - == Configuration.ORIENTATION_PORTRAIT; - if(isFuckVIVORoom() && isPortrait){ - getWindow().getDecorView().setTranslationY(-XPopupUtils.getStatusBarHeight(getWindow())); - getWindow().setLayout(XPopupUtils.getAppWidth(getContext()), Math.max(XPopupUtils.getAppHeight(getContext()), - XPopupUtils.getScreenHeight(getContext()))); - } setContentView(contentView); -// contentView.post(new Runnable() { -// @Override -// public void run() { -// if(contentView!=null) contentView.setTranslationX(contentView.getActivityContentLeft()); -// } -// }); } private int getNavigationBarColor(){ @@ -104,16 +89,6 @@ private int getNavigationBarColor(){ : contentView.popupInfo.navigationBarColor; } - public boolean isFuckVIVORoom(){ - //vivo的Y和V开头的8.0和8.1系统特殊(y91 y85 y97):dialog无法覆盖到状态栏,并且坐标系下移了一个状态栏的距离 -// boolean isFuckModel = android.os.Build.MODEL.startsWith("Y") -// || android.os.Build.MODEL.startsWith("y") -// || android.os.Build.MODEL.startsWith("V") -// || android.os.Build.MODEL.startsWith("v"); -// return FuckRomUtils.isVivo() && (Build.VERSION.SDK_INT == 26 || Build.VERSION.SDK_INT == 27) && isFuckModel; - return false; - } - public void setWindowFlag(final int bits, boolean on) { WindowManager.LayoutParams winParams = getWindow().getAttributes(); if (on) { @@ -214,12 +189,4 @@ public void onWindowFocusChanged(boolean hasFocus) { } } - @Override - public boolean dispatchTouchEvent(MotionEvent event) { - if(isFuckVIVORoom()){ //VIVO的部分机型需要做特殊处理,Fuck - event.setLocation(event.getX(), event.getY()+XPopupUtils.getStatusBarHeight(getWindow())); - } - return super.dispatchTouchEvent(event); - } - }