在Android中,对SlidingDraw组件进行修改,将SlidingDraw组件的把手(手柄)改成左右两个Button,单击或拖动第一个Button响应SlidingDraw所有默认动作,第二个Button也随第一个Button动而动,单击第二个Button,可以启动一个Activity或弹出Dialog,第二个Button不响应SlidingDraw的任何默认动作。
2. 效果图:
(1) 效果图1:
(2) 效果图2:
3. 功能实现
(1) 主布局(main.xml)实现:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android = "http://schemas.android.com/apk/res/android" xmlns:flyfot = "http://schemas.android.com/apk/res/com.focus.fishme" android:layout_width = "fill_parent" android:layout_height = "fill_parent" > <com.focus.fishme.FishMeSlidingDrawer android:id = "@+id/slidingDrawer" android:layout_width = "fill_parent" android:layout_height = "fill_parent" flyfot:handle = "@+id/dragger" flyfot:content = "@+id/content" > <LinearLayout android:id = "@+id/dragger" android:layout_width = "wrap_content" android:layout_height = "wrap_content" > <Button android:id = "@+id/mainButton" android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:text = "DRAWER1" android:clickable = "false" /> <Button android:id = "@+id/phoneButton" android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:text = "DRAWER2" /> </LinearLayout> <LinearLayout android:id = "@+id/content" android:layout_width = "fill_parent" android:layout_height = "fill_parent" android:background = "#00FF00"> </LinearLayout> </com.focus.fishme.FishMeSlidingDrawer> </LinearLayout>