@Override public void onDataLoad(MangaListLoader.MangaLists mangaLists) { Log.d( LOG_TAG, "data" + (mangaLists.getMangaItems() == null ? 0 : mangaLists.getMangaItems().size())); if (getContext() != null) mangaListAdapter.swapData( mangaLists.getMangaItems(), Utilities.getCurrentSource(getContext())); latestListAdapter.swapData(mangaLists.getLatestMangaItems()); popularListAdapter.swapData(mangaLists.getPopularMangaItems()); }
@Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); progressBar = (SmoothProgressBar) view.findViewById(R.id.progress); viewPager = (ViewPager) view.findViewById(R.id.pager); viewPager.setAdapter(new ListPagerAdapter(this, getActivity())); TabLayout tabLayout = ((BaseActivity) getActivity()).getTabs(); tabLayout.setupWithViewPager(viewPager); mangaListAdapter = new MangaListAdapter(); mangaListAdapter.setClickCallback(this); latestListAdapter = new MangaLatestListAdapter(); latestListAdapter.setClickCallback(this); popularListAdapter = new MangaPopularListAdapter(); popularListAdapter.setClickCallback(this); }