Skip to content

Commit

Permalink
Fixed #1 - upload to jcenter
Browse files Browse the repository at this point in the history
  • Loading branch information
Wu Jing committed May 29, 2015
1 parent b6d61b1 commit 6de089c
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 25 deletions.
55 changes: 32 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,47 @@ I implement this as a **FlyRefresh** layout. The content of the layout can be an
* Support custom refresh animation

#How to use

Add Gradle dependency:

```gradle
dependencies {
compile 'com.race604.flyrefresh:1.0.0'
}
```

The basie usage in layou xml liks blow:

```xml
<com.race604.flyrefresh.FlyRefreshLayout
android:id="@+id/fly_layout"
<com.race604.flyrefresh.FlyRefreshLayout
android:id="@+id/fly_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.v7.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.v7.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="24dp"
android:background="#FFFFFF"/>
</com.race604.flyrefresh.FlyRefreshLayout>
android:layout_height="match_parent"
android:paddingTop="24dp"
android:background="#FFFFFF"/>
</com.race604.flyrefresh.FlyRefreshLayout>
```

Or you can use `PullHeaderLayout` for more cofigurations, you can set custome attributes below:

```xml
<declare-styleable name="PullHeaderLayout">
<!-- hader size -->
<attr name="phl_header_height" format="dimension" />
<attr name="phl_header_expand_height" format="dimension" />
<attr name="phl_header_shrink_height" format="dimension" />
<!-- header view id -->
<attr name="phl_header" format="reference" />
<!-- content view id -->
<attr name="phl_content" format="reference" />
<!-- Float action button icon -->
<attr name="phl_action" format="reference" />
</declare-styleable>
<declare-styleable name="PullHeaderLayout">
<!-- hader size -->
<attr name="phl_header_height" format="dimension" />
<attr name="phl_header_expand_height" format="dimension" />
<attr name="phl_header_shrink_height" format="dimension" />
<!-- header view id -->
<attr name="phl_header" format="reference" />
<!-- content view id -->
<attr name="phl_content" format="reference" />
<!-- Float action button icon -->
<attr name="phl_action" format="reference" />
</declare-styleable>
```
For more, please turn to the source code.

Expand Down
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.github.dcendents:android-maven-plugin:1.2'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
76 changes: 75 additions & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

version = "1.0.0"

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
resourcePrefix "flyrefresh__"

defaultConfig {
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
versionName version
}
buildTypes {
release {
Expand All @@ -23,3 +28,72 @@ dependencies {
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.getbase:floatingactionbutton:1.9.0'
}

def siteUrl = 'https://github.com/race604/FlyRefresh'
def gitUrl = 'https://github.com/race604/FlyRefresh.git'
group = "com.race604.flyrefresh"

install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
// Add your description here
name 'A awsome pull to refresh widget'
url siteUrl
// Set your license
licenses {
license {
name 'The MIT License (MIT)'
url 'http://opensource.org/licenses/MIT'
}
}
developers {
developer {
id 'race604'
name 'Race604'
email '[email protected]'
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
configurations = ['archives']
pkg {
repo = "maven"
name = "FlyRefresh"
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["MIT"]
publish = true
}
}
5 changes: 4 additions & 1 deletion library/library.iml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":library" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="FlyRefresh" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<module external.linked.project.id=":library" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="com.race604.flyrefresh" external.system.module.version="1.0.0" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
Expand Down Expand Up @@ -63,6 +63,7 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/docs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
Expand All @@ -82,7 +83,9 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/libs" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/poms" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
Expand Down

0 comments on commit 6de089c

Please sign in to comment.