Java Code Examples for android.widget.RelativeLayout#TRUE

The following examples show how to use android.widget.RelativeLayout#TRUE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EUExBase.java    From appcan-android with GNU Lesser General Public License v3.0 5 votes vote down vote up
protected final void adptLayoutParams(RelativeLayout.LayoutParams rParms,
                                      FrameLayout.LayoutParams outParm) {
    if (null == rParms) {
        return;
    }
    int TRUE = RelativeLayout.TRUE;
    int ALIGN_PARENT_LEFT = RelativeLayout.ALIGN_PARENT_LEFT;
    int ALIGN_PARENT_TOP = RelativeLayout.ALIGN_PARENT_TOP;
    int ALIGN_PARENT_RIGHT = RelativeLayout.ALIGN_PARENT_RIGHT;
    int ALIGN_PARENT_BOTTOM = RelativeLayout.ALIGN_PARENT_BOTTOM;
    int CENTER_IN_PARENT = RelativeLayout.CENTER_IN_PARENT;
    int CENTER_HORIZONTAL = RelativeLayout.CENTER_HORIZONTAL;
    int CENTER_VERTICAL = RelativeLayout.CENTER_VERTICAL;
    try {
        int[] rules = rParms.getRules();
        if (rules[ALIGN_PARENT_LEFT] == TRUE) {
            outParm.gravity |= Gravity.LEFT;
        }
        if (rules[ALIGN_PARENT_TOP] == TRUE) {
            outParm.gravity |= Gravity.TOP;
        }
        if (rules[ALIGN_PARENT_RIGHT] == TRUE) {
            outParm.gravity |= Gravity.RIGHT;
        }
        if (rules[ALIGN_PARENT_BOTTOM] == TRUE) {
            outParm.gravity |= Gravity.BOTTOM;
        }
        if (rules[CENTER_IN_PARENT] == TRUE) {
            outParm.gravity |= Gravity.CENTER;
        }
        if (rules[CENTER_HORIZONTAL] == TRUE) {
            outParm.gravity |= Gravity.CENTER_HORIZONTAL;
        }
        if (rules[CENTER_VERTICAL] == TRUE) {
            outParm.gravity |= Gravity.CENTER_VERTICAL;
        }
    } catch (Exception e) {
        ;
    }
}
 
Example 2
Source File: ParseHelper.java    From proteus with Apache License 2.0 4 votes vote down vote up
public static int parseRelativeLayoutBoolean(boolean value) {
  return value ? RelativeLayout.TRUE : 0;
}