本文整理了Java中android.webkit.WebView.setVisibility()
方法的一些代码示例,展示了WebView.setVisibility()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebView.setVisibility()
方法的具体详情如下:
包路径:android.webkit.WebView
类名称:WebView
方法名:setVisibility
暂无
代码示例来源:origin: wangdan/AisenWeiBo
@Override
public void run() {
webview.setVisibility(View.VISIBLE);
}
}, 500);
代码示例来源:origin: wangdan/AisenWeiBo
@Override
public void run() {
large.setVisibility(View.VISIBLE);
}
}, 500);
代码示例来源:origin: androidquery/androidquery
private void done(WebView view){
if(progress != null){
//progress.setVisibility(View.GONE);
view.setVisibility(View.VISIBLE);
Common.showProgress(progress, url, false);
}
view.setWebViewClient(null);
}
代码示例来源:origin: Justson/AgentWeb
@Override
public void onPageFinished(WebView view, String url) {
if (!mErrorUrlsSet.contains(url) && mWaittingFinishSet.contains(url)) {
if (mAgentWebUIController.get() != null) {
mAgentWebUIController.get().onShowMainFrame();
}
} else {
view.setVisibility(View.VISIBLE);
}
if (mWaittingFinishSet.contains(url)) {
mWaittingFinishSet.remove(url);
}
if (!mErrorUrlsSet.isEmpty()) {
mErrorUrlsSet.clear();
}
super.onPageFinished(view, url);
}
代码示例来源:origin: hidroh/materialistic
@Override
public void onProgressChanged(WebView view, int newProgress) {
super.onProgressChanged(view, newProgress);
progressBar.setVisibility(View.VISIBLE);
progressBar.setProgress(newProgress);
if (newProgress == 100) {
progressBar.setVisibility(View.GONE);
webView.setBackgroundColor(Color.WHITE);
webView.setVisibility(View.VISIBLE);
}
}
});
代码示例来源:origin: facebook/facebook-android-sdk
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
if (!isDetached) {
spinner.dismiss();
}
/*
* Once web view is fully loaded, set the contentFrameLayout background to be transparent
* and make visible the 'x' image.
*/
contentFrameLayout.setBackgroundColor(Color.TRANSPARENT);
webView.setVisibility(View.VISIBLE);
crossImageView.setVisibility(View.VISIBLE);
isPageFinished = true;
}
}
代码示例来源:origin: pockethub/PocketHub
private void loadMarkdown() {
loadingBar.setVisibility(View.VISIBLE);
codeView.setVisibility(View.GONE);
String markdown = new String(Base64.decode(blob.content(), Base64.DEFAULT));
MarkdownLoader.load(this, markdown, repo, imageGetter, false)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(rendered -> {
loadingBar.setVisibility(View.GONE);
codeView.setVisibility(View.VISIBLE);
if (!TextUtils.isEmpty(rendered)) {
renderedMarkdown = rendered.toString();
if (markdownItem != null) {
markdownItem.setEnabled(true);
}
editor.setMarkdown(true).setSource(file, renderedMarkdown, false);
}
} , e -> ToastUtils.show(this, R.string.error_rendering_markdown));
}
代码示例来源:origin: pockethub/PocketHub
private void loadMarkdown() {
loadingBar.setVisibility(View.VISIBLE);
codeView.setVisibility(View.GONE);
String markdown = new String(Base64.decode(blob.content(), Base64.DEFAULT));
MarkdownLoader.load(this, markdown, repo, imageGetter, false)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(rendered -> {
loadingBar.setVisibility(View.GONE);
codeView.setVisibility(View.VISIBLE);
if (!TextUtils.isEmpty(rendered)) {
renderedMarkdown = rendered.toString();
if (markdownItem != null) {
markdownItem.setEnabled(true);
}
editor.setMarkdown(true).setSource(file, renderedMarkdown, false);
}
}, e -> ToastUtils.show(this, R.string.error_rendering_markdown));
}
代码示例来源:origin: hidroh/materialistic
@Override
public void onPageStarted(android.webkit.WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
view.pageUp(true);
WebView webView = (WebView) view;
if (TextUtils.equals(url, webView.mPendingUrl)) {
view.setVisibility(VISIBLE);
}
if (mClient != null) {
mClient.onPageStarted(view, url, favicon);
}
}
代码示例来源:origin: Justson/AgentWeb
@Override
public void onHideCustomView() {
if (mMoiveView == null) {
return;
}
if (mActivity != null && mActivity.getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) {
mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
if (!mFlags.isEmpty()) {
for (Pair<Integer, Integer> mPair : mFlags) {
mActivity.getWindow().setFlags(mPair.second, mPair.first);
}
mFlags.clear();
}
mMoiveView.setVisibility(View.GONE);
if (mMoiveParentView != null && mMoiveView != null) {
mMoiveParentView.removeView(mMoiveView);
}
if (mMoiveParentView != null) {
mMoiveParentView.setVisibility(View.GONE);
}
if (this.mCallback != null) {
mCallback.onCustomViewHidden();
}
this.mMoiveView = null;
if (mWebView != null) {
mWebView.setVisibility(View.VISIBLE);
}
}
代码示例来源:origin: Justson/AgentWeb
mWebView.setVisibility(View.GONE);
代码示例来源:origin: ankidroid/Anki-Android
@Override
protected void onPostExecute(String html) {
if (html != null && mIsRunning) {
try {
mWebView.loadData(URLEncoder.encode(html, "UTF-8").replaceAll("\\+", " "), "text/html; charset=utf-8", "utf-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
mProgressBar.setVisibility(View.GONE);
int backgroundColor = Themes.getColorFromAttr(mWebView.getContext(), android.R.attr.colorBackground);
mWebView.setBackgroundColor(backgroundColor);
mWebView.setVisibility(View.VISIBLE);
mWebView.invalidate();
}
}
}
代码示例来源:origin: ankidroid/Anki-Android
private void setInterface() {
if (mCurrentCard == null) {
return;
}
if (mCard == null) {
mCard = createWebView();
// On your desktop use chrome://inspect to connect to emulator WebViews
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT &&
AnkiDroidApp.getSharedPrefs(this).getBoolean("html_javascript_debugging", false)) {
WebView.setWebContentsDebuggingEnabled(true);
}
mCardFrame.addView(mCard);
}
if (mCard.getVisibility() != View.VISIBLE) {
mCard.setVisibility(View.VISIBLE);
}
}
代码示例来源:origin: pockethub/PocketHub
private void loadContent() {
loadingBar.setVisibility(View.VISIBLE);
codeView.setVisibility(View.GONE);
ServiceGenerator.createService(this, GitService.class)
.getGitBlob(repo.owner().login(), repo.name(), sha)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.as(AutoDisposeUtils.bindToLifecycle(this))
.subscribe(response -> {
blob = response.body();
if (markdownItem != null) {
markdownItem.setEnabled(true);
}
if (isMarkdownFile
&& PreferenceUtils.getCodePreferences(this).getBoolean(
RENDER_MARKDOWN, true)) {
loadMarkdown();
} else {
loadingBar.setVisibility(View.GONE);
codeView.setVisibility(View.VISIBLE);
editor.setMarkdown(false).setSource(file, blob);
}
}, e -> {
Log.d(TAG, "Loading file contents failed", e);
loadingBar.setVisibility(View.GONE);
codeView.setVisibility(View.VISIBLE);
ToastUtils.show(this, R.string.error_file_load);
});
}
代码示例来源:origin: pockethub/PocketHub
GitBlob gitBlob = response.body();
loadingBar.setVisibility(View.GONE);
codeView.setVisibility(View.VISIBLE);
} else {
loadingBar.setVisibility(View.GONE);
codeView.setVisibility(View.VISIBLE);
editor.setSource(path, gitBlob);
codeView.setVisibility(View.VISIBLE);
ToastUtils.show(this, R.string.error_file_load);
});
代码示例来源:origin: facebook/facebook-android-sdk
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);
代码示例来源:origin: wangdan/AisenWeiBo
@Override
public boolean shouldOverrideUrlLoading(WebView view, final String url) {
// 授权成功
if (url != null && url.startsWith(getClientCallback())) {
Params params = ParamsUtil.deCodeUrl(url);
String code = params.getParameter("code");
if (isActivityRunning() && mLoadAccountTask == null) {
Logger.d(TAG, "授权成功, code = " + code);
// 把WebView隐藏,因为callback页面是个错误的页面
mWebView.setVisibility(View.INVISIBLE);
mLoadAccountTask = new LoadAccountTask();
mLoadAccountTask.execute(code);
}
}
if (!TextUtils.isEmpty(url) && !url.startsWith("sinaweibo://")) {
view.loadUrl(url);
}
Logger.d(TAG, "load url = %s", view.getUrl());
return true;
}
代码示例来源:origin: stackoverflow.com
mWebviewPop.setVisibility(View.GONE);
mContainer.removeView(mWebviewPop);
mWebviewPop=null;
代码示例来源:origin: ankidroid/Anki-Android
@Override
public void checkAndUpdate() {
if (!mIsCreated) {
return;
}
Collection col = CollectionHelper.getInstance().getCol(getActivity());
if (mType != (((Statistics) getActivity()).getTaskHandler()).getStatType() ||
mDeckId != ((Statistics) getActivity()).getDeckId()) {
mType = (((Statistics) getActivity()).getTaskHandler()).getStatType();
mProgressBar.setVisibility(View.VISIBLE);
mWebView.setVisibility(View.GONE);
mDeckId = ((Statistics) getActivity()).getDeckId();
if (mCreateStatisticsOverviewTask != null && !mCreateStatisticsOverviewTask.isCancelled()) {
mCreateStatisticsOverviewTask.cancel(true);
}
createStatisticOverview();
}
}
代码示例来源:origin: sunfusheng/GlideImageView
public void onDestroy() {
webView.setVisibility(GONE);
webView.destroy();
}
内容来源于网络,如有侵权,请联系作者删除!