Search in sources :

Example 11 with FullScreenErrorNotification

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();
}
Also used : FullScreenErrorNotification(org.edx.mobile.http.notifications.FullScreenErrorNotification) SnackbarErrorNotification(org.edx.mobile.http.notifications.SnackbarErrorNotification) SwipeRefreshLayout(android.support.v4.widget.SwipeRefreshLayout) View(android.view.View)

Aggregations

FullScreenErrorNotification (org.edx.mobile.http.notifications.FullScreenErrorNotification)11 View (android.view.View)5 SnackbarErrorNotification (org.edx.mobile.http.notifications.SnackbarErrorNotification)4 AdapterView (android.widget.AdapterView)3 Bundle (android.os.Bundle)2 SwipeRefreshLayout (android.support.v4.widget.SwipeRefreshLayout)2 ListView (android.widget.ListView)2 TextView (android.widget.TextView)2 InjectView (roboguice.inject.InjectView)2 SuppressLint (android.annotation.SuppressLint)1 Context (android.content.Context)1 Nullable (android.support.annotation.Nullable)1 LayoutInflater (android.view.LayoutInflater)1 SearchView (android.widget.SearchView)1 IconDrawable (com.joanzapata.iconify.IconDrawable)1 IconImageView (com.joanzapata.iconify.widget.IconImageView)1 DiscussionTopic (org.edx.mobile.discussion.DiscussionTopic)1 DiscussionTopicDepth (org.edx.mobile.discussion.DiscussionTopicDepth)1 URLInterceptorWebViewClient (org.edx.mobile.view.custom.URLInterceptorWebViewClient)1