|
@@ -21,9 +21,11 @@ import com.alipay.arome.aromecli.AromeServiceInvoker;
|
|
|
import com.alipay.arome.aromecli.AromeServiceTask;
|
|
|
import com.alipay.arome.aromecli.requst.AromeActivateRequest;
|
|
|
import com.alipay.arome.aromecli.requst.AromeExitAppRequest;
|
|
|
+import com.alipay.arome.aromecli.requst.AromeGetAppStatusRequest;
|
|
|
import com.alipay.arome.aromecli.requst.AromeLaunchAppRequest;
|
|
|
import com.alipay.arome.aromecli.requst.AromeSendEventRequest;
|
|
|
import com.alipay.arome.aromecli.response.AromeExitAppResponse;
|
|
|
+import com.alipay.arome.aromecli.response.AromeGetAppStatusResponse;
|
|
|
import com.alipay.arome.aromecli.response.AromeResponse;
|
|
|
import com.alipay.iot.bpaas.api.BPaaSApi;
|
|
|
import com.alipay.iot.bpaas.api.BPaaSInitCallback;
|
|
@@ -1175,6 +1177,7 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
|
|
|
//是否隐藏导航栏 默认false
|
|
|
themeConfig.putBoolean("hideNavigationBar", false);
|
|
|
//是否隐藏标题栏胶囊按钮 默认false不隐藏,true隐藏。配置右上角三个圆点和X
|
|
|
+ AppLogUtils.e("三个圆点hideNavigationBar:"+hideNavigationBar);
|
|
|
themeConfig.putBoolean("hideOptionMenu", hideNavigationBar);
|
|
|
// themeConfig.putBoolean("hideOptionMenu", true);
|
|
|
//超时时间 单位秒,默认30秒 建议传大于10的值
|
|
@@ -1205,6 +1208,8 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
|
|
|
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
|
|
@@ -1217,6 +1222,9 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
|
|
|
landscape.putInt("showType", 2);
|
|
|
|
|
|
|
|
|
+// AppLogUtils.e("showType--" + portrait.getInt("showType"));
|
|
|
+
|
|
|
+
|
|
|
if (deviceModel.contains(Constants.DeviceModel.ZP_A50)) {
|
|
|
// 紫鹏X5的配置。按照获取的值左右有边距
|
|
|
//竖屏配置的宽度 默认750 小程序显示的宽度750就是按给定窗口的大小显示,如果是375则是给定窗口大小的一半显示
|
|
@@ -1427,6 +1435,44 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+ // 小程序状态
|
|
|
+ boolean appletRunnning;
|
|
|
+ boolean appleForeground;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取小程序运行的状态
|
|
|
+ */
|
|
|
+ public void getAppletStatus(){
|
|
|
+
|
|
|
+ AromeGetAppStatusRequest request = new AromeGetAppStatusRequest();
|
|
|
+ request.appId = appletId;
|
|
|
+ AromeServiceInvoker.invoke(request, new AromeServiceTask.Callback<AromeGetAppStatusResponse>() {
|
|
|
+ @Override
|
|
|
+ public void onCallback(final AromeGetAppStatusResponse response) {
|
|
|
+
|
|
|
+ AppLogUtils.e("小程序运行状态response:"+response.toString());
|
|
|
+
|
|
|
+ if(response!=null){
|
|
|
+ // 小程序是否正在运行 true/false
|
|
|
+ Boolean isRunnning = response.isRunnning;
|
|
|
+ // 小程序是否在前台 true/false
|
|
|
+ Boolean isForeground = response.isForeground;
|
|
|
+
|
|
|
+
|
|
|
+ appletRunnning = isRunnning;
|
|
|
+ appleForeground = isForeground;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 日志统一打印
|
|
|
* 网络和本地保存日志
|
|
@@ -4048,11 +4094,23 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
|
|
|
|
|
|
final DeviceConfigResultBean newResultBean = resultBean;
|
|
|
|
|
|
+ // 先获取下小程序状态。卸载app后首次安装,导致各类配置失效。展示三个小圆点和,小程序左中右布局
|
|
|
+// getAppletStatus();
|
|
|
+
|
|
|
// 为了身份证初始化成功
|
|
|
mHandler.postDelayed(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
- initAndActive(newResultBean);
|
|
|
+
|
|
|
+// if(appletRunnning&&appleForeground){
|
|
|
+ if(isLaunchApplet){
|
|
|
+ // 小程序已经运行
|
|
|
+ AppLogUtils.e("小程序已经运行,不操作");
|
|
|
+ }else{
|
|
|
+ AppLogUtils.e("小程序没有运行,开始启动");
|
|
|
+ initAndActive(newResultBean);
|
|
|
+ }
|
|
|
+
|
|
|
// 如果未打开,那就是error1, no implement
|
|
|
}
|
|
|
}, 5 * 1000);
|