Bläddra i källkod

Cannot trigger refresh after common editor form content is modified -- common editor 表单内容修改后无法触发刷新(resolve: #14573)
The enumeration type parameter called by common editor action / maction is wrong, and the single selection becomes multiple selection -- 通过common editor action / maction 调用的枚举类型参数错误,单选变成了多选(resolve: #14564)

Ray Zhang 4 år sedan
förälder
incheckning
84fb93a86e

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

@@ -652,7 +652,7 @@ public class CommonEditorActivity extends AppCompatActivity implements View.OnLa
         if (is_subaction) {
 
             JSONObject sub_action = item_json.optJSONObject("item_" + subaction_tag);
-            int refresh = sub_action.optInt("refresh");
+            boolean refresh = sub_action.optBoolean("refresh");
             boolean discardDirty =sub_action.optBoolean("discarddirty");
             String refresh_trigger = sub_action.optString("name");
             JSONObject restore_json = sub_action.optJSONObject("restore");
@@ -782,7 +782,7 @@ public class CommonEditorActivity extends AppCompatActivity implements View.OnLa
 
             content_data_control = translateChange(content_data_download,changed_data);
 
-            if (refresh == 1) {
+            if (refresh) {
 
                 if (restore_json != null) {
                     int rc = restore_json.optInt("count");
@@ -815,7 +815,7 @@ public class CommonEditorActivity extends AppCompatActivity implements View.OnLa
 
             // is_subaction
         } else {
-            int refresh = item_json.optInt("refresh");
+            boolean refresh = item_json.optBoolean("refresh");
             boolean discardDirty = item_json.optBoolean("discardDirty");
             String refresh_trigger = item_json.optString("name");
             JSONObject restore_json = item_json.optJSONObject("restore");
@@ -931,7 +931,7 @@ public class CommonEditorActivity extends AppCompatActivity implements View.OnLa
 
             content_data_control = translateChange(content_data_download,changed_data);
 
-            if (refresh != 1) {
+            if (!refresh) {
 
                 if (restore_json != null) {
                     int rc = restore_json.optInt("count");
@@ -2524,7 +2524,7 @@ protected void commonAction(String value, int groupIndex,int itemIndex,JSONObjec
 
 
 
-        int refresh = item_json.optInt("refresh");
+        boolean refresh = item_json.optBoolean("refresh");
         boolean discardDirty = item_json.optBoolean("discard_dirty");
         String refresh_trigger = item_json.optString("name");
         String subid=item_json.optString("subid");
@@ -3657,7 +3657,7 @@ protected void commonAction(String value, int groupIndex,int itemIndex,JSONObjec
 
             JSONObject section_json = null;
             JSONObject item_json = content_data_control.optJSONArray(group).optJSONObject(child);
-            int refresh = item_json.optInt("refresh");
+            boolean refresh = item_json.optBoolean("refresh");
             boolean discardDirty = item_json.optBoolean("discarddirty");
             String refresh_trigger = item_json.optString("name");
             String subid = item_json.optString("subid");
@@ -3720,7 +3720,7 @@ protected void commonAction(String value, int groupIndex,int itemIndex,JSONObjec
             JSONObject section_json = null;
             JSONObject item_json = content_data_control.optJSONArray(group).optJSONObject(child);
 
-            int refresh = item_json.optInt("refresh");
+            boolean refresh = item_json.optBoolean("refresh");
             boolean discardDirty = item_json.optBoolean("discarddirty");
             String refresh_trigger = item_json.optString("name");
             String subid = item_json.optString("subid");
@@ -3762,7 +3762,7 @@ protected void commonAction(String value, int groupIndex,int itemIndex,JSONObjec
 
                 adapter.notifyDataSetChanged();
 
-                if (refresh == 1) {
+                if (refresh) {
                     refresh(refresh_trigger,discardDirty);
                 }
 
@@ -3885,7 +3885,7 @@ protected void commonAction(String value, int groupIndex,int itemIndex,JSONObjec
 //                    e.printStackTrace();
 //                }
 //
-//                if (refresh == 1) {
+//                if (refresh) {
 //                    refresh(refresh_trigger,discardDirty);
 //                    return;
 //                }
@@ -4301,11 +4301,11 @@ protected void commonAction(String value, int groupIndex,int itemIndex,JSONObjec
                 content_data_download.put("section_" + group,section_json);
                 content_data_control = translateChange(content_data_download,changed_data);
 
-                int refresh = item_json.optInt("refresh");
+                boolean refresh = item_json.optBoolean("refresh");
                 boolean discardDirty = item_json.optBoolean("discarddirty");
                 JSONObject restore_json = item_json.optJSONObject("restore");
                 boolean partial_refresh = item_json.optBoolean("partial_refresh");
-                if (refresh == 1) {
+                if (refresh) {
 
                     if (restore_json != null) {
                         int rc = restore_json.optInt("count");
@@ -4328,7 +4328,7 @@ protected void commonAction(String value, int groupIndex,int itemIndex,JSONObjec
                     }
                     refresh(refresh_trigger,discardDirty);
 
-                } // refresh == 1
+                } // refresh
                 else if (partial_refresh) {
 
                     String name = item_json.optString("name");
@@ -4399,11 +4399,11 @@ protected void commonAction(String value, int groupIndex,int itemIndex,JSONObjec
                 content_data_download.put("section_" + group,section_json);
                 content_data_control = translateChange(content_data_download,changed_data);
 
-                int refresh = item_json.optInt("refresh");
+                boolean refresh = item_json.optBoolean("refresh");
                 boolean discardDirty = item_json.optBoolean("discarddirty");
                 JSONObject restore_json = item_json.optJSONObject("restore");
                 boolean partial_refresh = item_json.optBoolean("partial_refresh");
-                if (refresh == 1) {
+                if (refresh) {
 
                     if (restore_json != null) {
                         int rc = restore_json.optInt("count");
@@ -4426,7 +4426,7 @@ protected void commonAction(String value, int groupIndex,int itemIndex,JSONObjec
                     }
                     refresh(refresh_trigger,discardDirty);
 
-                } // refresh == 1
+                } // refresh
                 else if (partial_refresh) {
 
                     String name = item_json.getString("name");
@@ -4537,7 +4537,7 @@ protected void commonAction(String value, int groupIndex,int itemIndex,JSONObjec
             JSONObject section_json = null;
             JSONObject item_json = content_data_control.optJSONArray(group).optJSONObject(child);
 
-            int refresh = item_json.optInt("refresh");
+            boolean refresh = item_json.optBoolean("refresh");
             boolean discardDirty = item_json.optBoolean("discarddirty");
             String refresh_trigger = item_json.optString("name");
             String subid = item_json.optString("subid");
@@ -4573,7 +4573,7 @@ protected void commonAction(String value, int groupIndex,int itemIndex,JSONObjec
             content_data_control = translateChange(content_data_download,changed_data);
 
             JSONObject restore_json = item_json.optJSONObject("restore");
-            if (refresh == 1) {
+            if (refresh) {
                 if (restore_json != null) {
                     int rc = restore_json.optInt("count");
                     for(int ir=0;ir<rc;ir++) {

+ 4 - 4
ApexDrivers/ratradefiling/build.gradle

@@ -33,11 +33,11 @@ android {
         }
         debug {
             debuggable true
-            minifyEnabled true
-            zipAlignEnabled true
-            shrinkResources true
+//            minifyEnabled true
+//            zipAlignEnabled true
+//            shrinkResources true
 //
-            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-project.txt'
+//            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-project.txt'
 
         }
     }

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

@@ -83,7 +83,7 @@ public class OnlineDataProvider extends com.usai.redant.rautils.utils.Network
 
 
 	//DEBUG
-//	public static String		BASE_URL						= "http://192.168.0.149/ACE_ISF_NEW";
+//	public static String		BASE_URL						= "http://192.168.0.161/ACE_ISF_NEW";
 
 	//RELEASE
 	public static String		BASE_URL						= "https://ra.united-us.net/doc/bk";

+ 5 - 4
ApexDrivers/ratradefiling/src/main/java/com/usai/ratradefiling/home/HomeFragment.java

@@ -641,10 +641,11 @@ public class HomeFragment extends Fragment
             return;
         }
 
-        new AlertDialog.Builder(mCtx).setTitle(getString(R.string.warning))
-                .setMessage(msg)
-                .setPositiveButton(getString(R.string.btn_ok), null)
-                .show();
+        AlertDialog.Builder d=new AlertDialog.Builder(mCtx);
+                d.setTitle(getString(R.string.warning));
+                d.setMessage(msg);
+                d.setPositiveButton(getString(R.string.btn_ok), null);
+                d.show();;
     }
 
     private void changeData()