|
|
@@ -68,14 +68,18 @@ public class GoodsFragment extends BaseMVPFragment implements IGoodsView, ITopAc
|
|
|
@Override
|
|
|
public void onGoodsDataCome(List<GoodsBean> goodsList) {
|
|
|
// todo 分页或者刷新
|
|
|
- mGoodsList.clear();
|
|
|
- mGoodsList.addAll(goodsList);
|
|
|
- mAdapter.notifyDataSetChanged();
|
|
|
if (mCurrentPage == PAGE_START) {
|
|
|
+ mGoodsList.clear();
|
|
|
+ mGoodsList.addAll(goodsList);
|
|
|
+ mAdapter.notifyDataSetChanged();
|
|
|
// 如果是第0页数据,要与顶部对齐
|
|
|
// 或者用这个mLayoutManager.scrollToPositionWithOffset(0, 0);
|
|
|
rv_goods.smoothScrollToPosition(0);
|
|
|
+ } else {
|
|
|
+ mGoodsList.addAll(goodsList);
|
|
|
+ mAdapter.notifyDataSetChanged();
|
|
|
}
|
|
|
+
|
|
|
if (mGoodsList.size() == 0) {
|
|
|
iv_empty.setVisibility(View.VISIBLE);
|
|
|
} else {
|