|
|
@@ -3,16 +3,18 @@ package org.cocos2dx.javascript.thirdSdk.ysdk;
|
|
|
import android.app.AlertDialog;
|
|
|
import android.content.DialogInterface;
|
|
|
import android.graphics.drawable.BitmapDrawable;
|
|
|
+import android.os.Build;
|
|
|
import android.util.Log;
|
|
|
import android.view.Gravity;
|
|
|
import android.view.View;
|
|
|
+import android.view.WindowManager;
|
|
|
import android.webkit.WebSettings;
|
|
|
import android.webkit.WebView;
|
|
|
import android.webkit.WebViewClient;
|
|
|
import android.widget.Button;
|
|
|
import android.widget.PopupWindow;
|
|
|
|
|
|
-import com.aries.kxnly.mz.R;
|
|
|
+import com.aries.kxnly.jsb.R;
|
|
|
import com.tencent.ysdk.api.YSDKApi;
|
|
|
import com.tencent.ysdk.framework.common.ePlatform;
|
|
|
import com.tencent.ysdk.module.antiaddiction.listener.AntiAddictListener;
|
|
|
@@ -57,6 +59,9 @@ public class YSDKMgr {
|
|
|
// 全局回调类,游戏自行实现
|
|
|
YSDKApi.setUserListener(YSDKMgr.sUserListener);
|
|
|
YSDKApi.setAntiAddictListener(YSDKMgr.sAntiAddictListener);
|
|
|
+
|
|
|
+ // 适配刘海屏
|
|
|
+ fitNotch();
|
|
|
}
|
|
|
|
|
|
public static void autologin()
|
|
|
@@ -193,4 +198,24 @@ public class YSDKMgr {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private static void fitNotch() {
|
|
|
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
|
|
+ boolean isSupport = SPUtils
|
|
|
+ .getBoolean(ThirdSdkMgr.appActivity, SPUtils.KEY_YSDK_SUPPORT_NOTCH, false);
|
|
|
+ YSDKApi.setNotchSupport(isSupport);
|
|
|
+ boolean isAppSupportNotch = SPUtils
|
|
|
+ .getBoolean(ThirdSdkMgr.appActivity, SPUtils.KEY_APP_IS_SUPPORT_NOTCH, false);
|
|
|
+ if (isAppSupportNotch) {
|
|
|
+ WindowManager.LayoutParams lp = ThirdSdkMgr.appActivity.getWindow().getAttributes();
|
|
|
+ lp.layoutInDisplayCutoutMode
|
|
|
+ = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
|
|
|
+ ThirdSdkMgr.appActivity.getWindow().setAttributes(lp);
|
|
|
+ // 设置页面全屏显示
|
|
|
+ final View decorView = ThirdSdkMgr.appActivity.getWindow().getDecorView();
|
|
|
+ decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
|
|
+ | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|