Skip to content

Commit

Permalink
release 1.0.2, publish lib to jcenter.
Browse files Browse the repository at this point in the history
  • Loading branch information
misakuo committed Jan 20, 2016
1 parent f552fcd commit 36c0048
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 10 deletions.
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,42 @@
# TagCloudView
***
###简介
TagCloudView是一个完全基于Android ViewGroup编写的控件,支持将一组View展示为一个3D球形集合,并支持全方向滚动。
###UI效果
![screenshot](https://raw.githubusercontent.com/misakuo/3dTagCloudAndroid/master/screenshot.gif)

###使用
##### Eclipse
copy代码,或转向Android Studio
##### Android Studio / IDEA
1.`build.gradle`中添加
```
compile 'com.moxun:tagcloudlib:1.0.2'
```

2. 在布局文件中引入
```<com.moxun.tagcloudlib.view.TagCloudView/>```

3. 设置Adapter
继承`TagsAdapter`,实现以下方法
**public int getCount();**
*返回Tag数量*
**public View getView(Context context, int position, ViewGroup parent);**
*返回每个Tag实例*
**public Object getItem(int position);**
*返回Tag数据*
**public int getPopularity(int position);**
*针对每个Tag返回一个权重值,该值与ThemeColor和Tag初始大小有关*
**public void onThemeColorChanged(View view,int themeColor);**
*Tag主题色发生变化时会回调该方法*
4. 定制属性

| 属性 | xml | 代码 |值类型|
|:------------: |:-------------:| :----:|:-:
| 自动滚动 | app:autoScrollMode | setAutoScrollMode(int mode) |enum [disable,uniform,decelerate]
| 半径百分比 | app:radiusPercent | setRadiusPercent(float percent) |float [0,1]
| 滚动速度 | app:scrollSpeed | setScrollSpeed(float scrollSpeed) |float [0,+]
|起始颜色|app:lightColor|setLightColor(int color)|int
|终止颜色|app:darkColor|setDarkColor(int color)|int

***
欢迎提交PR
3 changes: 1 addition & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.+'
compile project(path: ':tagcloudlib')
compile 'com.moxun:tagcloudlib:1.0.2'
}
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:2.0.0-alpha5'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
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
77 changes: 71 additions & 6 deletions tagcloudlib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

version = "1.0.2"
android {
compileSdkVersion 'Google Inc.:Google APIs:23'
buildToolsVersion "23.0.2"

defaultConfig {
minSdkVersion 16
minSdkVersion 11
targetSdkVersion 23
versionCode 1
versionName "1.0"
versionName version
}
buildTypes {
release {
Expand All @@ -17,9 +19,72 @@ android {
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.+'
}
def siteUrl = 'https://github.com/misakuo/3dTagCloudAndroid' // 项目的主页
def gitUrl = 'https://github.com/misakuo/3dTagCloudAndroid.git' // Git仓库的url
group = "com.moxun" // Maven Group ID for the artifact,一般填你唯一的包名
install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
// Add your description here
name 'Android 3D TagCloud component' //项目描述
url siteUrl
// Set your license
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'misakuo' //填写开发者基本信息
name 'moxun'
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" //发布到Bintray的那个仓库里,默认账户有四个库,我们这里上传到maven库
name = "tagcloudview" //发布到Bintray上的项目名字
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
publish = true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import android.os.Handler;
import android.os.Looper;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
Expand Down

0 comments on commit 36c0048

Please sign in to comment.