Java Code Examples for android.webkit.WebView#postInvalidate()

The following examples show how to use android.webkit.WebView#postInvalidate() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LightningView.java    From browser with GNU General Public License v2.0 9 votes vote down vote up
@Override
public void onPageFinished(WebView view, String url) {
	if (view.isShown()) {
		mBrowserController.updateUrl(url, true);
		view.postInvalidate();
	}
	if (view.getTitle() == null || view.getTitle().isEmpty()) {
		mTitle.setTitle(mActivity.getString(R.string.untitled));
	} else {
		mTitle.setTitle(view.getTitle());
	}
	if (API >= android.os.Build.VERSION_CODES.KITKAT && mInvertPage) {
		view.evaluateJavascript(Constants.JAVASCRIPT_INVERT_PAGE, null);
	}
	mBrowserController.update();
}
 
Example 2
Source File: LightningWebClient.java    From Xndroid with GNU General Public License v3.0 8 votes vote down vote up
@TargetApi(Build.VERSION_CODES.KITKAT)
@Override
public void onPageFinished(@NonNull WebView view, String url) {
    if (view.isShown()) {
        mUIController.updateUrl(url, false);
        mUIController.setBackButtonEnabled(view.canGoBack());
        mUIController.setForwardButtonEnabled(view.canGoForward());
        view.postInvalidate();
    }
    if (view.getTitle() == null || view.getTitle().isEmpty()) {
        mLightningView.getTitleInfo().setTitle(mActivity.getString(R.string.untitled));
    } else {
        mLightningView.getTitleInfo().setTitle(view.getTitle());
    }
    if (Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT &&
        mLightningView.getInvertePage()) {
        view.evaluateJavascript(Constants.JAVASCRIPT_INVERT_PAGE, null);
    }
    mUIController.tabChanged(mLightningView);
}
 
Example 3
Source File: LightningWebClient.java    From JumpGo with Mozilla Public License 2.0 6 votes vote down vote up
@TargetApi(Build.VERSION_CODES.KITKAT)
@Override
public void onPageFinished(@NonNull WebView view, String url) {
    if (view.isShown()) {
        mUIController.updateUrl(url, false);
        mUIController.setBackButtonEnabled(view.canGoBack());
        mUIController.setForwardButtonEnabled(view.canGoForward());
        view.postInvalidate();
    }
    if (view.getTitle() == null || view.getTitle().isEmpty()) {
        mLightningView.getTitleInfo().setTitle(mActivity.getString(R.string.untitled));
    } else {
        mLightningView.getTitleInfo().setTitle(view.getTitle());
    }
    if (Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT &&
        mLightningView.getInvertePage()) {
        view.evaluateJavascript(Constants.JAVASCRIPT_INVERT_PAGE, null);
    }
    mUIController.tabChanged(mLightningView);
}