Skip to content

Commit f1c2eb6

Browse files
committed
Merge pull request umano#100 from yous/master
Add layout_gravity to Usage and demo
2 parents ab8ecb0 + 26bf5db commit f1c2eb6

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

README.md

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

1010
### Usage
1111

12-
To use the layout, simply include `com.sothree.slidinguppaneldemo.SlidingUpPanelLayout` as the Root element in your activity Layout. 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.slidinguppaneldemo.SlidingUpPanelLayout` as the Root element in your activity Layout. Layout must have `layout_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.
1313
```xml
1414
<com.sothree.slidinguppanel.SlidingUpPanelLayout
1515
android:id="@+id/sliding_layout"
1616
android:layout_width="match_parent"
17-
android:layout_height="match_parent" >
17+
android:layout_height="match_parent"
18+
android:layout_gravity="bottom">
1819

1920
<TextView
2021
android:layout_width="match_parent"
@@ -78,7 +79,7 @@ allprojects {
7879
}
7980
```
8081

81-
### Other Contributors
82+
### Other Contributors
8283

8384
Jan 21, 14 - ChaYoung You ([@yous](https://github.com/yous)) - Slide from the top support
8485

demo/res/layout/activity_demo.xml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2-
xmlns:tools="http://schemas.android.com/tools"
2+
xmlns:tools="http://schemas.android.com/tools"
33
android:layout_width="match_parent"
44
android:layout_height="match_parent"
55
tools:context=".DemoActivity" >
66

77
<com.sothree.slidinguppanel.SlidingUpPanelLayout
8-
xmlns:sothree="http://schemas.android.com/apk/res-auto"
8+
xmlns:sothree="http://schemas.android.com/apk/res-auto"
99
android:id="@+id/sliding_layout"
1010
android:layout_width="match_parent"
1111
android:layout_height="match_parent"
12+
android:layout_gravity="bottom"
1213
sothree:collapsedHeight="68dp"
1314
sothree:shadowHeight="4dp"
1415
sothree:dragView="@+id/name">
@@ -28,13 +29,13 @@
2829
android:layout_width="match_parent"
2930
android:layout_height="match_parent"
3031
android:background="#eee"
31-
android:orientation="vertical"
32+
android:orientation="vertical"
3233
android:clickable="true"
3334
android:focusable="false">
3435

3536
<LinearLayout
3637
android:layout_width="match_parent"
37-
android:layout_height="68dp"
38+
android:layout_height="68dp"
3839
android:orientation="horizontal">
3940

4041
<TextView
@@ -45,15 +46,15 @@
4546
android:textSize="14sp"
4647
android:gravity="center_vertical"
4748
android:paddingLeft="10dp"/>
48-
49+
4950
<Button
5051
android:id="@+id/follow"
5152
android:layout_width="wrap_content"
5253
android:layout_height="match_parent"
5354
android:textSize="14sp"
54-
android:gravity="center_vertical|right"
55+
android:gravity="center_vertical|right"
5556
android:paddingRight="10dp"
56-
android:paddingLeft="10dp"/>
57+
android:paddingLeft="10dp"/>
5758

5859
</LinearLayout>
5960

0 commit comments

Comments
 (0)