-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
release 1.0.2, publish lib to jcenter.
- Loading branch information
Showing
5 changed files
with
110 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { | ||
|
@@ -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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters