Skip to content

Commit

Permalink
Publish lib to JCenter
Browse files Browse the repository at this point in the history
  • Loading branch information
dkzwm committed Jul 12, 2018
1 parent c295292 commit 53b4d4e
Show file tree
Hide file tree
Showing 9 changed files with 381 additions and 27 deletions.
21 changes: 17 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ buildscript {

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}

Expand All @@ -29,15 +30,27 @@ ext {
buildToolsVersion: "27.0.3",
minSdkVersion : 11,
targetSdkVersion : 27,
versionCode : 51,
versionName : "1.6.5"
versionCode : 52,
versionName : "1.6.5-beta-1"
]
libs = [
recyclerview: "com.android.support:recyclerview-v7:27.1.1",
design: "com.android.support:design:27.1.1",
appcompatV7: "com.android.support:appcompat-v7:27.1.1",
supportV13: "com.android.support:support-v13:27.1.1",
supportV13: "com.android.support:support-v13:27.1.1"
]
bintray=[
siteUrl : 'https://github.com/dkzwm/SmoothRefreshLayout',
gitUrl :'https://github.com/dkzwm/SmoothRefreshLayout.git',
groupId :"me.dkzwm.widget.srl",
libVersion : android.versionName,
developerId : "dkzwm",
developerName : "Zhang Weiming",
developerEmail : "aidkzwm@gmail.com",
licenseName : "MIT License",
licenseUrl :"https://opensource.org/licenses/MIT",
]
allLicenses =['MIT']
}

task clean(type: Delete) {
Expand Down
64 changes: 58 additions & 6 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

group = 'com.github.dkzwm'
group = rootProject.ext.bintray['groupId']
version=rootProject.ext.android['versionName']

android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
Expand All @@ -16,6 +18,7 @@ android {
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
Expand All @@ -25,10 +28,6 @@ dependencies {
}


tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}

task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
Expand All @@ -41,6 +40,7 @@ task javadoc(type: Javadoc) {
classpath += configurations.compile
}

// build a jar with javadoc
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
Expand All @@ -49,4 +49,56 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
artifacts {
archives sourcesJar
archives javadocJar
}
}

install {
repositories.mavenInstaller {
pom {
project {
packaging 'aar'
name 'SmoothRefreshLayout-Core'
groupId rootProject.ext.bintray['groupId']
url rootProject.ext.bintray['siteUrl']
artifactId 'core'
description 'A highly efficient refresh library for Android, Can support all Views.'
licenses {
license {
name rootProject.ext.bintray['licenseName']
url rootProject.ext.bintray['licenseUrl']
}
}
developers {
developer {
id rootProject.ext.bintray['developerId']
name rootProject.ext.bintray['developerName']
email rootProject.ext.bintray['developerEmail']
}
}
scm {
connection rootProject.ext.bintray['gitUrl']
developerConnection rootProject.ext.bintray['gitUrl']
url rootProject.ext.bintray['siteUrl']
}
}
}
}
}

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.key")

configurations = ['archives']
pkg {
repo = 'maven'
name = 'core'
desc = 'A highly efficient refresh library for Android, Can support all Views.'
websiteUrl = rootProject.ext.bintray['siteUrl']
vcsUrl = rootProject.ext.bintray['gitUrl']
licenses = rootProject.ext.allLicenses
publish = true
}
}
16 changes: 13 additions & 3 deletions core/src/main/java/me/dkzwm/widget/srl/SmoothRefreshLayout.java
Original file line number Diff line number Diff line change
Expand Up @@ -738,10 +738,20 @@ protected void drawHeaderBackground(Canvas canvas) {
}

protected void drawFooterBackground(Canvas canvas) {
final int top = Math.max(getHeight() - getPaddingBottom() - mIndicator
.getCurrentPos(), getPaddingTop());
final int top;
final int bottom;
if (mTargetView != null) {
final LayoutParams lp = (LayoutParams) mTargetView.getLayoutParams();
bottom = getPaddingTop() + lp.topMargin + mTargetView.getMeasuredHeight() + lp
.bottomMargin;
top = bottom - mIndicator.getCurrentPos();
} else {
top = Math.max(getHeight() - getPaddingBottom() - mIndicator.getCurrentPos(),
getPaddingTop());
bottom = getHeight() - getPaddingBottom();
}
canvas.drawRect(getPaddingLeft(), top, getWidth() - getPaddingRight(),
getHeight() - getPaddingBottom(), mBackgroundPaint);
bottom, mBackgroundPaint);
}

