Skip to content

Commit fd9e499

Browse files
author
jfeinstein10
committed
2 parents 03dce04 + 6fc993e commit fd9e499

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

README.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,37 @@ __1.__ You can embed the SlidingMenu at the Activity level by making your A
1919
The ActionBar will slide with the "above" portion of the SlidingMenu.
2020
* In your Activity's onCreate method, you will have to call `setContentView`, as usual, and also
2121
`setBehindContentView`, which has the same syntax as setContentView. `setBehindContentView` will place
22-
the view in the "behind" portion of the SlidingMenu. You also have access to methods such as `toggle()`,
23-
`showAbove()` `showBehind()` at the Activity level.
22+
the view in the "behind" portion of the SlidingMenu. You will have access to the `getSlidingMenu` method so you can
23+
customize the SlidingMenu to your liking.
2424
* More variants of `SlidingMenuActivity` will be coming soon, such as `SlidingFragmentActivity`, etc.
2525

2626
__2.__ You can use the SlidingMenu view directly in your xml layouts or programmatically in you Java code.
2727
* This way, you can treat SlidingMenu as you would any other view type and put it in crazy awesome places like in the
2828
rows of a ListView.
2929
* So. Many. Possibilities.
3030

31-
Customizing SlidingMenu
32-
-----------------------
33-
To come soon!
31+
Usage
32+
-----
33+
If you decide to use SlidingMenu as a view, you can define it in your xml layouts like this:
34+
```xml
35+
<com.slidingmenu.lib.SlidingMenu
36+
xmlns:sliding="http://schemas.android.com/apk/res-auto"
37+
android:id="@+id/slidingmenulayout"
38+
android:layout_width="fill_parent"
39+
android:layout_height="fill_parent"
40+
sliding:viewAbove="@layout/YOUR_ABOVE_VIEW"
41+
sliding:viewBehind="@layout/YOUR_BEHIND_BEHIND"
42+
sliding:behindOffset="@dimen/YOUR_OFFSET"
43+
sliding:behindScrollScale="@dimen/YOUR_SCALE" />
44+
```
45+
* `viewAbove` - a reference to the layout that you want to use as the above view of the SlidingMenu
46+
* `viewBehind` - a reference to the layout that you want to use as the behind view of the SlidingMenu
47+
* `behindOffset` - a dimension representing the number of pixels that you want the above view to show when the
48+
behind view is showing
49+
* `behindScrollScale` - a float representing the relationship between the above view scrolling and the behind
50+
behind view scrolling. If set to 0.5f, the behind view will scroll 1px for every 2px that the above view scrolls.
51+
If set to 1.0f, the behind view will scroll 1px for every 1px that the above view scrolls. And if set to 0.0f, the
52+
behind view will never scroll; it will be static. This one is fun to play around with.
3453

3554
Developed By
3655
------------

0 commit comments

Comments
 (0)