當前位置: 首頁>>代碼示例>>Java>>正文


Java WebView.setVisibility方法代碼示例

本文整理匯總了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");
}
 
開發者ID:SOASTA,項目名稱:touchtestweb-android,代碼行數:17,代碼來源:PrivacyPolicyActivity.java

示例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();
}
 
開發者ID:jpmeijers,項目名稱:ttnmapper_android_v2,代碼行數:17,代碼來源:LogInToTTN.java

示例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);
}
 
開發者ID:MobileDev418,項目名稱:chat-sdk-android-push-firebase,代碼行數:21,代碼來源:WebDialog.java

示例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();
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:18,代碼來源:HongKongLoginWebview.java

示例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>");
}
 
開發者ID:SOASTA,項目名稱:touchtestweb-android,代碼行數:11,代碼來源:MainActivity.java

示例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();
}
 
開發者ID:nioc,項目名稱:tumblr-photo-browse,代碼行數:13,代碼來源:AccountActivity.java

示例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();
        }
    }
 
開發者ID:Tubitv,項目名稱:TubiPlayer,代碼行數:12,代碼來源:MoviePlayingState.java

示例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();
        }
    }
 
開發者ID:Tubitv,項目名稱:TubiPlayer,代碼行數:12,代碼來源:AdPlayingState.java

示例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);
    }
}
 
開發者ID:fendoudebb,項目名稱:PlayAndroid,代碼行數:14,代碼來源:WebViewActivity.java

示例10: onPageFinished

import android.webkit.WebView; //導入方法依賴的package包/類
@Override
public void onPageFinished(WebView view, String url) {
    if (view != null) {
        view.setVisibility(View.VISIBLE);
    }
    cancelTimeKeeper();
}
 
開發者ID:quickhybrid,項目名稱:quickhybrid-android,代碼行數:8,代碼來源:PageLoad.java

示例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);
        }
    }
}
 
開發者ID:MRYangY,項目名稱:YZxing,代碼行數:33,代碼來源:ShowResultActivity.java

示例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();
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:12,代碼來源:LetvOpenIDOAuthLoginActivity.java

示例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;
        }
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:15,代碼來源:LetvUtils.java

示例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);


}
 
開發者ID:hadiidbouk,項目名稱:AppAuthWebView-Android,代碼行數:12,代碼來源:AppAuthWebView.java

示例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);
}
 
開發者ID:lithiumtech,項目名稱:li-android-sdk-core,代碼行數:36,代碼來源:LiLoginActivity.java


注:本文中的android.webkit.WebView.setVisibility方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。