Example usage for android.webkit WebSettings setLayoutAlgorithm

List of usage examples for android.webkit WebSettings setLayoutAlgorithm

Introduction

In this page you can find the example usage for android.webkit WebSettings setLayoutAlgorithm.

Prototype

public abstract void setLayoutAlgorithm(LayoutAlgorithm l);

Source Link

Document

Sets the underlying layout algorithm.

Usage

From source file:com.android.mail.ui.ConversationViewFragment.java

private void setupOverviewMode() {
    // for now, overview mode means use the built-in WebView zoom and disable custom scale
    // gesture handling
    final boolean overviewMode = isOverviewMode(mAccount);
    final WebSettings settings = mWebView.getSettings();
    final WebSettings.LayoutAlgorithm layout;
    settings.setUseWideViewPort(overviewMode);
    settings.setSupportZoom(overviewMode);
    settings.setBuiltInZoomControls(overviewMode);
    settings.setLoadWithOverviewMode(overviewMode);
    if (overviewMode) {
        settings.setDisplayZoomControls(false);
        layout = WebSettings.LayoutAlgorithm.NORMAL;
    } else {/*from w  ww. j  a v a  2s  .c  om*/
        layout = WebSettings.LayoutAlgorithm.NARROW_COLUMNS;
    }
    settings.setLayoutAlgorithm(layout);
}

From source file:com.tct.mail.ui.ConversationViewFragment.java

private void setupOverviewMode() {
    // for now, overview mode means use the built-in WebView zoom and disable custom scale
    // gesture handling
    final boolean overviewMode = isOverviewMode(mAccount);
    final WebSettings settings = mWebView.getSettings();
    final WebSettings.LayoutAlgorithm layout;
    // TS: zhaotianyong 2015-03-13 EMAIL BUGFIX-932165 DEL_S
    //        settings.setUseWideViewPort(overviewMode);
    // TS: zhaotianyong 2015-03-13 EMAIL BUGFIX-932165 DEL_E
    settings.setSupportZoom(overviewMode);
    settings.setBuiltInZoomControls(overviewMode);
    // TS: zhaotianyong 2015-03-13 EMAIL BUGFIX-932165 DEL_S
    //        settings.setLoadWithOverviewMode(overviewMode);
    // TS: zhaotianyong 2015-03-13 EMAIL BUGFIX-932165 DEL_E
    if (overviewMode) {
        settings.setDisplayZoomControls(false);
        layout = WebSettings.LayoutAlgorithm.NORMAL;
    } else {//from w w  w  .j a  va2s. co m
        layout = WebSettings.LayoutAlgorithm.NARROW_COLUMNS;
    }
    settings.setLayoutAlgorithm(layout);
}