I’m using a SlidingDrawer from Right to Left, it’s working well but I have a problem with the invisible part of android:handle, which is a LinearLayout.
I had to use a LinearLayout having a fill_parent property to permit to put my button at the top of the view. If I put my handle on my ImageView,
it become vertically centered in the middle, and I don’t want this.
Here is my code :
<SlidingDrawer
android:id="@+id/SlidingDrawer"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:content="@+id/contentLayout"
android:handle="@+id/slideHandleButton"
android:orientation="horizontal"
android:padding="0dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/slideHandleButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/profile_top_panel_background" />
</LinearLayout>
<LinearLayout
android:id="@+id/contentLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/slideHandleButton"
android:background="@drawable/profile_slider_attributes_background"
android:orientation="vertical"
android:padding="10dip" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
//DISPLAY CONTENT
</LinearLayout>
</ScrollView>
</LinearLayout>
</SlidingDrawer>
The only way I found to move the handle to exactly where I wanted was to extend the slidingdrawer class and modify the onLayout method.
This line in the sldingdrawer source code determines the position of the handle.
Extend the slidingdrawer and try adjust the values until you get the position you want.