Skip to content

Commit 300bcd6

Browse files
committed
迁移到androidx,支持开启菜单的情况下打开其他菜单或滑动,并提供布局预览属性
1 parent 39e31ab commit 300bcd6

26 files changed

Lines changed: 459 additions & 481 deletions
0 Bytes
Binary file not shown.

.idea/codeStyles/Project.xml

Lines changed: 109 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 17 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# SwipeMenuRecyclerView
2+
23
![](http://upload-images.jianshu.io/upload_images/2202079-68f9a97838a05c53.gif?imageMogr2/auto-orient/strip)
34

4-
### Usage
5+
## Usage
6+
57
<b>Step 1. Add the JitPack repository to your build file</b>
6-
Add it in your root build.gradle at the end of repositories:
8+
Add it in your root `build.gradle` at the end of repositories:
9+
710
```
811
allprojects {
912
repositories {
@@ -12,9 +15,19 @@ Add it in your root build.gradle at the end of repositories:
1215
}
1316
}
1417
```
18+
1519
<b>Step 2. Add the dependency</b>
20+
1621
```
1722
dependencies {
18-
compile 'com.github.AItsuki:SwipeMenuRecyclerView:1.1.3'
23+
compile 'com.github.AItsuki:SwipeMenuRecyclerView:1.1.4'
1924
}
2025
```
26+
27+
# 存在问题
28+
29+
## 点击事件bug
30+
31+
`SwipeItemLayout`默认设置了`clickable`为true,会拦截掉parent的点击事件。所以如果SwipeItemLayout不是RecyclerView的Item的根布局,那么通过`ViewHolder.itemView.setOnClickListener`设置的点击时间将不起作用。需要将点击事件设置到`SwipeItemLayout`上。
32+
33+

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
google()
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.1.3'
9+
classpath 'com.android.tools.build:gradle:3.6.3'
1010
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
1111
// NOTE: Do not place your application dependencies here; they belong
1212
// in the individual module build.gradle files

demo/build.gradle

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 28
4+
compileSdkVersion 29
55
defaultConfig {
66
applicationId "com.aitsuki.swipedemo"
77
minSdkVersion 15
8-
targetSdkVersion 28
8+
targetSdkVersion 29
99
versionCode 1
1010
versionName "1.0"
1111
}
@@ -16,8 +16,6 @@ android {
1616
}
1717
}
1818

19-
20-
2119
compileOptions {
2220
sourceCompatibility JavaVersion.VERSION_1_8
2321
targetCompatibility JavaVersion.VERSION_1_8
@@ -26,10 +24,8 @@ android {
2624

2725
dependencies {
2826
implementation fileTree(include: ['*.jar'], dir: 'libs')
29-
3027
implementation project(':library')
31-
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
32-
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
33-
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.40'
34-
implementation 'com.android.support:recyclerview-v7:28.0.0-rc02'
28+
implementation 'androidx.appcompat:appcompat:1.1.0'
29+
implementation 'androidx.recyclerview:recyclerview:1.1.0'
30+
implementation 'androidx.cardview:cardview:1.0.0'
3531
}

demo/src/main/AndroidManifest.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
<category android:name="android.intent.category.LAUNCHER" />
1616
</intent-filter>
1717
</activity>
18-
<activity android:name=".NativeRecyclerViewAdapterActivity" />
19-
<activity android:name=".CymChadActivity" />
2018
</application>
2119

2220
</manifest>

0 commit comments

Comments
 (0)