Example usage for android.text Layout BREAK_STRATEGY_SIMPLE

List of usage examples for android.text Layout BREAK_STRATEGY_SIMPLE

Introduction

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

Prototype

int BREAK_STRATEGY_SIMPLE

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

Click Source Link

Document

Value for break strategy indicating simple line breaking.

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 2s.  c om*/
    }

    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);
    }
}