Sfoglia il codice sorgente

通讯录页面刷新头卡住问题

RaoMeng 9 anni fa
parent
commit
658e36afc7

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

@@ -231,6 +231,12 @@ public class ContactFragment extends EasyFragment implements View.OnClickListene
         mcProgressDialog.show();
     }
 
+    @Override
+    public void onResume() {
+        super.onResume();
+        mPullToRefreshView.setRefreshing(false,false);
+    }
+
     /*设置头文件*/
     private void setHeaderView() {
         View headview = LayoutInflater.from(ct).inflate(R.layout.header_fragment_contact, null);

+ 14 - 3
library-refreshlayout/src/main/java/com/yalantis/phoenix/PullToRefreshView.java

@@ -6,6 +6,7 @@ import android.support.annotation.NonNull;
 import android.support.v4.view.MotionEventCompat;
 import android.support.v4.view.ViewCompat;
 import android.util.AttributeSet;
+import android.util.Log;
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewConfiguration;
@@ -145,6 +146,7 @@ public class PullToRefreshView extends ViewGroup {
 
         switch (action) {
             case MotionEvent.ACTION_DOWN:
+                Log.e("onTouchEvent: ", "ACTION_DOWN");
                 setTargetOffsetTop(0, true);
                 mActivePointerId = MotionEventCompat.getPointerId(ev, 0);
                 mIsBeingDragged = false;
@@ -156,6 +158,7 @@ public class PullToRefreshView extends ViewGroup {
                 break;
 
             case MotionEvent.ACTION_MOVE:
+                Log.e("onTouchEvent: ", "ACTION_MOVE");
                 if (mActivePointerId == INVALID_POINTER) {
                     return false;
                 }
@@ -169,11 +172,14 @@ public class PullToRefreshView extends ViewGroup {
                 }
                 break;
             case MotionEvent.ACTION_UP:
+                Log.e("onTouchEvent: ", "ACTION_UP");
             case MotionEvent.ACTION_CANCEL:
+                Log.e("onTouchEvent: ", "ACTION_CANCEL");
                 mIsBeingDragged = false;
                 mActivePointerId = INVALID_POINTER;
                 break;
             case MotionEventCompat.ACTION_POINTER_UP:
+                Log.e("onTouchEvent: ", "ACTION_POINTER_UP");
                 onSecondaryPointerUp(ev);
                 break;
         }
@@ -192,6 +198,7 @@ public class PullToRefreshView extends ViewGroup {
 
         switch (action) {
             case MotionEvent.ACTION_MOVE: {
+                Log.e("onTouchEvent: ", "ACTION_MOVE");
                 final int pointerIndex = MotionEventCompat.findPointerIndex(ev, mActivePointerId);
                 if (pointerIndex < 0) {
                     return false;
@@ -219,14 +226,18 @@ public class PullToRefreshView extends ViewGroup {
                 break;
             }
             case MotionEventCompat.ACTION_POINTER_DOWN:
+                Log.e("onTouchEvent: ", "ACTION_POINTER_DOWN");
                 final int index = MotionEventCompat.getActionIndex(ev);
                 mActivePointerId = MotionEventCompat.getPointerId(ev, index);
                 break;
             case MotionEventCompat.ACTION_POINTER_UP:
+                Log.e("onTouchEvent: ", "ACTION_POINTER_UP");
                 onSecondaryPointerUp(ev);
                 break;
             case MotionEvent.ACTION_UP:
+                Log.e("onTouchEvent: ", "ACTION_UP");
             case MotionEvent.ACTION_CANCEL: {
+                Log.e("onTouchEvent: ", "ACTION_CANCEL");
                 if (mActivePointerId == INVALID_POINTER) {
                     return false;
                 }
@@ -328,8 +339,8 @@ public class PullToRefreshView extends ViewGroup {
         }
     }
 
-    private void setRefreshing(boolean refreshing, final boolean notify) {
-        if (mRefreshing != refreshing) {
+    public void setRefreshing(boolean refreshing, final boolean notify) {
+//        if (mRefreshing != refreshing) {
             mNotify = notify;
             ensureTarget();
             mRefreshing = refreshing;
@@ -339,7 +350,7 @@ public class PullToRefreshView extends ViewGroup {
             } else {
                 animateOffsetToStartPosition();
             }
-        }
+//        }
     }
 
     private Animation.AnimationListener mToStartListener = new Animation.AnimationListener() {