|
@@ -481,8 +481,8 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
|
|
|
}
|
|
|
|
|
|
IDeviceUI iDeviceUI;
|
|
|
- int dispalyWidth;
|
|
|
- int dispalyHeight;
|
|
|
+ int displayWidth;
|
|
|
+ int displayHeight;
|
|
|
|
|
|
@Override
|
|
|
protected void initData() {
|
|
@@ -524,10 +524,10 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
|
|
|
|
|
|
// 获取设备宽高
|
|
|
DisplayMetrics dm = getResources().getDisplayMetrics();
|
|
|
- dispalyWidth = dm.widthPixels;
|
|
|
- dispalyHeight = dm.heightPixels;
|
|
|
- AppLogUtils.e("dispalyWidth:"+dispalyWidth);
|
|
|
- AppLogUtils.e("dispalyHeight:"+dispalyHeight);
|
|
|
+ displayWidth = dm.widthPixels;
|
|
|
+ displayHeight = dm.heightPixels;
|
|
|
+ AppLogUtils.e("displayWidth:"+displayWidth);
|
|
|
+ AppLogUtils.e("displayHeight:"+displayHeight);
|
|
|
|
|
|
|
|
|
// 权限
|
|
@@ -875,37 +875,40 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
|
|
|
// ArrayList<String> blackList = new ArrayList<>();
|
|
|
// blackList.add("2021002163620647");
|
|
|
// themeConfig.putStringArrayList("floatWindowBlacklist", blackList);
|
|
|
-
|
|
|
+
|
|
|
+ AppLogUtils.e("displayWidth--"+displayWidth);
|
|
|
+ AppLogUtils.e("displayHeight--"+displayHeight);
|
|
|
|
|
|
//竖屏配置,若没有可以不配置
|
|
|
Bundle portrait = new Bundle();
|
|
|
//竖屏默认默认值是2 可参考https://opendocs.alipay.com/mini/00v8et?pathHash=8d2d3fa2#3.1%20%E5%90%AF%E5%8A%A8
|
|
|
portrait.putInt("showType", 2);
|
|
|
- //默认750 小程序显示的宽度750就是按给定窗口的大小显示,如果是375则是给定窗口大小的一半显示
|
|
|
- portrait.putInt("launchWidth", dispalyWidth);
|
|
|
+
|
|
|
+
|
|
|
//横屏配置,若没有可以不配置
|
|
|
Bundle landscape = new Bundle();
|
|
|
//横屏默认值是123
|
|
|
landscape.putInt("showType", 2);
|
|
|
-// landscape.putInt("launchWidth", 750);
|
|
|
- landscape.putInt("launchWidth", dispalyWidth);
|
|
|
+
|
|
|
+
|
|
|
+ if(deviceModel.contains(Constants.DeviceModel.ZP_A50)){
|
|
|
+ // 紫鹏X5的配置。按照获取的值左右有边距
|
|
|
+ //竖屏配置的宽度 默认750 小程序显示的宽度750就是按给定窗口的大小显示,如果是375则是给定窗口大小的一半显示
|
|
|
+ portrait.putInt("launchWidth", 750);
|
|
|
+ // 横屏配置的宽度
|
|
|
+ landscape.putInt("launchWidth", 750);
|
|
|
+ }else{
|
|
|
+ //竖屏配置的宽度 默认750 小程序显示的宽度750就是按给定窗口的大小显示,如果是375则是给定窗口大小的一半显示
|
|
|
+ portrait.putInt("launchWidth", displayWidth);
|
|
|
+ // 横屏配置的宽度
|
|
|
+ landscape.putInt("launchWidth", displayWidth);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
themeConfig.putBundle("portrait", portrait);
|
|
|
themeConfig.putBundle("landscape", landscape);
|
|
|
|
|
|
|
|
|
-// // 设置自定义titlebar资源加载路径
|
|
|
-// File resourcePath = new File(MainActivity.this.getExternalFilesDir(null), "cache");
|
|
|
-// File newFile = new File(resourcePath, "titlebarResPkg-debug.apk");
|
|
|
-// AppLogUtils.e("newFile--"+newFile.getAbsolutePath());
|
|
|
-// if (newFile.exists()) {
|
|
|
-// Uri contentUri = FileProvider.getUriForFile(MainActivity.this, "com.alipay.arome.aromedemo.fileprovider", newFile);
|
|
|
-// AppLogUtils.e("ampe---contentUri is " + contentUri);
|
|
|
-// MainActivity.this.grantUriPermission("com.alipay.arome.app", contentUri, Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
|
|
-// themeConfig.putString("localAssetApkPath", contentUri.toString());
|
|
|
-// themeConfig.putString("localAssetPkgName", "com.example.titlebarResPkg");
|
|
|
-// }
|
|
|
-
|
|
|
// 设备信息配置
|
|
|
Bundle deviceConfig = new Bundle();
|
|
|
//用于接收广播的应用包名
|
|
@@ -3208,28 +3211,31 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
|
|
|
}
|
|
|
// 聚合授权-------end
|
|
|
|
|
|
+ AppLogUtils.e("displayHeight:"+displayHeight);
|
|
|
+ AppLogUtils.e("displayWidth:"+displayWidth);
|
|
|
+
|
|
|
|
|
|
if(Constants.DeviceModel.D2.equals(deviceModel)){
|
|
|
|
|
|
- AppLogUtils.e("dispalyHeight:"+dispalyHeight);
|
|
|
- AppLogUtils.e("displayWidth:"+dispalyHeight*0.625);
|
|
|
- AppLogUtils.e("displayX:"+(dispalyWidth-(dispalyHeight*0.625))/2);
|
|
|
+ AppLogUtils.e("displayHeight:"+displayHeight);
|
|
|
+ AppLogUtils.e("displayWidth:"+displayHeight*0.625);
|
|
|
+ AppLogUtils.e("displayX:"+(displayWidth-(displayHeight*0.625))/2);
|
|
|
|
|
|
// D2访客机刷脸屏幕设置-----begin
|
|
|
// 是否悬浮,默认false
|
|
|
extInfo.put("isFloat",true);
|
|
|
// 显示X偏移,默认0 (宽度-刷脸界面宽度)/2 越大越往右边偏移
|
|
|
- extInfo.put("displayX",(dispalyWidth-(dispalyHeight*0.625))/2+41);
|
|
|
+ extInfo.put("displayX",(displayWidth-(displayHeight*0.625))/2+41);
|
|
|
// extInfo.put("displayX",0);
|
|
|
// 显示Y偏移,默认0
|
|
|
extInfo.put("displayY",-300);
|
|
|
// extInfo.put("displayY",0);
|
|
|
// 显示宽度,默认屏幕宽度
|
|
|
// extInfo.put("displayWidth",675);
|
|
|
- extInfo.put("displayWidth",(dispalyHeight*0.625));// 如果+1.5的话,就会是悬浮状态(其余黑色)
|
|
|
+ extInfo.put("displayWidth",(displayHeight*0.625));// 如果+1.5的话,就会是悬浮状态(其余黑色)
|
|
|
// 显示宽度,默认屏幕⾼度
|
|
|
// extInfo.put("displayHeight",1080);
|
|
|
- extInfo.put("displayHeight",dispalyHeight);
|
|
|
+ extInfo.put("displayHeight",displayHeight);
|
|
|
// 主副屏,0主 1副
|
|
|
extInfo.put("displayMode",0);
|
|
|
// D2访客机刷脸屏幕设置-----end
|
|
@@ -5190,6 +5196,9 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
|
|
|
|
|
|
AppLogUtils.e("invoke -- params = " + params.toString());
|
|
|
|
|
|
+ // 打印用
|
|
|
+ final Map<String, Object> paramsNew = params;
|
|
|
+
|
|
|
BPaaSApi.getInstance().invoke(ConfigData.getDeviceConfigResultBean().getAbcpAppId(),
|
|
|
"BPaasVerifyID", params, mSessionId, new BPaaSCallback() {
|
|
|
@Override
|
|
@@ -5198,6 +5207,8 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
|
|
|
// 非主线程
|
|
|
AppLogUtils.e("---调用刷脸invoke onResponse = " + new Gson().toJson(bPaaSResponse) + "-----CardOrCode = " + CardOrCode);
|
|
|
|
|
|
+
|
|
|
+
|
|
|
int code = bPaaSResponse.getCode();
|
|
|
|
|
|
// 日志开始----------------begin
|
|
@@ -5208,8 +5219,11 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
|
|
|
// 日志内容
|
|
|
StringBuilder logContentSb = new StringBuilder();
|
|
|
logContentSb.append(logNode).append(WARP)
|
|
|
+ .append("params = ").append(paramsNew).append(WARP)
|
|
|
.append("code = ").append(code).append(WARP)
|
|
|
- .append("bPaaSResponse = ").append(bPaaSResponse);
|
|
|
+ .append("bPaaSResponse = ").append(bPaaSResponse).append(WARP)
|
|
|
+ .append("bPaaSResponseJson = ").append(gson.toJson(bPaaSResponse)).append(WARP)
|
|
|
+ ;
|
|
|
|
|
|
// 开始保存本地日志
|
|
|
AppLogUtils.saveLog(LogType.Logcat, new StringBuilder()
|