|
|
@@ -179,7 +179,8 @@ public class MainFragment extends FragmentBase<MainPresenter> implements IMainVi
|
|
|
|
|
|
@Override
|
|
|
protected void defineActionBar(ActionBarHelper actionBarHelper) {
|
|
|
- actionBarHelper.begin().logo()
|
|
|
+ actionBarHelper.begin()
|
|
|
+ .logo(actionBar -> presenter.onNavigationClickLogo(actionBar))
|
|
|
.menu(actionBar -> presenter.onNavigationClickMenu(actionBar))
|
|
|
.search(actionBar -> presenter.onNavigationClickSearch(actionBar))
|
|
|
.scroll()
|
|
|
@@ -210,13 +211,18 @@ public class MainFragment extends FragmentBase<MainPresenter> implements IMainVi
|
|
|
@Override
|
|
|
public void drawContents(ArrayList<MainContentsBean> data) {
|
|
|
|
|
|
- adapter = new MainContentsAdapter(getContext(), data, event -> {
|
|
|
- presenter.onEvent(event);
|
|
|
- });
|
|
|
- contentsRecyclerView.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
|
|
- contentsRecyclerView.setAdapter(adapter);
|
|
|
- contentsRecyclerView.addOnScrollListener(scrollListener);
|
|
|
- contentsRecyclerView.addItemDecoration(new PagerIndicatorDecoration(getContext()));
|
|
|
+ if (null == adapter) {
|
|
|
+ adapter = new MainContentsAdapter(getContext(), data, event -> {
|
|
|
+ presenter.onEvent(event);
|
|
|
+ });
|
|
|
+ contentsRecyclerView.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
|
|
+ contentsRecyclerView.setAdapter(adapter);
|
|
|
+ contentsRecyclerView.addOnScrollListener(scrollListener);
|
|
|
+ contentsRecyclerView.addItemDecoration(new PagerIndicatorDecoration(getContext()));
|
|
|
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ adapter.update(data);
|
|
|
+ }
|
|
|
}
|
|
|
}
|