package com.zhongqu.vrviewer.demojava;

import android.content.Context;
import android.view.View;
import android.webkit.WebView;

import com.zhongqu.vrviewer.ZQVRViewerManager;

public class MainActivity extends BaseViewerActivity {

    @Override
    protected View createViewerWebView(Context context) {
        return new WebView(context);
    }

    @Override
    protected void configureViewerWebView(View webView) {
        WebView wv = (WebView) webView;
        wv.getSettings().setJavaScriptEnabled(true);
        wv.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
        wv.getSettings().setDomStorageEnabled(true);
    }

    @Override
    protected void openViewerSdk(View webView) {
        ZQVRViewerManager.openViewer((WebView) webView);
    }

    @Override
    protected void loadUrlOnViewer(View webView, String url) {
        ((WebView) webView).loadUrl(url);
    }
}
