Java Code Examples for android.webkit.WebSettings#LayoutAlgorithm

The following examples show how to use android.webkit.WebSettings#LayoutAlgorithm . 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: MainActivity.java    From chromium-webview-samples with Apache License 2.0 5 votes vote down vote up
private void setUseTextAutoSize(boolean useAlgorithm) {
    WebSettings settings = mWebView.getSettings();

    WebSettings.LayoutAlgorithm layoutAlgorithm = WebSettings.LayoutAlgorithm.NORMAL;
    if(useAlgorithm) {
        layoutAlgorithm = WebSettings.LayoutAlgorithm.TEXT_AUTOSIZING;
    }

    settings.setLayoutAlgorithm(layoutAlgorithm);
}
 
Example 2
Source File: WebViewAssist.java    From DevUtils with Apache License 2.0 2 votes vote down vote up
/**
 * 获取基础布局算法
 * @return 基础布局算法
 */
public WebSettings.LayoutAlgorithm getLayoutAlgorithm() {
    return mLayoutAlgorithm;
}
 
Example 3
Source File: WebViewAssist.java    From DevUtils with Apache License 2.0 2 votes vote down vote up
/**
 * 设置基础布局算法
 * @param layoutAlgorithm 基础布局算法
 * @return {@link Builder}
 */
public Builder setLayoutAlgorithm(final WebSettings.LayoutAlgorithm layoutAlgorithm) {
    this.mLayoutAlgorithm = layoutAlgorithm;
    return this;
}