From 41800dce5e7047da5e1ff26cd6a237a50044826e Mon Sep 17 00:00:00 2001 From: miomin <691292118@qq.com> Date: Wed, 2 Nov 2016 19:02:29 +0800 Subject: [PATCH] =?UTF-8?q?*=20[android]=20=E4=BF=AE=E6=AD=A3=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E6=97=B6view=E4=B8=8D=E8=83=BD=E6=BB=91=E5=8A=A8?= =?UTF-8?q?=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- build.gradle | 7 +- gradle.properties | 2 +- sample/build.gradle | 3 +- .../shswiperefreshlayout/MainActivity.java | 1 - shswiperefresh/build.gradle | 104 +++--------------- .../core/SHSwipeRefreshLayout.java | 4 +- 7 files changed, 23 insertions(+), 100 deletions(-) diff --git a/README.md b/README.md index e647b52..fe378fa 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ ``` javaScript - compile 'com.miomin:shswiperefreshlayout:1.0' + compile 'com.miomin:shswiperefreshlayout:1.2.0' ``` ------------------- diff --git a/build.gradle b/build.gradle index 13e51e9..2fea910 100644 --- a/build.gradle +++ b/build.gradle @@ -6,21 +6,16 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:2.2.2' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1' - classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } -plugins { - id "com.jfrog.bintray" version "1.7" -} - allprojects { repositories { jcenter() + maven { url "https://raw.githubusercontent.com/miomin/mvn-repo-ione/master" } } } diff --git a/gradle.properties b/gradle.properties index 1d3591c..89e0d99 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,4 +15,4 @@ # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true \ No newline at end of file +# org.gradle.parallel=true diff --git a/sample/build.gradle b/sample/build.gradle index 0a35094..a425c12 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -26,5 +26,6 @@ dependencies { compile 'com.android.support:recyclerview-v7:24.0.0' compile 'com.android.support:design:24.0.0' - compile project(':shswiperefresh') +// compile project(':shswiperefresh') + compile 'com.miomin:shswiperefreshlayout:1.2.0' } diff --git a/sample/src/main/java/com/scu/miomin/shswiperefreshlayout/MainActivity.java b/sample/src/main/java/com/scu/miomin/shswiperefreshlayout/MainActivity.java index 64fb587..596a7a3 100644 --- a/sample/src/main/java/com/scu/miomin/shswiperefreshlayout/MainActivity.java +++ b/sample/src/main/java/com/scu/miomin/shswiperefreshlayout/MainActivity.java @@ -40,7 +40,6 @@ private void initRecyclerView() { recyclerView = (RecyclerView) findViewById(R.id.recyclerView); recyclerView.setLayoutManager(new LinearLayoutManager(this)); recyclerView.setAdapter(new HomeAdapter(this, mDatas)); - // 设置item动画 recyclerView.setItemAnimator(new DefaultItemAnimator()); recyclerView.addItemDecoration(new DividerRVDecoration(this, DividerRVDecoration.VERTICAL_LIST)); diff --git a/shswiperefresh/build.gradle b/shswiperefresh/build.gradle index 54ff15d..eaee54f 100644 --- a/shswiperefresh/build.gradle +++ b/shswiperefresh/build.gradle @@ -1,17 +1,15 @@ apply plugin: 'com.android.library' -apply plugin: 'com.github.dcendents.android-maven' -apply plugin: 'com.jfrog.bintray' +apply plugin: 'maven' android { compileSdkVersion 24 buildToolsVersion "23.0.3" - resourcePrefix "miomin93" defaultConfig { minSdkVersion 14 targetSdkVersion 24 - versionCode 1 - versionName "1.0.1" + versionCode 3 + versionName "1.2.0" } buildTypes { release { @@ -27,90 +25,22 @@ dependencies { compile 'com.android.support:appcompat-v7:24.0.0' } -version = "1.0.1" - -def siteUrl = 'https://github.com/miomin/SHSwipeRefreshLayout' // 项目主页。 -def gitUrl = 'git@github.com:miomin/SHSwipeRefreshLayout.git' // Git仓库的url。 - -group = "com.miomin" - -install { - repositories.mavenInstaller { - // 生成pom.xml和参数 - pom { - project { - packaging 'aar' - name 'SHSwipeRefreshLayout For Android'// 可选,项目名称。 - description 'The Android build the framework of pull to refresh.'// 可选,项目描述。 - url siteUrl // 项目主页,这里是引用上面定义好。 - - // 软件开源协议 - licenses { - license { - name 'The Apache Software License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' - } - } +ext { + PUBLISH_GROUP_ID = 'com.miomin' + PUBLISH_ARTIFACT_ID = 'shswiperefreshlayout' + PUBLISH_VERSION = android.defaultConfig.versionName +} - //填写开发者基本信息 - developers { - developer { - id 'miomin93' // 开发者的id。 - name 'miomin93' // 开发者名字。 - email 'miomin_93@foxmail.com' // 开发者邮箱。 - } - } +uploadArchives { + repositories.mavenDeployer { + Properties properties = new Properties() + properties.load(project.rootProject.file('local.properties').newDataInputStream()) - // SCM - scm { - connection gitUrl // Git仓库地址。 - developerConnection gitUrl // Git仓库地址。 - url siteUrl // 项目主页。 - } - } + repository(url: "file://${properties.getProperty("aar.deployPath")}") + pom.project { + groupId project.PUBLISH_GROUP_ID + artifactId project.PUBLISH_ARTIFACT_ID + version project.PUBLISH_VERSION } } } - -// 生成jar包的task -task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' -} - -// 生成jarDoc的task -task javadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) - // destinationDir = file("../javadoc/") - failOnError false // 忽略注释语法错误,如果用jdk1.8你的注释写的不规范就编译不过。 -} - -// 生成javaDoc的jar -task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' - from javadoc.destinationDir -} - -artifacts { - archives javadocJar - archives sourcesJar -} - -// 这里是读取Bintray相关的信息 -Properties properties = new Properties() -properties.load(project.rootProject.file('local.properties').newDataInputStream()) -bintray { - user = properties.getProperty("bintray.user") // Bintray的用户名。 - key = properties.getProperty("bintray.apikey") // Bintray的ApiKey。 - - configurations = ['archives'] - pkg { - repo = "maven" // 上传到maven库。 - name = "shswipeRefreshLayout" // 发布到Bintray上的项目名字 - websiteUrl = siteUrl - vcsUrl = gitUrl - licenses = ["Apache-2.0"] - publish = true // 是否是公开项目。 - } -} \ No newline at end of file diff --git a/shswiperefresh/src/main/java/com/scu/miomin/shswiperefresh/core/SHSwipeRefreshLayout.java b/shswiperefresh/src/main/java/com/scu/miomin/shswiperefresh/core/SHSwipeRefreshLayout.java index b73c08b..5cc1d60 100755 --- a/shswiperefresh/src/main/java/com/scu/miomin/shswiperefresh/core/SHSwipeRefreshLayout.java +++ b/shswiperefresh/src/main/java/com/scu/miomin/shswiperefresh/core/SHSwipeRefreshLayout.java @@ -233,9 +233,7 @@ public boolean onInterceptTouchEvent(MotionEvent ev) { if ((!mPullRefreshEnable && !mPullLoadEnable)) { return false; } - if (mRefreshing) { - return true; - } + return super.onInterceptTouchEvent(ev); }