Search in sources :

Example 6 with FullScreenErrorNotification

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

the class CourseDiscussionPostsThreadFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final View view = inflater.inflate(R.layout.fragment_discussion_thread_posts, container, false);
    // Initializing errorNotification here, so that its non-null value can be used in the parent class's `onViewCreated` callback
    errorNotification = new FullScreenErrorNotification(view.findViewById(R.id.content));
    return view;
}
Also used : FullScreenErrorNotification(org.edx.mobile.http.notifications.FullScreenErrorNotification) View(android.view.View) AdapterView(android.widget.AdapterView) InjectView(roboguice.inject.InjectView) TextView(android.widget.TextView) Nullable(android.support.annotation.Nullable)

Example 7 with FullScreenErrorNotification

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

the class BaseWebViewFindCoursesActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    super.setToolbarAsActionBar();
    webView = (EdxWebView) findViewById(R.id.webview);
    progressWheel = (ProgressBar) findViewById(R.id.loading_indicator);
    errorNotification = new FullScreenErrorNotification(webView);
    webView.getSettings().setDomStorageEnabled(true);
    setupWebView();
    enableEnrollCallback();
    if (null != savedInstanceState) {
        lastClickEnrollCourseId = savedInstanceState.getString(INSTANCE_COURSE_ID);
        lastClickEnrollEmailOptIn = savedInstanceState.getBoolean(INSTANCE_EMAIL_OPT_IN);
    }
}
Also used : FullScreenErrorNotification(org.edx.mobile.http.notifications.FullScreenErrorNotification)

Example 8 with FullScreenErrorNotification

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

the class CourseDiscussionTopicsFragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    errorNotification = new FullScreenErrorNotification((View) discussionTopicsListView.getParent());
    final LayoutInflater inflater = LayoutInflater.from(getActivity());
    // Add "All posts" item
    {
        final TextView header = (TextView) inflater.inflate(R.layout.row_discussion_topic, discussionTopicsListView, false);
        header.setText(R.string.discussion_posts_filter_all_posts);
        final DiscussionTopic discussionTopic = new DiscussionTopic();
        discussionTopic.setIdentifier(DiscussionTopic.ALL_TOPICS_ID);
        discussionTopic.setName(getString(R.string.discussion_posts_filter_all_posts));
        discussionTopicsListView.addHeaderView(header, new DiscussionTopicDepth(discussionTopic, 0, true), true);
    }
    // Add "Posts I'm following" item
    {
        final TextView header = (TextView) inflater.inflate(R.layout.row_discussion_topic, discussionTopicsListView, false);
        header.setText(R.string.forum_post_i_am_following);
        Context context = getActivity();
        TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(header, new IconDrawable(context, FontAwesomeIcons.fa_star).colorRes(context, R.color.edx_brand_gray_base).sizeRes(context, R.dimen.edx_base), null, null, null);
        final DiscussionTopic discussionTopic = new DiscussionTopic();
        discussionTopic.setIdentifier(DiscussionTopic.FOLLOWING_TOPICS_ID);
        discussionTopic.setName(getString(R.string.forum_post_i_am_following));
        discussionTopicsListView.addHeaderView(header, new DiscussionTopicDepth(discussionTopic, 0, true), true);
    }
    discussionTopicsListView.setAdapter(discussionTopicsAdapter);
    discussionTopicsSearchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {

        @Override
        public boolean onQueryTextSubmit(String query) {
            if (query == null || query.trim().isEmpty())
                return false;
            router.showCourseDiscussionPostsForSearchQuery(getActivity(), query, courseData);
            return true;
        }

        @Override
        public boolean onQueryTextChange(String newText) {
            return false;
        }
    });
    discussionTopicsListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            router.showCourseDiscussionPostsForDiscussionTopic(getActivity(), ((DiscussionTopicDepth) parent.getItemAtPosition(position)).getDiscussionTopic(), courseData);
        }
    });
    getTopicList();
}
Also used : Context(android.content.Context) View(android.view.View) AdapterView(android.widget.AdapterView) SearchView(android.widget.SearchView) InjectView(roboguice.inject.InjectView) TextView(android.widget.TextView) ListView(android.widget.ListView) DiscussionTopic(org.edx.mobile.discussion.DiscussionTopic) DiscussionTopicDepth(org.edx.mobile.discussion.DiscussionTopicDepth) FullScreenErrorNotification(org.edx.mobile.http.notifications.FullScreenErrorNotification) SearchView(android.widget.SearchView) LayoutInflater(android.view.LayoutInflater) IconDrawable(com.joanzapata.iconify.IconDrawable) TextView(android.widget.TextView) AdapterView(android.widget.AdapterView)

Example 9 with FullScreenErrorNotification

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

the class CourseHandoutFragment method onViewCreated.

@SuppressLint("SetJavaScriptEnabled")
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    errorNotification = new FullScreenErrorNotification(webview);
    snackbarErrorNotification = new SnackbarErrorNotification(webview);
    new URLInterceptorWebViewClient(getActivity(), webview).setAllLinksAsExternal(true);
    loadData();
}
Also used : FullScreenErrorNotification(org.edx.mobile.http.notifications.FullScreenErrorNotification) SnackbarErrorNotification(org.edx.mobile.http.notifications.SnackbarErrorNotification) URLInterceptorWebViewClient(org.edx.mobile.view.custom.URLInterceptorWebViewClient) SuppressLint(android.annotation.SuppressLint)

Example 10 with FullScreenErrorNotification

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

the class NewCourseOutlineFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final Bundle bundle;
    {
        if (savedInstanceState != null) {
            bundle = savedInstanceState;
        } else {
            bundle = getArguments();
        }
    }
    final View view = inflater.inflate(R.layout.fragment_course_outline_new, container, false);
    listView = (ListView) view.findViewById(R.id.outline_list);
    errorNotification = new FullScreenErrorNotification(listView);
    loadingIndicator = view.findViewById(R.id.loading_indicator);
    restore(bundle);
    initListView(view);
    fetchCourseComponent();
    return view;
}
Also used : FullScreenErrorNotification(org.edx.mobile.http.notifications.FullScreenErrorNotification) Bundle(android.os.Bundle) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView) IconImageView(com.joanzapata.iconify.widget.IconImageView)

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