Use a frame layout and use a box for a fixed width and height.
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <LinearLayout android:id="@+id/middle_ll" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <android.support.v4.view.ViewPager android:id="@+id/view_pager" android:layout_width="match_parent" android:layout_height="match_parent" /> </LinearLayout> <SlidingDrawer android:id="@+id/option_menu" android:layout_width="wrap_content" android:layout_height="@dimen/drawer_top_height" android:layout_alignParentRight="true" android:background="@android:color/transparent" android:content="@+id/content" android:handle="@+id/handle" android:rotation="180" > <RelativeLayout android:id="@+id/content" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:orientation="vertical" android:rotation="180" > <include android:id="@+id/menu_pop_down" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" layout="@layout/menu_layout" android:visibility="visible" /> </RelativeLayout> <RelativeLayout android:id="@+id/handle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:rotation="180" > <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:src="@drawable/date_picker_icon" /> </RelativeLayout> </SlidingDrawer> </FrameLayout>
source share