Ver Fonte

The common editor sometimes gets stuck after the background data format is wrong -- common editor 有时会在后台数据格式错误后卡死(resolve: #14673)
Common editor cannot be refreshed after deletion/submission -- common editor 删除 / 提交后无法刷新上级 editor(resolve: #14674)

Ray Zhang há 4 anos atrás
pai
commit
34e2a39bcf

+ 19 - 1
ApexDrivers/CommonEditorLib/src/main/java/com/usai/commoneditorlib/CommonEditorActivity.java

@@ -1283,7 +1283,23 @@ public class CommonEditorActivity extends AppCompatActivity implements View.OnLa
                 public void run() {
                     JSONObject refresh_params = get_refresh_param();
                     if (refresh_params == null)
-                        return;
+                    {
+
+                        runOnUiThread(new Runnable() {
+                            @Override
+                            public void run()
+                            {
+                                pd.dismiss();
+//                        if (editor_json == null) {
+                                RAUtil.alertMessage(mCtx,"Warning","Something is wrong, please contact administrator.");
+                                adapter.notifyDataSetChanged();
+
+                            }
+                        });
+
+                            return;
+//                        }
+                    }
                     Iterator<String> iterator = refresh_params.keys();
 
                     while (iterator.hasNext()) {
@@ -1362,6 +1378,8 @@ public class CommonEditorActivity extends AppCompatActivity implements View.OnLa
         try {
             JSONObject params = new JSONObject();
             JSONObject param_names = content_data_download.optJSONObject("up_params");
+            if (param_names == null)
+                return null;
             int param_count = param_names.optInt("count");
             for (int pc = 0; pc < param_count; pc++) {
                 String param_name = param_names.optString("val_" + pc);

+ 1 - 1
ApexDrivers/ratradefiling/src/main/java/com/usai/ratradefiling/Const.java

@@ -4,7 +4,7 @@ import java.util.concurrent.atomic.AtomicInteger;
 
 public class Const {
 
-    public static final boolean FAKE_DATA = true;
+    public static final boolean FAKE_DATA = false;
 
     public static final int MY_PERMISSIONS_REQUEST = 1;
     private static final AtomicInteger sNextGeneratedId = new AtomicInteger(1);

+ 3 - 2
ApexDrivers/ratradefiling/src/main/java/com/usai/ratradefiling/tfeditor/TFEditorActivity.java

@@ -282,7 +282,7 @@ public class TFEditorActivity extends CommonEditorActivity
                                     {
 
                                         RAUtil.alertMessage(mCtx, "Message", "Submit successful");
-
+                                        prepareReturn();
                                     }
                                     else
                                     {
@@ -347,7 +347,8 @@ public class TFEditorActivity extends CommonEditorActivity
                                         builder.setPositiveButton(mCtx.getString(com.usai.redant.rautils.R.string.ra_btn_ok), new DialogInterface.OnClickListener() {
                                             @Override
                                             public void onClick(DialogInterface dialog, int which) {
-                                                finish();
+                                                prepareReturn();
+//                                                finish();
                                             }
                                         });