Search in sources :

Example 1 with FullScreenErrorNotification

use of org.edx.mobile.http.notifications.FullScreenErrorNotification in project edx-app-android by edx.

the class MyCoursesListFragment 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);
    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) SwipeRefreshLayout(android.support.v4.widget.SwipeRefreshLayout) View(android.view.View)

Example 2 with FullScreenErrorNotification

use of org.edx.mobile.http.notifications.FullScreenErrorNotification in project edx-app-android by edx.

the class BaseWebViewDiscoverFragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    webView = (EdxWebView) view.findViewById(R.id.webview);
    progressWheel = (ProgressBar) view.findViewById(R.id.loading_indicator);
    errorNotification = new FullScreenErrorNotification(webView);
    initWebView();
}
Also used : FullScreenErrorNotification(org.edx.mobile.http.notifications.FullScreenErrorNotification)

Example 3 with FullScreenErrorNotification

use of org.edx.mobile.http.notifications.FullScreenErrorNotification in project edx-app-android by edx.

the class CourseBaseActivity method onCreate.

@Override
protected void onCreate(Bundle arg0) {
    super.onCreate(arg0);
    super.setToolbarAsActionBar();
    errorNotification = new FullScreenErrorNotification(contentLayout);
    snackbarErrorNotification = new SnackbarErrorNotification(contentLayout);
    Bundle bundle = arg0;
    if (bundle == null) {
        if (getIntent() != null)
            bundle = getIntent().getBundleExtra(Router.EXTRA_BUNDLE);
    }
    restore(bundle);
    blockDrawerFromOpening();
}
Also used : FullScreenErrorNotification(org.edx.mobile.http.notifications.FullScreenErrorNotification) SnackbarErrorNotification(org.edx.mobile.http.notifications.SnackbarErrorNotification) Bundle(android.os.Bundle)

Example 4 with FullScreenErrorNotification

use of org.edx.mobile.http.notifications.FullScreenErrorNotification in project edx-app-android by edx.

the class AuthenticatedWebView method init.

private void init() {
    inflate(getContext(), R.layout.authenticated_webview, this);
    RoboGuice.injectMembers(getContext(), this);
    RoboGuice.getInjector(getContext()).injectViewMembers(this);
    fullScreenErrorNotification = new FullScreenErrorNotification(webView);
}
Also used : FullScreenErrorNotification(org.edx.mobile.http.notifications.FullScreenErrorNotification)

Example 5 with FullScreenErrorNotification

use of org.edx.mobile.http.notifications.FullScreenErrorNotification in project edx-app-android by edx.

the class CourseCombinedInfoFragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    errorNotification = new FullScreenErrorNotification(announcementWebView);
    snackbarErrorNotification = new SnackbarErrorNotification(announcementWebView);
}
Also used : FullScreenErrorNotification(org.edx.mobile.http.notifications.FullScreenErrorNotification) SnackbarErrorNotification(org.edx.mobile.http.notifications.SnackbarErrorNotification)

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