Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
PierfrancescoSoffritti committed Nov 11, 2017
2 parents a36ebcd + 38288c6 commit 8362528
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" >
<LinearLayout
android:id="@id/non_slidable_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:layout_width="wrap_content"
android:layout_height="100dp"
android:text="non slidable content" />
</LinearLayout>
<View
android:id="@id/non_slidable_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@id/slidable_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:id="@id/slidable_view"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/drag_view"
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="drag me"
android:clickable="true" />
</FrameLayout>
</com.pierfrancescosoffritti.slidingdrawer.SlidingDrawer>
```
It's important to set the id attribute to `android:id="@id/non_slidable_view"` for the <b>non slidable view</b> and to `android:id="@id/slidable_view"` for the <b>slidable view</b>.

When you use this ViewGroup remember to always add a <b>drag view</b> `slidingDrawer.setDragView(view);` <br/>
The <b>drag view</b> is the only surface from which the <b>slidable view</b> can be dragged.
The <b>drag view</b> is the only surface from which the <b>slidable view</b> can be dragged. The drag view must be clickable.

In case the <b>slidable view</b> has different views when collapsed (<b>collapsed view</b>) or expanded (<b>expanded view</b>), and the <b>collapsed view</b> 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.

0 comments on commit 8362528

Please sign in to comment.