package demo.mapi.ccv.eu.mapi_demo.activities.attended;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import demo.mapi.ccv.eu.mapi_demo.AndroidLogger;
import demo.mapi.ccv.eu.mapi_demo.R;
import eu.ccvlab.mapi.core.logging.MPALogging;

public class AttendedCertificationTestsWebViewFragment extends Fragment {
    WebView webView;

    public AttendedCertificationTestsWebViewFragment(){
        super(R.layout.attended_certification_tests_webview_fragment);
    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = super.onCreateView(inflater, container, savedInstanceState);
        webView = view.findViewById(R.id.browser);
        MPALogging.addLogger(new AndroidLogger("AttendedCertificationTestsWebViewFragment"));
        return view;
    }

    @Override
    public void onStart() {
        super.onStart();
        webView.loadUrl(requireArguments().getString("url"));
    }
}
