use of com.battlelancer.seriesguide.adapters.NowAdapter in project SeriesGuide by UweTrottmann.
the class ShowsNowFragment method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
Utils.setSwipeRefreshLayoutColors(getActivity().getTheme(), swipeRefreshLayout);
// define dataset
adapter = new NowAdapter(getActivity(), itemClickListener);
adapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {
@Override
public void onChanged() {
updateEmptyState();
}
@Override
public void onItemRangeInserted(int positionStart, int itemCount) {
updateEmptyState();
}
@Override
public void onItemRangeRemoved(int positionStart, int itemCount) {
updateEmptyState();
}
});
recyclerView.setAdapter(adapter);
// if connected to trakt, replace local history with trakt history, show friends history
if (TraktCredentials.get(getActivity()).hasCredentials()) {
isLoadingRecentlyWatched = true;
isLoadingFriends = true;
showProgressBar(true);
getLoaderManager().initLoader(ShowsActivity.NOW_TRAKT_USER_LOADER_ID, null, recentlyTraktCallbacks);
getLoaderManager().initLoader(ShowsActivity.NOW_TRAKT_FRIENDS_LOADER_ID, null, traktFriendsHistoryCallbacks);
}
setHasOptionsMenu(true);
}
Aggregations