This commit is contained in:
代码家 2014-08-26 08:45:28 +08:00
parent e4dd40f00d
commit 14762b7aeb
1 changed files with 3 additions and 37 deletions

View File

@ -32,7 +32,7 @@ When I start to make this library, I set some goals:
```groovy
dependencies {
compile "com.daimajia.swipelayout:library:1.0.0@aar"
compile "com.daimajia.swipelayout:library:1.0.1@aar"
}
```
@ -42,51 +42,17 @@ dependencies {
<dependency>
<groupId>com.daimajia.swipelayout</groupId>
<artifactId>library</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
<type>apklib</type>
</dependency>
```
#### Eclipse
[AndroidSwipeLayout-v1.0.1.jar](https://github.com/daimajia/AndroidSwipeLayout/releases/download/v1.0.1/AndroidSwipeLayout-v1.0.1.jar)
### Step 2
Create a `SwipeLayout`:
- `SwipeLayout` must have 2 children (all should be an instance of `ViewGroup`).
```xml
<com.daimajia.swipe.SwipeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="80dp">
<!-- Bottom View Start-->
<LinearLayout
android:background="#66ddff00"
android:id="@+id/bottom_wrapper"
android:layout_width="160dp"
android:weightSum="1"
android:layout_height="match_parent">
<!--What you want to show-->
</LinearLayout>
<!-- Bottom View End-->
<!-- Surface View Start -->
<LinearLayout
android:padding="10dp"
android:background="#ffffff"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--What you want to show in SurfaceView-->
</LinearLayout>
<!-- Surface View End -->
</com.daimajia.swipe.SwipeLayout>
```
There are some preset examples: [example1](./demo/src/main/res/layout/sample1.xml), [example2](./demo/src/main/res/layout/sample2.xml), [example3](./demo/src/main/res/layout/sample3.xml).
### Step3
[Source code](./demo/src/main/java/com/daimajia/swipedemo/MyActivity.java).
[Wiki Usage](https://github.com/daimajia/AndroidSwipeLayout/wiki/usage)
## Wiki