Example usage for android.view View TEXT_ALIGNMENT_INHERIT

List of usage examples for android.view View TEXT_ALIGNMENT_INHERIT

Introduction

In this page you can find the example usage for android.view View TEXT_ALIGNMENT_INHERIT.

Prototype

int TEXT_ALIGNMENT_INHERIT

To view the source code for android.view View TEXT_ALIGNMENT_INHERIT.

Click Source Link

Document

Default text alignment.

Usage

From source file:com.facebook.litho.widget.TextSpec.java

private static Alignment getAlignment(int viewTextAlignment, int gravity) {
    final Alignment alignment;
    switch (viewTextAlignment) {
    case View.TEXT_ALIGNMENT_GRAVITY:
        alignment = getAlignment(gravity);
        break;//from   w w  w.  jav  a 2 s.c o  m
    case View.TEXT_ALIGNMENT_TEXT_START:
        alignment = ALIGN_NORMAL;
        break;
    case View.TEXT_ALIGNMENT_TEXT_END:
        alignment = ALIGN_OPPOSITE;
        break;
    case View.TEXT_ALIGNMENT_CENTER:
        alignment = ALIGN_CENTER;
        break;
    case View.TEXT_ALIGNMENT_VIEW_START: // unsupported, default to normal
        alignment = ALIGN_NORMAL;
        break;
    case View.TEXT_ALIGNMENT_VIEW_END: // unsupported, default to opposite
        alignment = ALIGN_OPPOSITE;
        break;
    case View.TEXT_ALIGNMENT_INHERIT: // unsupported, default to gravity
        alignment = getAlignment(gravity);
        break;
    default:
        alignment = textAlignment;
        break;
    }
    return alignment;
}