Skip to content

Commit

Permalink
* [android] 修正刷新时view不能滑动的Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
miomin committed Nov 2, 2016
1 parent 56173bc commit 41800dc
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 100 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

``` javaScript
compile 'com.miomin:shswiperefreshlayout:1.0'
compile 'com.miomin:shswiperefreshlayout:1.2.0'
```

-------------------
Expand Down
7 changes: 1 addition & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
# org.gradle.parallel=true
3 changes: 2 additions & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
104 changes: 17 additions & 87 deletions shswiperefresh/build.gradle
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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 = '[email protected]: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 '[email protected]' // 开发者邮箱。
}
}
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 // 是否是公开项目。
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,7 @@ public boolean onInterceptTouchEvent(MotionEvent ev) {
if ((!mPullRefreshEnable && !mPullLoadEnable)) {
return false;
}
if (mRefreshing) {
return true;
}

return super.onInterceptTouchEvent(ev);
}

Expand Down

0 comments on commit 41800dc

Please sign in to comment.