当前位置: 首页>>代码示例>>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;未经允许,请勿转载。