Example usage for android.view View MEASURED_STATE_MASK

List of usage examples for android.view View MEASURED_STATE_MASK

Introduction

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

Prototype

int MEASURED_STATE_MASK

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

Click Source Link

Document

Bits of #getMeasuredWidthAndState() and #getMeasuredWidthAndState() that provide the additional state bits.

Usage

From source file:com.actionbarsherlock.internal.widget.IcsView.java

/**
 * Return only the state bits of {@link #getMeasuredWidthAndState()}
 * and {@link #getMeasuredHeightAndState()}, combined into one integer.
 * The width component is in the regular bits {@link #MEASURED_STATE_MASK}
 * and the height component is at the shifted bits
 * {@link #MEASURED_HEIGHT_STATE_SHIFT}>>{@link #MEASURED_STATE_MASK}.
 *///ww  w  .  ja  va2  s  . c o  m
public static int getMeasuredStateInt(View child) {
    return (child.getMeasuredWidth() & View.MEASURED_STATE_MASK)
            | ((child.getMeasuredHeight() >> View.MEASURED_HEIGHT_STATE_SHIFT)
                    & (View.MEASURED_STATE_MASK >> View.MEASURED_HEIGHT_STATE_SHIFT));
}