I've given following structure of a layout for a tablet app:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clipChildren="false" >
<LinearLayout
android:id="@+id/placeholderForLeftFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false" >
<RelativeLayout
android:id="@+id/placeholderFragmentHomeScreen"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="32" >
</RelativeLayout>
<RelativeLayout
android:id="@+id/dummy"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="69"
android:background="#0000" >
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/mainLinearLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false"
android:clipChildren="false" >
<RelativeLayout
android:id="@+id/invisbleRelativeLayout"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="32"
android:background="#0000" >
</RelativeLayout>
<RelativeLayout
android:id="@+id/placeholderFragmentHotelResultList"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="42"
android:background="#F0FFFF" >
</RelativeLayout>
<RelativeLayout
android:id="@+id/placeholderFragmentHotelDetailScreen"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="26" >
</RelativeLayout>
</LinearLayout>
The first LinearLayout does only contain a fragment on the left side and is not moveable. The 2nd LinearLayout has at first position an invisible element, which I decrease when I swipe the two other R.Layouts left and increase when I sipe back. The RelativeLayout in the middle keeps his width all the time and I can swipe the 2nd and 3rd over the first LinearLayout. Actually the 2nd and 3rd R.Layout should have the same width, but the third one should be only visible at the border of the screen to 26%.
What I now want to do is, that the 3rd R.Layout has the same width how the 2nd one from the beginning (right after the start of the app) and his postion is half to off-screen. What I tried to do is, to create a layout which has the width from the sum of all three R.Layouts and put the layouts in it, but it didn't work - I see only the elements from the first LinearLayout. When I use weight attribute how in the code above, the 3rd R.Lay is streched and that's exactly that behavior what I try to avoid. And when I setMargin_right to a negative value, nothing happens.
I appreciate any thoughts and ideas. Thank you!