本文整理匯總了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));
}