|
1 |
| -# Android Swipe Layout [](https://travis-ci.org/daimajia/AndroidSwipeLayout) |
| 1 | +# Android Swipe Layout |
2 | 2 |
|
3 |
| -[](https://gitter.im/daimajia/AndroidSwipeLayout?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) |
| 3 | +<p> |
4 | 4 |
|
5 |
| -[](https://insight.io/github.com/daimajia/AndroidSwipeLayout) |
| 5 | +[][actions] |
| 6 | +[][releases] |
| 7 | +[][mavencentral] |
6 | 8 |
|
7 |
| -This is the brother of [AndroidViewHover](https://github.com/daimajia/AndroidViewHover). |
| 9 | +</p> |
8 | 10 |
|
9 |
| -One year ago, I started to make an app named [EverMemo](https://play.google.com/store/apps/details?id=com.zhan_dui.evermemo) with my good friends. The designer gave me a design picture, the design like this: |
| 11 | +This is an **AndroidX implementation** for [daimajia's AndroidSwipeLayout](https://github.com/daimajia/AndroidSwipeLayout). |
10 | 12 |
|
11 |
| - |
| 13 | +By using this version, you can safety turn off [Jetifier][jetifier] in your project. |
12 | 14 |
|
13 |
| -I found it was pretty hard to achieve this effect, cause you had to be very familiar with the Android Touch System. It was beyond my ability that moment, and I also noticed that there was no such a concept library... |
14 |
| - |
15 |
| -Time passed, finally...as you see right now. |
16 |
| - |
17 |
| -## Demo |
18 |
| - |
19 |
| - |
20 |
| - |
21 |
| -[Download Demo](https://github.com/daimajia/AndroidSwipeLayout/releases/download/v1.1.8/AndroidSwipeLayout-v1.1.8.apk) |
22 |
| - |
23 |
| -Before I made this, I actually found some libraries (eg.[SwipeListView](https://github.com/47deg/android-swipelistview)) that helps developers to integrate swiping with your UI component. |
24 |
| - |
25 |
| -But it only works in `ListView`, and it has too many issues that they never care. What a pity! |
26 |
| - |
27 |
| -When I start to make this library, I set some goals: |
| 15 | +## Usage |
28 | 16 |
|
29 |
| -- Can be easily integrated in anywhere, ListView, GridView, ViewGroup etc. |
30 |
| -- Can receive `onOpen`,`onClose`,`onUpdate` callbacks. |
31 |
| -- Can notifiy the hidden children how much they have shown. |
32 |
| -- Can be nested each other. |
33 |
| -- Can handle complicate situation, just like [this](https://camo.githubusercontent.com/d145d9a9508b3d204b70882c05bc3d9bd433883c/687474703a2f2f7777312e73696e61696d672e636e2f6c617267652f3631306463303334677731656b686f6a7379326172673230386530366e6774312e676966). |
| 17 | +#### Gradle |
34 | 18 |
|
| 19 | +```properties |
| 20 | +# gradle.properties |
35 | 21 |
|
36 |
| -## Usage |
| 22 | +android.useAndroidX=true |
| 23 | +android.enableJetifier=false |
| 24 | +``` |
37 | 25 |
|
38 |
| -### Step 1 |
39 |
| -#### Gradle |
| 26 | +```kotlin |
| 27 | +// build.gradle.kts (app module) |
40 | 28 |
|
41 |
| -```groovy |
42 | 29 | dependencies {
|
43 |
| - compile 'com.android.support:recyclerview-v7:21.0.0' |
44 |
| - compile 'com.android.support:support-v4:20.+' |
45 |
| - compile "com.daimajia.swipelayout:library:1.2.0@aar" |
| 30 | + implementation("com.axzae:swipelayout:1.3.0") |
46 | 31 | }
|
47 | 32 | ```
|
48 | 33 |
|
49 |
| -#### Maven |
50 |
| - |
| 34 | +#### Layout file |
51 | 35 | ```xml
|
52 |
| -<dependency> |
53 |
| - <groupId>com.google.android</groupId> |
54 |
| - <artifactId>support-v4</artifactId> |
55 |
| - <version>r6</version> |
56 |
| -</dependency> |
57 |
| -<dependency> |
58 |
| - <groupId>com.google.android</groupId> |
59 |
| - <artifactId>recyclerview-v7</artifactId> |
60 |
| - <version>21.0.0</version> |
61 |
| -</dependency> |
62 |
| -<dependency> |
63 |
| - <groupId>com.daimajia.swipelayout</groupId> |
64 |
| - <artifactId>library</artifactId> |
65 |
| - <version>1.2.0</version> |
66 |
| - <type>apklib</type> |
67 |
| -</dependency> |
| 36 | +<com.daimajia.swipe.SwipeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 37 | + xmlns:app="http://schemas.android.com/apk/res-auto" |
| 38 | + xmlns:tools="http://schemas.android.com/tools" |
| 39 | + android:id="@+id/layout_swipe" |
| 40 | + android:layout_width="match_parent" |
| 41 | + android:layout_height="wrap_content" |
| 42 | + app:drag_edge="right" |
| 43 | + app:show_mode="pull_out"> |
| 44 | + |
| 45 | + <!-- <LinearLayout /> --> |
| 46 | + |
| 47 | +</com.daimajia.swipe.SwipeLayout> |
68 | 48 | ```
|
69 | 49 |
|
70 |
| -#### Eclipse |
71 |
| - |
72 |
| -[AndroidSwipeLayout-v1.1.8.jar](https://github.com/daimajia/AndroidSwipeLayout/releases/download/v1.1.8/AndroidSwipeLayout-v1.1.8.jar) |
73 |
| - |
74 |
| -### Step 2 |
75 |
| - |
76 |
| -**Make sure to use the internal adapter instead of your own!** |
77 |
| - |
78 |
| -[Wiki Usage](https://github.com/daimajia/AndroidSwipeLayout/wiki/usage) |
79 |
| - |
80 |
| -## Wiki |
81 |
| - |
82 |
| -[Go to Wiki](https://github.com/daimajia/AndroidSwipeLayout/wiki) |
83 |
| - |
84 |
| -## About me |
85 | 50 |
|
86 |
| -A student in mainland China. |
| 51 | +## See Also |
87 | 52 |
|
88 |
| -Welcome to [offer me an internship ](mailto:[email protected]). If you have any new idea about this project, feel free to [contact me ](mailto:[email protected]). :smiley: |
| 53 | +- [Usage](https://github.com/daimajia/AndroidSwipeLayout/wiki/Usage) |
| 54 | +- [SwipeAdapter](https://github.com/daimajia/AndroidSwipeLayout/wiki/SwipeAdapter) |
89 | 55 |
|
| 56 | +[mavencentral]: https://central.sonatype.com/artifact/com.axzae/swipelayout |
| 57 | +[actions]: https://github.com/axzae/android-swipe-layout/actions |
| 58 | +[releases]: https://github.com/axzae/android-swipe-layout/releases |
| 59 | +[jetifier]: https://developer.android.com/tools/jetifier |
0 commit comments