Example usage for android.text Layout BREAK_STRATEGY_HIGH_QUALITY

List of usage examples for android.text Layout BREAK_STRATEGY_HIGH_QUALITY

Introduction

In this page you can find the example usage for android.text Layout BREAK_STRATEGY_HIGH_QUALITY.

Prototype

int BREAK_STRATEGY_HIGH_QUALITY

To view the source code for android.text Layout BREAK_STRATEGY_HIGH_QUALITY.

Click Source Link

Document

Value for break strategy indicating high quality line breaking, including automatic hyphenation and doing whole-paragraph optimization of line breaks.

Usage

From source file:com.facebook.react.views.textinput.ReactTextInputShadowNode.java

public ReactTextInputShadowNode() {
    mTextBreakStrategy = (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) ? Layout.BREAK_STRATEGY_SIMPLE
            : Layout.BREAK_STRATEGY_HIGH_QUALITY;

    initMeasureFunction();
}

From source file:com.facebook.react.views.textinput.ReactTextInputShadowNode.java

@Override
public void setTextBreakStrategy(@Nullable String textBreakStrategy) {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
        return;/*w w w .j av  a  2 s  .  c  o  m*/
    }

    if (textBreakStrategy == null || "simple".equals(textBreakStrategy)) {
        mTextBreakStrategy = Layout.BREAK_STRATEGY_SIMPLE;
    } else if ("highQuality".equals(textBreakStrategy)) {
        mTextBreakStrategy = Layout.BREAK_STRATEGY_HIGH_QUALITY;
    } else if ("balanced".equals(textBreakStrategy)) {
        mTextBreakStrategy = Layout.BREAK_STRATEGY_BALANCED;
    } else {
        throw new JSApplicationIllegalArgumentException("Invalid textBreakStrategy: " + textBreakStrategy);
    }
}