客户端下拉刷新后,刷新结果未返回顶部

chengzhenyu 8 年之前
父节点
当前提交
738a3d91a4
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      app/src/main/java/ai/pai/client/adapter/RecentPhotoStaggeredAdapter.java

+ 5 - 1
app/src/main/java/ai/pai/client/adapter/RecentPhotoStaggeredAdapter.java

@@ -50,7 +50,11 @@ public class RecentPhotoStaggeredAdapter extends RecyclerView.Adapter<RecentPhot
50 50
     public synchronized void addPhotoList(ArrayList<GroupPhotoItem> photoList){
51 51
         int startPosition = this.photoList.size();
52 52
         this.photoList.addAll(photoList);
53
-        notifyItemRangeInserted(startPosition,photoList.size());
53
+        if(startPosition==0){
54
+            notifyDataSetChanged();
55
+        }else{
56
+            notifyItemRangeInserted(startPosition,photoList.size());
57
+        }
54 58
     }
55 59
 
56 60
     public ArrayList<GroupPhotoItem> getPhotoList(){