Browse Source

2.7.8 optimize : 副屏代码优化

xwh 7 months ago
parent
commit
b8fb7b0677

+ 6 - 5
app/src/main/java/com/hh/arome/ui/MainActivity.java

@@ -2970,7 +2970,7 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
             if (bridgeCallback != null) {
                 bridgeCallback.callback(jsonObject.toString());
             }
-            sendLogs(Constants.Ampe.ACTION_OPENSECONDARYSCREEN,jsonObject);
+            sendLogs(Constants.Ampe.ACTION_OPENSECONDARYSCREEN,jsonObject,"");
         }catch (Throwable t) {
             AppLogUtils.e("onCalled--t" + t);
         }
@@ -2999,7 +2999,7 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
             if (bridgeCallback != null) {
                 bridgeCallback.callback(jsonObject.toString());
             }
-            sendLogs(Constants.Ampe.ACTION_CLOSESECONDARYSCREEN,jsonObject);
+            sendLogs(Constants.Ampe.ACTION_CLOSESECONDARYSCREEN,jsonObject,"");
         }catch (Throwable t) {
             AppLogUtils.e("onCalled--t" + t);
         }
@@ -3029,7 +3029,8 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
             if (bridgeCallback != null) {
                 bridgeCallback.callback(jsonObject.toString());
             }
-            sendLogs(Constants.Ampe.ACTION_SECONDARYSCREENSTATE,jsonObject);
+            String stateLog="当前副屏状态:"+state+"    ";
+            sendLogs(Constants.Ampe.ACTION_SECONDARYSCREENSTATE,jsonObject,stateLog);
         }catch (Throwable t) {
             AppLogUtils.e("onCalled--t" + t);
         }
@@ -3043,7 +3044,7 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
      * @date 2024/6/20
      *
      */ 
-    private void sendLogs(String action,JsonObject jsonObject) {
+    private void sendLogs(String action,JsonObject jsonObject,String defaultLog) {
         try {
             // 日志开始----------------begin
             // 日志行数——对应web端"日志标签"
@@ -3052,7 +3053,7 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
             String logNode = action + "--回传处理结果给小程序--";
             // 日志内容
             StringBuilder logContentSb = new StringBuilder();
-            logContentSb.append(logNode).append(WARP)
+            logContentSb.append(logNode).append(defaultLog).append(WARP)
                     .append("jsonObject = ").append(jsonObject);
 
             // 开始保存本地日志

+ 3 - 11
secondaryscreen/src/main/java/com/hh/arome/secondaryscreen/SecondaryScreenPage.java

@@ -57,16 +57,6 @@ public class SecondaryScreenPage extends Presentation implements View.OnClickLis
 
     }
 
-/*    public void showBg(){
-        Glide.with(imageView)
-                .asBitmap()
-                .load("http://gips2.baidu.com/it/u=195724436,3554684702&fm=3028&app=3028&f=JPEG&fmt=auto?w=1280&h=960")
-                .centerCrop()
-                .into(imageView);
-        ll.setVisibility(View.GONE);
-    }*/
-
-
     
     /**
      *
@@ -154,7 +144,9 @@ public class SecondaryScreenPage extends Presentation implements View.OnClickLis
      */ 
     public static void close(){
         if(screenPage!=null){
-            screenPage.dismiss();
+            if(screenPage.isShowing()) {
+                screenPage.dismiss();
+            }
             screenPage=null;
         }