@@ -19,18 +19,37 @@ __1.__ You can embed the SlidingMenu at the Activity level by making your A
19
19
The ActionBar will slide with the "above" portion of the SlidingMenu.
20
20
* In your Activity's onCreate method, you will have to call ` setContentView ` , as usual, and also
21
21
` 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.
24
24
* More variants of ` SlidingMenuActivity ` will be coming soon, such as ` SlidingFragmentActivity ` , etc.
25
25
26
26
__ 2.__ You can use the SlidingMenu view directly in your xml layouts or programmatically in you Java code.
27
27
* This way, you can treat SlidingMenu as you would any other view type and put it in crazy awesome places like in the
28
28
rows of a ListView.
29
29
* So. Many. Possibilities.
30
30
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.
34
53
35
54
Developed By
36
55
------------
0 commit comments