use of org.edx.mobile.http.notifications.FullScreenErrorNotification in project edx-app-android by edx.
the class OldMyCoursesListFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
binding = DataBindingUtil.inflate(inflater, R.layout.fragment_my_courses_list, container, false);
errorNotification = new FullScreenErrorNotification(binding.myCourseList);
snackbarErrorNotification = new SnackbarErrorNotification(binding.getRoot());
binding.swipeContainer.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
// Hide the progress bar as swipe layout has its own progress indicator
binding.loadingIndicator.getRoot().setVisibility(View.GONE);
errorNotification.hideError();
loadData(false);
}
});
binding.swipeContainer.setColorSchemeResources(R.color.edx_brand_primary_accent, R.color.edx_brand_gray_x_back, R.color.edx_brand_gray_x_back, R.color.edx_brand_gray_x_back);
if (environment.getConfig().getCourseDiscoveryConfig().isCourseDiscoveryEnabled()) {
// As per docs, the footer needs to be added before adapter is set to the ListView
addFindCoursesFooter();
}
// Add empty views to cause dividers to render at the top and bottom of the list
binding.myCourseList.addHeaderView(new View(getContext()), null, false);
binding.myCourseList.addFooterView(new View(getContext()), null, false);
binding.myCourseList.setAdapter(adapter);
binding.myCourseList.setOnItemClickListener(adapter);
return binding.getRoot();
}
Aggregations