RaoMeng 9 سال پیش
والد
کامیت
b9ae86e20a

+ 7 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/fragment/ContactFragment.java

@@ -50,6 +50,8 @@ import com.xzjmyk.pm.activity.ui.message.NewFriendActivity;
 import com.xzjmyk.pm.activity.ui.nearby.UserSearchActivity;
 import com.xzjmyk.pm.activity.ui.tool.ThreadPool;
 import com.xzjmyk.pm.activity.view.ClearEditText;
+import com.xzjmyk.pm.activity.view.crouton.Crouton;
+import com.xzjmyk.pm.activity.view.crouton.Style;
 import com.yalantis.phoenix.PullToRefreshView;
 
 import java.text.ParseException;
@@ -94,6 +96,11 @@ public class ContactFragment extends EasyFragment implements View.OnClickListene
                     writeData(msg);
                     loadDataInThread();
                     break;
+                case Constants.APP_SOCKETIMEOUTEXCEPTION:
+                    Crouton.makeText(getActivity(),msg.getData().getString("result"), Style.holoRedLight,2000);
+                    loadDataInThread();
+                    break;
+
             }
         }
     };

+ 15 - 12
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/util/LogUtil.java

@@ -75,20 +75,23 @@ public class LogUtil {
 	}
 	
 	public static void prinlnLongMsg(String TAG,String responseInfo){
-		if (responseInfo.length() >=3000) {
-			Log.v(TAG, "sb.length = " + responseInfo.length());
-			int chunkCount = responseInfo.length() / 3000;     // integer division
-			for (int i = 0; i <= chunkCount; i++) {
-				int max = 3000 * (i + 1);
-				if (max >= responseInfo.length()) {
-					Log.v(TAG, "【chunk " + i + " of " + chunkCount + "】:" + responseInfo.substring(3000 * i));
-				} else {
-					Log.v(TAG, "【chunk " + i + " of " + chunkCount + "】:" + responseInfo.substring(3000 * i, max));
+		if (responseInfo != null){
+			if (responseInfo.length() >=3000) {
+				Log.v(TAG, "sb.length = " + responseInfo.length());
+				int chunkCount = responseInfo.length() / 3000;     // integer division
+				for (int i = 0; i <= chunkCount; i++) {
+					int max = 3000 * (i + 1);
+					if (max >= responseInfo.length()) {
+						Log.v(TAG, "【chunk " + i + " of " + chunkCount + "】:" + responseInfo.substring(3000 * i));
+					} else {
+						Log.v(TAG, "【chunk " + i + " of " + chunkCount + "】:" + responseInfo.substring(3000 * i, max));
+					}
 				}
+			} else {
+				Log.v(TAG, "sb.length = " + responseInfo.length());
+				Log.v(TAG, responseInfo.toString());
 			}
-		} else {
-			Log.v(TAG, "sb.length = " + responseInfo.length());
-			Log.v(TAG, responseInfo.toString());
 		}
+
 	}
 }

+ 4 - 0
library-refreshlayout/src/main/java/com/yalantis/phoenix/PullToRefreshView.java

@@ -154,6 +154,7 @@ public class PullToRefreshView extends ViewGroup {
                 }
                 mInitialMotionY = initialMotionY;
                 break;
+
             case MotionEvent.ACTION_MOVE:
                 if (mActivePointerId == INVALID_POINTER) {
                     return false;
@@ -230,6 +231,9 @@ public class PullToRefreshView extends ViewGroup {
                     return false;
                 }
                 final int pointerIndex = MotionEventCompat.findPointerIndex(ev, mActivePointerId);
+                if (pointerIndex == -1){
+                    return false;
+                }
                 final float y = MotionEventCompat.getY(ev, pointerIndex);
                 final float overScrollTop = (y - mInitialMotionY) * DRAG_RATE;
                 mIsBeingDragged = false;

+ 1 - 1
library-refreshlayout/src/main/java/com/yalantis/phoenix/refresh_view/SunRefreshView.java

@@ -221,7 +221,7 @@ public class SunRefreshView extends BaseRefreshView implements Animatable {
 
     }
 
-    public static int sp2px(Context context, float spValue) {
+    public int sp2px(Context context, float spValue) {
         final float fontScale = context.getResources().getDisplayMetrics().scaledDensity;
         return (int) (spValue * fontScale + 0.5f);
     }