I have next view hiererchy:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:gravity="center">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/group_bg"
android:gravity="center_vertical"
android:baselineAligned="false">
<LinearLayout
android:id="@+id/itemplace"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:layout_weight="1" >
<include
android:layout_width="wrap_content"
android:layout_height="wrap_content"
layout="@layout/pin" />
</LinearLayout>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/arrow_black"/>
</LinearLayout>
</LinearLayout>
I need to get itemplace width before this hierarchy will be drawing. I can not use OnLayoutChangeListener because I use API level 7.
I know that I must use measure() and layout() methods to calculate size of my views but I dont know hot it to do.
Root view in my hierarchy must fill all width of screen, so itemplace width depended of parent size, parent paddings and FrameLayout width.
What must I do to get it width?