Example usage for com.facebook.react.uimanager ViewProps TEXT_ALIGN_VERTICAL

List of usage examples for com.facebook.react.uimanager ViewProps TEXT_ALIGN_VERTICAL

Introduction

In this page you can find the example usage for com.facebook.react.uimanager ViewProps TEXT_ALIGN_VERTICAL.

Prototype

String TEXT_ALIGN_VERTICAL

To view the source code for com.facebook.react.uimanager ViewProps TEXT_ALIGN_VERTICAL.

Click Source Link

Usage

From source file:fr.bamlab.textinput.ReactTextInputManager.java

License:Open Source License

@ReactProp(name = ViewProps.TEXT_ALIGN_VERTICAL)
public void setTextAlignVertical(ReactEditText view, @Nullable String textAlignVertical) {
    if (textAlignVertical == null || "auto".equals(textAlignVertical)) {
        view.setGravityVertical(Gravity.NO_GRAVITY);
    } else if ("top".equals(textAlignVertical)) {
        view.setGravityVertical(Gravity.TOP);
    } else if ("bottom".equals(textAlignVertical)) {
        view.setGravityVertical(Gravity.BOTTOM);
    } else if ("center".equals(textAlignVertical)) {
        view.setGravityVertical(Gravity.CENTER_VERTICAL);
    } else {//from w w  w .j  av a2 s .co m
        throw new JSApplicationIllegalArgumentException("Invalid textAlignVertical: " + textAlignVertical);
    }
}