本文整理汇总了Java中android.webkit.WebView.setVisibility方法的典型用法代码示例。如果您正苦于以下问题:Java WebView.setVisibility方法的具体用法?Java WebView.setVisibility怎么用?Java WebView.setVisibility使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.webkit.WebView
的用法示例。
在下文中一共展示了WebView.setVisibility方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.webkit.WebView; //导入方法依赖的package包/类
@Override
@SuppressLint("SetJavaScriptEnabled")
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_privacy_policy);
final WebView privacyPolicyWebView = (WebView)findViewById(R.id.privacypolicy);
privacyPolicyWebView.setVisibility(View.VISIBLE);
privacyPolicyWebView.getSettings().setJavaScriptEnabled(true);
privacyPolicyWebView.getSettings().setRenderPriority(RenderPriority.HIGH);
privacyPolicyWebView.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT);
privacyPolicyWebView.setWebViewClient(new WebViewClient() { });
privacyPolicyWebView.resumeTimers();
privacyPolicyWebView.loadUrl("http://www.soasta.com/privacy-policy");
}
示例2: onButtonRetryClicked
import android.webkit.WebView; //导入方法依赖的package包/类
public void onButtonRetryClicked(View v)
{
WebView webview = (WebView) findViewById(R.id.webViewTTNlogin);
webview.setVisibility(View.VISIBLE);
TextView textView = (TextView) findViewById(R.id.textViewStatus);
textView.setVisibility(View.GONE);
ProgressBar progressBar = (ProgressBar) findViewById(R.id.progressBarLogIn);
progressBar.setVisibility(View.GONE);
Button button = (Button) findViewById(R.id.buttonRetry);
button.setVisibility(View.GONE);
loadLoginPage();
}
示例3: setUpWebView
import android.webkit.WebView; //导入方法依赖的package包/类
@SuppressLint("SetJavaScriptEnabled")
private void setUpWebView(int margin) {
LinearLayout webViewContainer = new LinearLayout(getContext());
webView = new WebView(getContext());
webView.setVerticalScrollBarEnabled(false);
webView.setHorizontalScrollBarEnabled(false);
webView.setWebViewClient(new DialogWebViewClient());
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl(url);
webView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT));
webView.setVisibility(View.INVISIBLE);
webView.getSettings().setSavePassword(false);
webView.getSettings().setSaveFormData(false);
webViewContainer.setPadding(margin, margin, margin, margin);
webViewContainer.addView(webView);
webViewContainer.setBackgroundColor(BACKGROUND_GRAY);
contentFrameLayout.addView(webViewContainer);
}
示例4: onPageFinished
import android.webkit.WebView; //导入方法依赖的package包/类
public void onPageFinished(WebView view, String url) {
try {
String path = new URL(url).getPath();
LogInfo.log("ZSM onPageFinished path = " + path);
if (path.contains("checklogin")) {
LeResponseMessage response = LeMessageManager.getInstance().dispatchMessage(new LeMessage(LeMessageIds.MSG_WEBVIEW_COOKIE_SSO_TOKEN, url));
if (LeResponseMessage.checkResponseMessageValidity(response, String.class)) {
PreferencesManager.getInstance().setSso_tk((String) response.getData());
}
view.setVisibility(4);
view.loadUrl("javascript:window.handler.show(document.body.innerText);");
view.stopLoading();
}
} catch (Exception e) {
e.printStackTrace();
}
}
示例5: loadStartingUrl
import android.webkit.WebView; //导入方法依赖的package包/类
private void loadStartingUrl(String url)
{
Log.i(LOG_TAG, "loadStartingUrl(" + url + ") <start>");
final WebView webView = initializeAUTWebView();
webView.loadUrl(url);
webView.setVisibility(View.VISIBLE);
webView.requestFocus(View.FOCUS_DOWN);
m_toolbarRefreshButton.setEnabled(true);
Log.i(LOG_TAG, "loadStartingUrl(" + url + ") <end>");
}
示例6: hideWebview
import android.webkit.WebView; //导入方法依赖的package包/类
/**
* Stop navigation, close webview and refresh toolbar
*/
private void hideWebview() {
WebView webview = (WebView)findViewById(R.id.webview);
webview.stopLoading();
webview.getSettings().setJavaScriptEnabled(false);
webview.setVisibility(View.GONE);
isWebviewOpen = false;
getSupportActionBar().setSubtitle(R.string.account_activity_choose_subtitle);
invalidateOptionsMenu();
}
示例7: hideVpaidNShowPlayer
import android.webkit.WebView; //导入方法依赖的package包/类
private void hideVpaidNShowPlayer(final PlayerUIController controller) {
controller.getExoPlayerView().setVisibility(View.VISIBLE);
WebView vpaidEWebView = controller.getVpaidWebView();
if (vpaidEWebView != null) {
vpaidEWebView.setVisibility(View.GONE);
vpaidEWebView.loadUrl(VpaidClient.EMPTY_URL);
vpaidEWebView.clearHistory();
}
}
示例8: hideVpaidNShowPlayer
import android.webkit.WebView; //导入方法依赖的package包/类
private void hideVpaidNShowPlayer(final PlayerUIController imcontroller) {
imcontroller.getExoPlayerView().setVisibility(View.VISIBLE);
WebView vpaidEWebView = imcontroller.getVpaidWebView();
if (vpaidEWebView != null) {
vpaidEWebView.setVisibility(View.GONE);
vpaidEWebView.loadUrl(VpaidClient.EMPTY_URL);
vpaidEWebView.clearHistory();
}
}
示例9: onPageFinished
import android.webkit.WebView; //导入方法依赖的package包/类
@Override
public void onPageFinished(WebView view, String url) {
Log.d(TAG, "onPageFinished() called with: view = [" + view + "], url = [" + url +
"]");
super.onPageFinished(view, url);
if (isError) {
isError = false;
} else {
if (view != null)
view.setVisibility(View.VISIBLE);//NullPointerException
mErrorView.setVisibility(View.GONE);
}
}
示例10: onPageFinished
import android.webkit.WebView; //导入方法依赖的package包/类
@Override
public void onPageFinished(WebView view, String url) {
if (view != null) {
view.setVisibility(View.VISIBLE);
}
cancelTimeKeeper();
}
示例11: onCreate
import android.webkit.WebView; //导入方法依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_activity_show_result);
webView = (WebView) findViewById(R.id.web_content);
tv = (TextView) findViewById(R.id.tv);
pb = (ProgressBar) findViewById(R.id.progress);
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setUseWideViewPort(true);
webSettings.setLoadWithOverviewMode(true);
webView.setWebChromeClient(webChromeClient);
webView.setWebViewClient(webViewClient);
Intent intent = getIntent();
if (intent != null) {
resultText = intent.getStringExtra(Constant.EXTRA_RESULT_TEXT_FROM_PIC);
if (Patterns.WEB_URL.matcher(resultText).matches()) {
//是一个web url
tv.setVisibility(View.GONE);
webView.setVisibility(View.VISIBLE);
webView.loadUrl(resultText);
} else {
//不是web url
tv.setVisibility(View.VISIBLE);
webView.setVisibility(View.GONE);
pb.setVisibility(View.GONE);
tv.setText(resultText);
}
}
}
示例12: onPageFinished
import android.webkit.WebView; //导入方法依赖的package包/类
public void onPageFinished(WebView view, String url) {
try {
if (new URL(url).getPath().contains("callbackdata")) {
view.setVisibility(4);
view.loadUrl("javascript:window.handler.show(document.body.innerText);");
view.stopLoading();
}
} catch (Exception e) {
e.printStackTrace();
}
}
示例13: setUa
import android.webkit.WebView; //导入方法依赖的package包/类
public static void setUa(Context context) {
if (TextUtils.isEmpty(ua)) {
ua = PreferencesManager.getInstance().getUA();
if (!TextUtils.isEmpty(ua)) {
ua = "LetvGphoneClient/" + getClientVersionName() + " " + ua;
} else if (context instanceof Activity) {
WebView webView = new WebView(context);
webView.setVisibility(8);
ua = webView.getSettings().getUserAgentString();
PreferencesManager.getInstance().setUA(ua);
ua = "LetvGphoneClient/" + getClientVersionName() + " " + ua;
}
}
}
示例14: onPageFinished
import android.webkit.WebView; //导入方法依赖的package包/类
@Override public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
if(isLogout) {
view.setVisibility(View.INVISIBLE);
}
if (timeoutHandler != null)
timeoutHandler.cancel(true);
}
示例15: onCreate
import android.webkit.WebView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceBundle) {
super.onCreate(savedInstanceBundle);
setContentView(R.layout.li_login_activity);
Intent intent = getIntent();
Toolbar toolbar = (Toolbar) findViewById(R.id.li_toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
service = new LiAuthServiceImpl(this);
webViewOauth = (WebView) findViewById(R.id.li_web_oauth);
progBar = (ProgressBar) findViewById(R.id.li_login_page_prog_bar);
loginInProgTxt = (TextView) findViewById(R.id.li_login_in_prog_txt);
String authUrl = intent.getData().toString();
progBar.setVisibility(View.VISIBLE);
webViewOauth.setVisibility(View.INVISIBLE);
loginInProgTxt.setText(getString(R.string.li_openingLoginPage));
loginInProgTxt.setVisibility(View.VISIBLE);
isAccessTokenSaved = false;
webViewOauth.clearHistory();
webViewOauth.clearFormData();
webViewOauth.clearCache(true);
setTitle(authUrl);
//set the web client
webViewOauth.setWebViewClient(new LoginWebViewClient());
webViewOauth.setWebChromeClient(new LoginWebChromeClient());
//activates JavaScript (just in case)
WebSettings webSettings = webViewOauth.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
webSettings.setAppCacheEnabled(false);
//load the url of the oAuth login page
webViewOauth.loadUrl(authUrl);
}