@ViewCompat.ScrollAxis
Expand Down
58 changes: 56 additions & 2 deletions ext-classic/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

group = 'com.github.dkzwm'
group = rootProject.ext.bintray['groupId']
version=rootProject.ext.android['versionName']

android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
Expand Down Expand Up @@ -48,4 +50,56 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
artifacts {
archives sourcesJar
archives javadocJar
}
}

install {
repositories.mavenInstaller {
pom {
project {
packaging 'aar'
name 'SmoothRefreshLayout-ClassicKit'
groupId rootProject.ext.bintray['groupId']
url rootProject.ext.bintray['siteUrl']
artifactId 'ext-classic'
description 'Classic style view kit for SmoothRefreshLayout'
licenses {
license {
name rootProject.ext.bintray['licenseName']
url rootProject.ext.bintray['licenseUrl']
}
}
developers {
developer {
id rootProject.ext.bintray['developerId']
name rootProject.ext.bintray['developerName']
email rootProject.ext.bintray['developerEmail']
}
}
scm {
connection rootProject.ext.bintray['gitUrl']
developerConnection rootProject.ext.bintray['gitUrl']
url rootProject.ext.bintray['siteUrl']
}
}
}
}
}

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.key")

configurations = ['archives']
pkg {
repo = 'maven'
name = 'ext-classic'
desc = 'Classic style view kit for SmoothRefreshLayout'
websiteUrl = rootProject.ext.bintray['siteUrl']
vcsUrl = rootProject.ext.bintray['gitUrl']
licenses = rootProject.ext.allLicenses
publish = true
}
}
60 changes: 57 additions & 3 deletions ext-horizontal/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

group = 'com.github.dkzwm'
group = rootProject.ext.bintray['groupId']
version=rootProject.ext.android['versionName']

android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
Expand Down Expand Up @@ -33,7 +35,7 @@ task sourcesJar(type: Jar) {
}

task javadoc(type: Javadoc) {
failOnError false
failOnError false
source = android.sourceSets.main.java.sourceFiles
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += configurations.compile
Expand All @@ -48,4 +50,56 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
artifacts {
archives sourcesJar
archives javadocJar
}
}

install {
repositories.mavenInstaller {
pom {
project {
packaging 'aar'
name 'SmoothRefreshLayout-HorizontalExtension'
groupId rootProject.ext.bintray['groupId']
url rootProject.ext.bintray['siteUrl']
artifactId 'ext-horizontal'
description 'Horizontal refresh extension of SmoothRefreshLayout'
licenses {
license {
name rootProject.ext.bintray['licenseName']
url rootProject.ext.bintray['licenseUrl']
}
}
developers {
developer {
id rootProject.ext.bintray['developerId']
name rootProject.ext.bintray['developerName']
email rootProject.ext.bintray['developerEmail']
}
}
scm {
connection rootProject.ext.bintray['gitUrl']
developerConnection rootProject.ext.bintray['gitUrl']
url rootProject.ext.bintray['siteUrl']
}
}
}
}
}

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.key")

configurations = ['archives']
pkg {
repo = 'maven'
name = 'ext-horizontal'
desc = 'Horizontal refresh extension of SmoothRefreshLayout'
websiteUrl = rootProject.ext.bintray['siteUrl']
vcsUrl = rootProject.ext.bintray['gitUrl']
licenses = rootProject.ext.allLicenses
publish = true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,18 @@ protected void drawHeaderBackground(Canvas canvas) {

@Override
protected void drawFooterBackground(Canvas canvas) {
final int left = Math.max(getWidth() - getPaddingRight() - mIndicator
.getCurrentPos(), getPaddingLeft());
canvas.drawRect(left, getPaddingTop(), getWidth() - getPaddingRight(),
final int left,right;
if (mTargetView != null) {
final LayoutParams lp = (LayoutParams) mTargetView.getLayoutParams();
right = getPaddingLeft() + lp.leftMargin + mTargetView.getMeasuredWidth() + lp
.rightMargin;
left = right - mIndicator.getCurrentPos();
} else {
left = Math.max(getWidth() - getPaddingRight() - mIndicator
.getCurrentPos(), getPaddingLeft());
right = getWidth() - getPaddingRight();
}
canvas.drawRect(left, getPaddingTop(), right,
getHeight() - getPaddingBottom(), mBackgroundPaint);
}

Expand Down
Loading

0 comments on commit 53b4d4e

Please sign in to comment.