Ver código fonte

Merge branch 'developer' of https://gitlab.com/Arisono/SkWeiChat-Baidu into fix_bug

# Conflicts:
#	WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessDetailInfoActivity.java
Arison 9 anos atrás
pai
commit
19068ec360

+ 4 - 2
WeiChat/src/main/java/com/xzjmyk/pm/activity/CustomCrashActivity.java

@@ -8,6 +8,8 @@ import android.view.View;
 import android.widget.Button;
 import android.widget.ImageView;
 
+import com.afollestad.materialdialogs.MaterialDialog;
+
 import cat.ereza.customactivityoncrash.CustomActivityOnCrash;
 
 /**
@@ -33,8 +35,8 @@ public class CustomCrashActivity extends Activity {
         stackTraceString = CustomActivityOnCrash.getAllErrorDetailsFromIntent(this,intent);
         if (stackTraceString != null){
             //Toast.makeText(this, stackTraceString, Toast.LENGTH_LONG).show();
-//            new MaterialDialog.Builder(this).content(stackTraceString)
-//                    .build().show();
+            new MaterialDialog.Builder(this).content(stackTraceString)
+                    .build().show();
         }
         final Class<? extends Activity> activityClassFromIntent = CustomActivityOnCrash.getRestartActivityClassFromIntent(intent);
         final CustomActivityOnCrash.EventListener listenerFromIntent = CustomActivityOnCrash.getEventListenerFromIntent(intent);

+ 49 - 40
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessDetailInfoActivity.java

@@ -2,6 +2,7 @@ package com.xzjmyk.pm.activity.ui.erp.activity.crm;
 
 import android.content.Context;
 import android.content.Intent;
+import android.content.res.Resources;
 import android.graphics.drawable.BitmapDrawable;
 import android.os.Bundle;
 import android.os.Handler;
@@ -473,32 +474,36 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
                     progressDialog.dismiss();
                     Log.i(TAG, "handleMessage:" + msg.getData().getString("result"));
                     String json = msg.getData().getString("result");
-                    JSONArray array = JSON.parseObject(json).getJSONArray("stages");
-                    labels=new String[array.size()];
-                    if (!array.isEmpty()) {
-                        for (int i = 0; i < array.size(); i++) {
-                          //  lists.add(array.getJSONObject(i).getString("BS_NAME"));
-                            labels[i]=array.getJSONObject(i).getString("BS_NAME");
+                    try {
+                        JSONArray array = JSON.parseObject(json).getJSONArray("stages");
+                        labels=new String[array.size()];
+                        if (!array.isEmpty()) {
+                            for (int i = 0; i < array.size(); i++) {
+                              //  lists.add(array.getJSONObject(i).getString("BS_NAME"));
+                                labels[i]=array.getJSONObject(i).getString("BS_NAME");
+                            }
                         }
-                    }
 
-                    if (labels!=null){
-                        int position=0;
-                        for (int i=0;i<labels.length;i++){
-                            if (labels[i].equals(bc_currentprocess.getText().toString())){
-                                position=i;
+                        if (labels!=null){
+                            int position=0;
+                            for (int i=0;i<labels.length;i++){
+                                if (labels[i].equals(bc_currentprocess.getText().toString())){
+                                    position=i;
+                                }
                             }
+                            LogUtil.d(JSON.toJSONString(labels));
+                            LogUtil.d(JSON.toJSONString(position));
+                            LogUtil.d(bc_currentprocess.getText().toString());
+                            mStepsView.setCompletedPosition(position%labels.length)
+                                    .setLabels(labels)
+                                    .setBarColorIndicator(
+                                            ct.getResources().getColor(R.color.light_gray))
+                                    .setProgressColorIndicator(ct.getResources().getColor(R.color.orange))
+                                    .setLabelColorIndicator(ct.getResources().getColor(R.color.orange))
+                                    .drawView();
                         }
-                        LogUtil.d(JSON.toJSONString(labels));
-                        LogUtil.d(JSON.toJSONString(position));
-                        LogUtil.d(bc_currentprocess.getText().toString());
-                        mStepsView.setCompletedPosition(position%labels.length)
-                                .setLabels(labels)
-                                .setBarColorIndicator(
-                                        ct.getResources().getColor(R.color.light_gray))
-                                .setProgressColorIndicator(ct.getResources().getColor(R.color.orange))
-                                .setLabelColorIndicator(ct.getResources().getColor(R.color.orange))
-                                .drawView();
+                    } catch (Resources.NotFoundException e) {
+                        e.printStackTrace();
                     }
                     break;
                 case LOAD_STAGEPOINT:
@@ -506,24 +511,28 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
                      Log.i(TAG, "handleMessage:" + msg.getData().getString("result"));
                      json = msg.getData().getString("result");
                      LogUtil.d(JSON.toJSONString(json));
-                     JSONArray data=JSON.parseObject(json).getJSONArray("data");
-                     int size=data.size();
-                     List<SimpleData> simpleDatas=new ArrayList<>();
-                     JSONArray value=data.getJSONObject(0).getJSONArray("value");
-                     for (int j=0;j<value.size();j++){
-                         for(int i=0;i<data.size();i++){
-                             SimpleData simpleData=new SimpleData();
-                             simpleData.setLeft(data.getJSONObject(i).getString("caption"));
-                             simpleData.setRight(data.getJSONObject(i).getJSONArray("value").get(j).toString());
-                             simpleData.setGroupId(j);
-                             simpleDatas.add(simpleData);
-                         }
-                     }
-
-                    mAapter=new StickyListAdapter(mContext,simpleDatas);
-                    mList.setAdapter(mAapter);
-                    
-                    
+                    try {
+                        JSONArray data=JSON.parseObject(json).getJSONArray("data");
+                        int size=data.size();
+                        List<SimpleData> simpleDatas=new ArrayList<>();
+                        JSONArray value=data.getJSONObject(0).getJSONArray("value");
+                        for (int j=0;j<value.size();j++){
+                            for(int i=0;i<data.size();i++){
+                                SimpleData simpleData=new SimpleData();
+                                simpleData.setLeft(data.getJSONObject(i).getString("caption"));
+                                simpleData.setRight(data.getJSONObject(i).getJSONArray("value").get(j).toString());
+                                simpleData.setGroupId(j);
+                                simpleDatas.add(simpleData);
+                            }
+                        }
+
+                        mAapter=new StickyListAdapter(mContext,simpleDatas);
+                        mList.setAdapter(mAapter);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+
+
                     break;
             }
         }