Custom drawer, iphone custom ringtones
Reprinted with the source: http://blog.csdn.net/forwardyzk/article/details/42557355
The SlidingDrawer provided by the system only provides two sliding directions: from bottom to top, from right to left. The following describes the drawer controls that can be slide in four directions.
Custom controls, including custom attributes, can be set. LeftToRight, bottomToTop, rightToLeft, topToBottom
Handle. xml
<? Xml version = "1.0" encoding = "UTF-8"?> <RelativeLayout xmlns: android = "http://schemas.android.com/apk/res/android" android: layout_width = "wrap_content" android: layout_height = "wrap_content"> <TextView android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: background = "@ android: color/white" android: gravity = "center" android: padding = "10dp" android: text = "handle" android: textColor = "@ color/handle" android: textSize = "30sp"/> </RelativeLayout>
Content. xml
<? Xml version = "1.0" encoding = "UTF-8"?> <RelativeLayout xmlns: android = "http://schemas.android.com/apk/res/android" android: layout_width = "match_parent" android: layout_height = "match_parent" android: layout_gravity = "bottom"> <TextView android: layout_width = "match_parent" android: layout_height = "match_parent" android: background = "@ color/content" android: gravity = "center" android: text = "drawer content" android: textColor = "@ android: color/black"/> </RelativeLayout>
Main. xml
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@android:color/white" android:orientation="vertical" > <com.example.demoslidingdrawer.view.MultiDirectionSlidingDrawer xmlns:my="http://schemas.android.com/apk/res/com.example.demoslidingdrawer" android:layout_width="match_parent" android:layout_height="wrap_content" my:content="@+id/content" my:direction="topToBottom" my:handle="@+id/handle" > <include android:id="@id/content" layout="@layout/content" /> <include android:id="@id/handle" layout="@layout/handle" /> </com.example.demoslidingdrawer.view.MultiDirectionSlidingDrawer> <com.example.demoslidingdrawer.view.MultiDirectionSlidingDrawer xmlns:my="http://schemas.android.com/apk/res/com.example.demoslidingdrawer" android:layout_width="match_parent" android:layout_height="wrap_content" my:content="@+id/content" my:direction="rightToLeft" my:handle="@+id/handle" > <include android:id="@id/content" layout="@layout/content" /> <include android:id="@id/handle" layout="@layout/handle" /> </com.example.demoslidingdrawer.view.MultiDirectionSlidingDrawer> <com.example.demoslidingdrawer.view.MultiDirectionSlidingDrawer xmlns:my="http://schemas.android.com/apk/res/com.example.demoslidingdrawer" android:layout_width="match_parent" android:layout_height="wrap_content" my:content="@+id/content" my:direction="bottomToTop" my:handle="@+id/handle" > <include android:id="@id/content" layout="@layout/content" /> <include android:id="@id/handle" layout="@layout/handle" /> </com.example.demoslidingdrawer.view.MultiDirectionSlidingDrawer> <com.example.demoslidingdrawer.view.MultiDirectionSlidingDrawer xmlns:my="http://schemas.android.com/apk/res/com.example.demoslidingdrawer" android:layout_width="match_parent" android:layout_height="wrap_content" my:content="@+id/content" my:direction="leftToRight" my:handle="@+id/handle" > <include android:id="@id/content" layout="@layout/content" /> <include android:id="@id/handle" layout="@layout/handle" /> </com.example.demoslidingdrawer.view.MultiDirectionSlidingDrawer></RelativeLayout>
Custom property controls, see http://blog.csdn.net/forwardyzk/article/details/25079743
Source code download: http://download.csdn.net/detail/forwardyzk/8345333
: