Skip to content

Commit bcdf672

Browse files
committed
Update README.md
1 parent 0445497 commit bcdf672

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@ As seen in Umano ([http://umanoapp.com](http://umanoapp.com)):
99

1010
### Usage
1111

12-
To use the layout, simply include `com.sothree.slidinguppanel.SlidingUpPanelLayout` as the Root element in your activity Layout. Layout must have `gravity` set to either `top` or `bottom`. Make sure that it has two children. The first child is your main layout. The second child is your layout for the sliding up panel. Both children should have width and height set to `match_parent`. For more information, please refer to the sample code.
12+
To use the layout, simply include `com.sothree.slidinguppanel.SlidingUpPanelLayout` as the Root element in your activity Layout. Layout must have `gravity` set to either `top` or `bottom`. Make sure that it has two children. The first child is your main layout. The second child is your layout for the sliding up panel. The main layout should have the width and the height set to `match_parent`. The sliding layout should have the width set to `match_parent` and the height set to either `match_parent` or the max desireable height. For more information, please refer to the sample code.
1313
```xml
1414
<com.sothree.slidinguppanel.SlidingUpPanelLayout
15+
xmlns:sothree="http://schemas.android.com/apk/res-auto"
1516
android:id="@+id/sliding_layout"
1617
android:layout_width="match_parent"
1718
android:layout_height="match_parent"
18-
android:gravity="bottom">
19+
android:gravity="bottom"
20+
sothree:panelHeight="68dp"
21+
sothree:shadowHeight="4dp">
1922

2023
<TextView
2124
android:layout_width="match_parent"
@@ -37,14 +40,15 @@ For smooth interaction with the ActionBar, make sure that `windowActionBarOverla
3740
<style name="AppTheme">
3841
<item name="android:windowActionBarOverlay">true</item>
3942
</style>
43+
However, in this case you would likely want to add a top margin to your main layout of `?android:attr/actionBarSize`.
4044
```
41-
### Additional Features
45+
### Additional Features and Customization
4246

43-
You can restrict the drag area of the sliding panel to a specific view by using the `setDragView` method. Otherwise, the whole panel will be slideable and it will intercept all clicks.
47+
You can restrict the drag area of the sliding panel to a specific view by using the `setDragView` method or `dragView` attribute. Otherwise, the whole panel will be slideable and it will intercept all clicks.
4448

45-
You can change the panel height by using the `setPanelHeight` method.
49+
You can change the panel height by using the `setPanelHeight` method or `panelHeight` attribute.
4650

47-
You can change the panel shadow by using the `setShadowDrawable` method. No shadow is displayed by default.
51+
If you would like to hide the shadow above the sliding panel, set `shadowHeight` attribute to 0.
4852

4953
You can disable sliding by using `setSlidingEnabled` method. This can be useful if you want to show\hide panel only from the code. By default sliding is enabled.
5054

@@ -54,6 +58,8 @@ You can set a `PanelSlideListener` to monitor events about sliding panes.
5458

5559
You can also make the panel slide from the top by changing the `layout_gravity` attribute of the layout to `top`.
5660

61+
By default, the panel pushes up the main content. You can make it overlay the main content by using `setOverlayed` method or `overlay` attribute. This is useful if you would like to make the sliding layout semi-transparent.
62+
5763
### Implementation
5864

5965
This code is heavily based on the opened-sourced [SlidingPaneLayout](http://developer.android.com/reference/android/support/v4/widget/SlidingPaneLayout.html) component from the r13 of the Android Support Library. Thanks Android team!

0 commit comments

Comments
 (0)