RecyclerRefresh icon indicating copy to clipboard operation
RecyclerRefresh copied to clipboard

初始数据getData()个数太少时,再次刷新不会删除footer

Open WaylanPunch opened this issue 8 years ago • 2 comments

例如i < 2

    /**
     * 获取测试数据
     */
    private void getData() {
        for (int i = 0; i < 2; i++) {
            Map<String, Object> map = new HashMap<>();
            data.add(map);
        }
        adapter.notifyDataSetChanged();
        swipeRefreshLayout.setRefreshing(false);
        adapter.notifyItemRemoved(adapter.getItemCount());
    }

WaylanPunch avatar Apr 24 '16 16:04 WaylanPunch

@WaylanPunch @leoleohan 确实有这个问题,Google了一下,还是没弄明白。比如i < 2,为啥刷新的时候notifyItemRemoved无效,但是刚进入页面的时候notifyItemRemoved有效的 :|

w4mxl avatar Jul 14 '16 07:07 w4mxl

应该加个判断,让数据超出屏幕才对footer进行操作

lijie815917 avatar Nov 03 '16 01:11 lijie815917