use of org.edx.mobile.view.custom.EdxWebView in project edx-app-android by edx.
the class CourseCombinedInfoFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_course_combined_info, container, false);
announcementWebView = (EdxWebView) view.findViewById(R.id.announcement_webview);
URLInterceptorWebViewClient client = new URLInterceptorWebViewClient(getActivity(), announcementWebView);
// treat every link as external link in this view, so that all links will open in external browser
client.setAllLinksAsExternal(true);
notificationSettingRow = view.findViewById(R.id.notification_setting_row);
notificationSwitch = (Switch) view.findViewById(R.id.notification_switch);
return view;
}
use of org.edx.mobile.view.custom.EdxWebView in project edx-app-android by edx.
the class CourseDetailFragment method onViewCreated.
/**
* Populates the course details.
* Creates and populates the short description if given,
* Creates and populates fields such as "effort", "duration" if any. This is handled on a case
* by case basis rather than using a list view.
* Sets the view for About this Course which is retrieved in a later api call.
*/
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
// Short Description
final LayoutInflater inflater = LayoutInflater.from(getActivity());
final View child = inflater.inflate(R.layout.fragment_course_detail, mCourseDetailLayout, false);
mShortDescription = (TextView) child.findViewById(R.id.course_detail_short_description);
if (courseDetail.short_description == null || courseDetail.short_description.isEmpty()) {
((ViewGroup) mShortDescription.getParent()).removeView(mShortDescription);
}
mCourseDetailLayout.addView(child);
// Enrollment Button
mEnrollButton = (Button) child.findViewById(R.id.button_enroll_now);
configureEnrollButton();
// Course Detail Fields - Each field will be created manually.
courseDetailFieldLayout = (LinearLayout) view.findViewById(R.id.course_detail_fields);
if (courseDetail.effort != null && !courseDetail.effort.isEmpty()) {
ViewHolder holder = createCourseDetailFieldViewHolder(inflater, mCourseDetailLayout);
holder.rowIcon.setIcon(FontAwesomeIcons.fa_dashboard);
holder.rowFieldName.setText(R.string.effort_field_name);
holder.rowFieldText.setText(courseDetail.effort);
}
// About this Course
courseAbout = (FrameLayout) view.findViewById(R.id.course_detail_course_about);
courseAboutWebView = (EdxWebView) courseAbout.findViewById(R.id.course_detail_course_about_webview);
}
Aggregations