Search in sources :

Example 1 with EdxWebView

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;
}
Also used : View(android.view.View) EdxWebView(org.edx.mobile.view.custom.EdxWebView) LikeView(com.facebook.widget.LikeView) URLInterceptorWebViewClient(org.edx.mobile.view.custom.URLInterceptorWebViewClient)

Example 2 with EdxWebView

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);
}
Also used : ViewGroup(android.view.ViewGroup) LayoutInflater(android.view.LayoutInflater) ImageView(android.widget.ImageView) View(android.view.View) EdxWebView(org.edx.mobile.view.custom.EdxWebView) IconImageView(com.joanzapata.iconify.widget.IconImageView) TextView(android.widget.TextView)

Aggregations

View (android.view.View)2 EdxWebView (org.edx.mobile.view.custom.EdxWebView)2 LayoutInflater (android.view.LayoutInflater)1 ViewGroup (android.view.ViewGroup)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 LikeView (com.facebook.widget.LikeView)1 IconImageView (com.joanzapata.iconify.widget.IconImageView)1 URLInterceptorWebViewClient (org.edx.mobile.view.custom.URLInterceptorWebViewClient)1