use of org.sitcon.ccip.network.webclient.WebChromeViewClient in project CCIP-Android by CCIP-App.
the class PuzzleFragment 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);
setHasOptionsMenu(true);
mActivity = getActivity();
progressBar = (ProgressBar) view.findViewById(R.id.progressBar);
webView = (WebView) view.findViewById(R.id.webView);
webView.setWebViewClient(new WebViewClient() {
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
super.onReceivedError(view, request, error);
view.loadUrl(URL_NO_NETWORK);
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.getContext().startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
return true;
}
});
webView.setWebChromeClient(new WebChromeViewClient(progressBar));
if (PreferenceUtil.getToken(getActivity()) != null) {
webView.loadUrl(URL_PUZZLE + PreferenceUtil.getToken(getActivity()));
} else {
webView.loadUrl("data:text/html, <div>Please login</div>");
}
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;
}
use of org.sitcon.ccip.network.webclient.WebChromeViewClient 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;
}
use of org.sitcon.ccip.network.webclient.WebChromeViewClient in project CCIP-Android by CCIP-App.
the class IRCFragment 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.setWebViewClient(new WebViewClient() {
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
super.onReceivedError(view, request, error);
view.loadUrl(URL_NO_NETWORK);
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.getContext().startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
return true;
}
});
webView.setWebChromeClient(new WebChromeViewClient(progressBar));
webView.loadUrl(URL_IRC);
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;
}
use of org.sitcon.ccip.network.webclient.WebChromeViewClient 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;
}
use of org.sitcon.ccip.network.webclient.WebChromeViewClient 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;
}
Aggregations