本文整理汇总了Java中android.view.View.MEASURED_HEIGHT_STATE_SHIFT属性的典型用法代码示例。如果您正苦于以下问题:Java View.MEASURED_HEIGHT_STATE_SHIFT属性的具体用法?Java View.MEASURED_HEIGHT_STATE_SHIFT怎么用?Java View.MEASURED_HEIGHT_STATE_SHIFT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.view.View
的用法示例。
在下文中一共展示了View.MEASURED_HEIGHT_STATE_SHIFT属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMeasuredStateInt
/**
* 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}.
*/
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));
}