Example usage for android.view View LAYOUT_DIRECTION_INHERIT

List of usage examples for android.view View LAYOUT_DIRECTION_INHERIT

Introduction

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

Prototype

int LAYOUT_DIRECTION_INHERIT

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

Click Source Link

Document

Horizontal layout direction of this view is inherited from its parent.

Usage

From source file:com.facebook.litho.MountState.java

private static void setViewLayoutDirection(View view, ViewNodeInfo viewNodeInfo) {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
        return;/*  ww w  .j  a v a 2s  . com*/
    }

    final int viewLayoutDirection;
    switch (viewNodeInfo.getLayoutDirection()) {
    case LTR:
        viewLayoutDirection = View.LAYOUT_DIRECTION_LTR;
        break;
    case RTL:
        viewLayoutDirection = View.LAYOUT_DIRECTION_RTL;
        break;
    default:
        viewLayoutDirection = View.LAYOUT_DIRECTION_INHERIT;
    }

    view.setLayoutDirection(viewLayoutDirection);
}

From source file:com.facebook.litho.MountState.java

private static void unsetViewLayoutDirection(View view, ViewNodeInfo viewNodeInfo) {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
        return;/*from w  w w .  ja v  a  2s.  c om*/
    }

    view.setLayoutDirection(View.LAYOUT_DIRECTION_INHERIT);
}