From 38288c673ee34ee8cef768f1f30bc6109e326c5a Mon Sep 17 00:00:00 2001 From: Pierfrancesco Soffritti Date: Sat, 4 Nov 2017 22:52:13 +0100 Subject: [PATCH] Update README.md --- README.md | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 2ac414e..0b8193a 100644 --- a/README.md +++ b/README.md @@ -39,26 +39,36 @@ dependencies { xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" - android:id="@+id/sliding_drawer" - android:layout_width="match_parent" - android:layout_height="match_parent" - app:shadow_length="4dp" > + + + + + - - + android:id="@id/slidable_view" + android:layout_width="match_parent" + android:layout_height="match_parent" > + + + ``` It's important to set the id attribute to `android:id="@id/non_slidable_view"` for the non slidable view and to `android:id="@id/slidable_view"` for the slidable view. When you use this ViewGroup remember to always add a drag view `slidingDrawer.setDragView(view);`
-The drag view is the only surface from which the slidable view can be dragged. +The drag view is the only surface from which the slidable view can be dragged. The drag view must be clickable. In case the slidable view has different views when collapsed (collapsed view) or expanded (expanded view), and the collapsed view isn't a List (or equivalent), it should have the id `android:id="@id/sliding_drawer_collapsed_view"`, so the `SlidingDrawer` can adjust the view's paddingBottom to prevent its content from going offscreen.