Skip to content

Commit b1aa93e

Browse files
committed
更新配置
1 parent f27121c commit b1aa93e

File tree

6 files changed

+68
-108
lines changed

6 files changed

+68
-108
lines changed

app/build.gradle

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ android {
3636
dependencies {
3737
implementation fileTree(dir: 'libs', include: ['*.jar'])
3838
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
39-
implementation 'androidx.appcompat:appcompat:1.0.2'
40-
implementation 'androidx.recyclerview:recyclerview:1.0.0'
41-
implementation 'com.google.android.material:material:1.1.0-alpha07'
42-
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
43-
testImplementation 'junit:junit:4.12'
44-
androidTestImplementation 'androidx.test:runner:1.2.0'
45-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
39+
implementation 'androidx.appcompat:appcompat:1.2.0'
40+
implementation 'androidx.recyclerview:recyclerview:1.1.0'
41+
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
42+
implementation 'com.google.android.material:material:1.3.0-alpha04'
43+
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
44+
testImplementation 'junit:junit:4.13.2'
45+
androidTestImplementation 'androidx.test:runner:1.3.0'
46+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
4647
implementation project(":library")
4748
// implementation 'fc.nestedscrollview.androidx:library:1.0.0'
4849
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.49-androidx'

bintray.gradle

Lines changed: 0 additions & 56 deletions
This file was deleted.

build.gradle

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
ext.kotlin_version = '1.3.50'
4+
ext.kotlin_version = '1.4.30'
55
repositories {
66
google()
7-
jcenter()
7+
mavenCentral()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:4.0.0'
10+
classpath 'com.android.tools.build:gradle:4.1.2'
1111
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1212

1313
// NOTE: Do not place your application dependencies here; they belong
1414
// in the individual module build.gradle files
15-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
16-
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
15+
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
1716
}
1817
}
1918

2019
allprojects {
2120
repositories {
2221
maven { url "https://jitpack.io" }
23-
maven {
24-
url "https://dl.bintray.com/403462630/maven"
25-
}
22+
// maven {
23+
// url "https://dl.bintray.com/403462630/maven"
24+
// }
2625
google()
27-
jcenter()
26+
mavenCentral()
2827
}
2928
}
3029

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip

library/build.gradle

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
apply plugin: 'com.android.library'
2+
apply plugin: 'com.github.dcendents.android-maven'
23

3-
ext {
4-
projectName = "AndroidXFCNestedScrollView"
5-
}
6-
7-
apply from: "../bintray.gradle"
8-
9-
group="fc.nestedscrollview.androidx"
10-
version="1.0.7"
4+
group="com.github.403462630"
115

126
android {
137
compileSdkVersion 28
@@ -33,31 +27,32 @@ android {
3327
}
3428
}
3529

36-
task sourcesJar(type: Jar) {
37-
from android.sourceSets.main.java.srcDirs
38-
classifier = 'sources'
39-
}
40-
41-
task javadoc(type: Javadoc) {
42-
options.encoding = "utf-8"
43-
source = android.sourceSets.main.java.srcDirs
44-
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
45-
}
46-
47-
task javadocJar(type: Jar, dependsOn: javadoc) {
48-
classifier = 'javadoc'
49-
from javadoc.destinationDir
50-
}
51-
52-
artifacts {
53-
// archives javadocJar
54-
archives sourcesJar
55-
}
30+
//task sourcesJar(type: Jar) {
31+
// from android.sourceSets.main.java.srcDirs
32+
// classifier = 'sources'
33+
//}
34+
//
35+
//task javadoc(type: Javadoc) {
36+
// options.encoding = "utf-8"
37+
// source = android.sourceSets.main.java.srcDirs
38+
// classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
39+
//}
40+
//
41+
//task javadocJar(type: Jar, dependsOn: javadoc) {
42+
// classifier = 'javadoc'
43+
// from javadoc.destinationDir
44+
//}
45+
//
46+
//artifacts {
47+
//// archives javadocJar
48+
// archives sourcesJar
49+
//}
5650

5751
dependencies {
5852
implementation fileTree(dir: 'libs', include: ['*.jar'])
59-
testImplementation 'junit:junit:4.12'
53+
testImplementation 'junit:junit:4.13.2'
6054

61-
compileOnly 'androidx.appcompat:appcompat:1.0.2'
62-
compileOnly 'androidx.recyclerview:recyclerview:1.0.0'
55+
compileOnly 'androidx.appcompat:appcompat:1.2.0'
56+
implementation 'androidx.recyclerview:recyclerview:1.1.0'
57+
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
6358
}

library/src/main/java/com/fc/nestedscrollview/FCSwipeRefreshLayout.java

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import android.util.AttributeSet;
66
import android.view.View;
77

8+
import androidx.annotation.NonNull;
9+
import androidx.annotation.Nullable;
810
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
911

1012
import java.lang.reflect.Field;
@@ -48,18 +50,37 @@ public void onNestedScrollAccepted(View child, View target, int axes) {
4850
this.targetView = target;
4951
}
5052

53+
@Override
54+
public void onNestedPreScroll(View target, int dx, int dy, int[] consumed, int type) {
55+
super.onNestedPreScroll(target, dx, dy, consumed, type);
56+
}
57+
58+
@Override
59+
public void onNestedScroll(@NonNull View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int type, @NonNull int[] consumed) {
60+
super.onNestedScroll(target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed, type, consumed);
61+
}
62+
5163
@Override
5264
public boolean dispatchNestedPreScroll(int dx, int dy, int[] consumed, int[] offsetInWindow) {
53-
if (dy < 0 && isPullRefreshIntercept) {
54-
return false;
65+
return super.dispatchNestedPreScroll(dx, dy, consumed, offsetInWindow);
66+
}
67+
68+
@Override
69+
public void dispatchNestedScroll(int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, @Nullable int[] offsetInWindow, int type, @NonNull int[] consumed) {
70+
if (dyUnconsumed < 0 && !isRefreshing()) {
71+
// return false;
5572
} else {
56-
return super.dispatchNestedPreScroll(dx, dy, consumed, offsetInWindow);
73+
super.dispatchNestedScroll(dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed, offsetInWindow, type, consumed);
5774
}
5875
}
5976

6077
@Override
6178
public boolean dispatchNestedScroll(int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int[] offsetInWindow) {
62-
return false;
79+
if (dyUnconsumed < 0 && !isRefreshing()) {
80+
return false;
81+
} else {
82+
return super.dispatchNestedScroll(dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed, offsetInWindow);
83+
}
6384
}
6485

6586
@Override

0 commit comments

Comments
 (0)