Search in sources :

Example 1 with OfficialWebViewClient

use of org.sitcon.ccip.network.webclient.OfficialWebViewClient in project CCIP-Android by CCIP-App.

the class StaffFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    View view = inflater.inflate(R.layout.fragment_web, container, false);
    progressBar = (ProgressBar) view.findViewById(R.id.progressBar);
    webView = (WebView) view.findViewById(R.id.webView);
    webView.setWebChromeClient(new WebChromeViewClient(progressBar));
    webView.setWebViewClient(new OfficialWebViewClient());
    webView.loadUrl(URL_STAFFS);
    WebSettings settings = webView.getSettings();
    settings.setJavaScriptEnabled(true);
    settings.setDomStorageEnabled(true);
    if (Build.VERSION.SDK_INT >= 21) {
        settings.setMixedContentMode(WebSettings.MIXED_CONTENT_COMPATIBILITY_MODE);
    }
    return view;
}
Also used : WebChromeViewClient(org.sitcon.ccip.network.webclient.WebChromeViewClient) OfficialWebViewClient(org.sitcon.ccip.network.webclient.OfficialWebViewClient) WebSettings(android.webkit.WebSettings) View(android.view.View) WebView(android.webkit.WebView) Nullable(android.support.annotation.Nullable)

Example 2 with OfficialWebViewClient

use of org.sitcon.ccip.network.webclient.OfficialWebViewClient in project CCIP-Android by CCIP-App.

the class SponsorFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    View view = inflater.inflate(R.layout.fragment_web, container, false);
    progressBar = (ProgressBar) view.findViewById(R.id.progressBar);
    webView = (WebView) view.findViewById(R.id.webView);
    webView.setWebChromeClient(new WebChromeViewClient(progressBar));
    webView.setWebViewClient(new OfficialWebViewClient());
    webView.loadUrl(URL_SPONSORS);
    WebSettings settings = webView.getSettings();
    settings.setJavaScriptEnabled(true);
    settings.setDomStorageEnabled(true);
    if (Build.VERSION.SDK_INT >= 21) {
        settings.setMixedContentMode(WebSettings.MIXED_CONTENT_COMPATIBILITY_MODE);
    }
    return view;
}
Also used : WebChromeViewClient(org.sitcon.ccip.network.webclient.WebChromeViewClient) OfficialWebViewClient(org.sitcon.ccip.network.webclient.OfficialWebViewClient) WebSettings(android.webkit.WebSettings) View(android.view.View) WebView(android.webkit.WebView) Nullable(android.support.annotation.Nullable)

Example 3 with OfficialWebViewClient

use of org.sitcon.ccip.network.webclient.OfficialWebViewClient in project CCIP-Android by CCIP-App.

the class VenueFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    View view = inflater.inflate(R.layout.fragment_web, container, false);
    progressBar = (ProgressBar) view.findViewById(R.id.progressBar);
    webView = (WebView) view.findViewById(R.id.webView);
    webView.setWebChromeClient(new WebChromeViewClient(progressBar));
    webView.setWebViewClient(new OfficialWebViewClient());
    webView.loadUrl(URL_SPONSORS);
    WebSettings settings = webView.getSettings();
    settings.setJavaScriptEnabled(true);
    settings.setDomStorageEnabled(true);
    if (Build.VERSION.SDK_INT >= 21) {
        settings.setMixedContentMode(WebSettings.MIXED_CONTENT_COMPATIBILITY_MODE);
    }
    return view;
}
Also used : WebChromeViewClient(org.sitcon.ccip.network.webclient.WebChromeViewClient) OfficialWebViewClient(org.sitcon.ccip.network.webclient.OfficialWebViewClient) WebSettings(android.webkit.WebSettings) View(android.view.View) WebView(android.webkit.WebView) Nullable(android.support.annotation.Nullable)

Aggregations

Nullable (android.support.annotation.Nullable)3 View (android.view.View)3 WebSettings (android.webkit.WebSettings)3 WebView (android.webkit.WebView)3 OfficialWebViewClient (org.sitcon.ccip.network.webclient.OfficialWebViewClient)3 WebChromeViewClient (org.sitcon.ccip.network.webclient.WebChromeViewClient)3