Sliding drawer
(Android phone – how-to/example)
You can integrate the cool sliding-drawer that you use all the time in Home application on Android (the small arrow on the right/bottom of the screen, that displays all the available applications).
One sliding-drawer has two components:
- the handle: most of the time a picture (the picture that you drag). Be careful not to use a big image, or text.
- the content: text, images etc
< SlidingDrawer
android:id="@+id/drawer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:handle="@+id/handle"
android:content="@+id/content"
android:orientation="horizontal">< LinearLayout
android:id="@id/handle"
android:layout_width="fill_parent"
android:orientation="horizontal"
android:layout_height="fill_parent">< ImageView android:id="@+id/IconSlide"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:src="@drawable/left_48">
< /ImageView>
< /LinearLayout>< LinearLayout
android:id="@id/content"
android:layout_width="fill_parent"
android:orientation="horizontal"
android:layout_height="fill_parent">< !-- INSERT in here the content of the sliding-drawer -->
< /LinearLayout>
< /SlidingDrawer>
Code example: you may find useful to see an implementation of this in the Mezzofanti application – google code. The code is released under Apache License, ver 2.0, so you can freely use it free of charge in your own code. Consult the /layout directory.












