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;
}
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);
}
}
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();
}
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();
}
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;
}
Aggregations