Merge commit '42b2e5ca519766e37ce6941ba4faecc9691cc403' into upstream
[debian/openrocket] / android-libraries / ActionBarSherlock / src / com / actionbarsherlock / internal / widget / IcsView.java
diff --git a/android-libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsView.java b/android-libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsView.java
new file mode 100644 (file)
index 0000000..a7185d0
--- /dev/null
@@ -0,0 +1,21 @@
+package com.actionbarsherlock.internal.widget;
+
+import android.view.View;
+
+final class IcsView {
+    //No instances
+    private IcsView() {}
+
+    /**
+     * 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));
+    }
+}