Skip to content

Commit da1aed6

Browse files
author
zhanghongyang01
committed
【fixbug】#97,#95,#92,#90,#85,#83,#80
1 parent 78b30fc commit da1aed6

File tree

21 files changed

+339
-458
lines changed

21 files changed

+339
-458
lines changed

.idea/.name

Lines changed: 0 additions & 1 deletion
This file was deleted.

.idea/compiler.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/encodings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 2 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

FlowLayout.iml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module external.linked.project.id="FlowLayout" external.linked.project.path="$MODULE_DIR$" external.root.project.path="/Volumes/Macintosh HD/Volumes/Macintosh HD/Users/zhanghongyang01/git-repo/mime/FlowLayout" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
3+
<component name="FacetManager">
4+
<facet type="java-gradle" name="Java-Gradle">
5+
<configuration>
6+
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
7+
<option name="BUILDABLE" value="false" />
8+
</configuration>
9+
</facet>
10+
</component>
11+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
12+
<exclude-output />
13+
<content url="file://$MODULE_DIR$">
14+
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
15+
</content>
16+
<orderEntry type="inheritedJdk" />
17+
<orderEntry type="sourceFolder" forTests="false" />
18+
</component>
19+
</module>

README.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Android流式布局,支持单选、多选等,适合用于产品标签等。
2323

2424
```java
2525
dependencies {
26-
compile 'com.zhy:flowlayout-lib:1.0.3'
26+
compile 'com.hyman:flowlayout-lib:1.1.1'
2727
}
2828
```
2929

@@ -43,7 +43,9 @@ dependencies {
4343
支持属性:
4444

4545
`max_select`:-1为不限制选择数量,>=1的数字为控制选择tag的数量
46-
`auto_select_effect` 是否开启默认的选中效果,即为selector中设置的效果,默认为true;如果设置为false,则无选中效果,需要自己在回调中处理。
46+
47+
支持通过state=checked来控制选中和取消,也可以自己在Adapter
48+
的onSelected和unSelected中分别处理显示。
4749

4850
###设置数据
4951

@@ -61,12 +63,11 @@ mFlowLayout.setAdapter(new TagAdapter<String>(mVals)
6163
});
6264
```
6365

66+
6467
getView中回调,类似ListView等用法。
6568

6669
### 对于选中状态
6770

68-
你还在复杂的写代码设置选中后标签的显示效果么,翔哥说No!
69-
7071
```java
7172
<?xml version="1.0" encoding="utf-8"?>
7273
<selector xmlns:android="http://schemas.android.com/apk/res/android">
@@ -81,6 +82,22 @@ getView中回调,类似ListView等用法。
8182
设置个background,上面一个状态为android:state_checked,另一个为正常。写写布局文件我都嫌慢,怎么能写一堆代码控制效果,设置改个效果,岂不是没时间dota了。
8283

8384

85+
也可以不依赖state_checked,在下面的回调中自行设置:
86+
87+
```
88+
#Adapter
89+
@Override
90+
public void onSelected(int position, View view) {
91+
super.onSelected(position, view);
92+
}
93+
94+
@Override
95+
public void unSelected(int position, View view) {
96+
super.unSelected(position, view);
97+
}
98+
```
99+
100+
84101
###事件
85102

86103
```java

build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:1.2.3'
9-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
10-
classpath 'com.github.dcendents:android-maven-plugin:1.2'
8+
classpath 'com.android.tools.build:gradle:2.2.0'
9+
classpath 'com.novoda:bintray-release:0.3.4'
1110

1211
// NOTE: Do not place your application dependencies here; they belong
1312
// in the individual module build.gradle files

flowlayout-lib/build.gradle

Lines changed: 11 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
apply plugin: 'com.android.library'
2-
apply plugin: 'com.github.dcendents.android-maven'
3-
apply plugin: 'com.jfrog.bintray'
2+
apply plugin: 'com.novoda.bintray-release'
43

5-
version = "1.0.3"
64
android {
7-
compileSdkVersion 22
8-
buildToolsVersion "23.0.0 rc3"
5+
compileSdkVersion 25
6+
buildToolsVersion "25.0.3"
97

108
defaultConfig {
119
minSdkVersion 10
12-
targetSdkVersion 22
10+
targetSdkVersion 25
1311
versionCode 1
1412
versionName "1.0"
1513
}
@@ -23,78 +21,13 @@ android {
2321

2422
dependencies {
2523
compile fileTree(dir: 'libs', include: ['*.jar'])
26-
compile 'com.android.support:appcompat-v7:22.2.1'
2724
}
2825

29-
def siteUrl = 'https://github.com/hongyangAndroid/FlowLayout' // #CONFIG# // project homepage
30-
def gitUrl = 'https://github.com/hongyangAndroid/FlowLayout.git' // #CONFIG# // project git
31-
group = "com.zhy"
32-
33-
install {
34-
repositories.mavenInstaller {
35-
// This generates POM.xml with proper parameters
36-
pom {
37-
project {
38-
packaging 'aar'
39-
name 'flowlayout' // #CONFIG# // project title
40-
url siteUrl
41-
// Set your license
42-
licenses {
43-
license {
44-
name 'The Apache Software License, Version 2.0'
45-
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
46-
}
47-
}
48-
developers {
49-
developer {
50-
id 'hongyangAndroid' // #CONFIG# // your user id (you can write your nickname)
51-
name 'ZhangHongyang' // #CONFIG# // your user name
52-
email '[email protected]' // #CONFIG# // your email
53-
}
54-
}
55-
scm {
56-
connection gitUrl
57-
developerConnection gitUrl
58-
url siteUrl
59-
}
60-
}
61-
}
62-
}
63-
}
64-
65-
task sourcesJar(type: Jar) {
66-
from android.sourceSets.main.java.srcDirs
67-
classifier = 'sources'
68-
}
69-
70-
task javadoc(type: Javadoc) {
71-
source = android.sourceSets.main.java.srcDirs
72-
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
26+
publish {
27+
userOrg = 'hongyangandroid'//bintray.com用户名
28+
groupId = 'com.hyman'//jcenter上的路径
29+
artifactId = 'flowlayout-lib'//项目名称
30+
publishVersion = '1.1.1'//版本号
31+
desc = 'save time'
32+
website = 'https://github.com/hongyangAndroid/FlowLayout'
7333
}
74-
75-
task javadocJar(type: Jar, dependsOn: javadoc) {
76-
classifier = 'javadoc'
77-
from javadoc.destinationDir
78-
}
79-
80-
artifacts {
81-
archives javadocJar
82-
archives sourcesJar
83-
}
84-
85-
Properties properties = new Properties()
86-
properties.load(project.rootProject.file('local.properties').newDataInputStream())
87-
bintray {
88-
user = properties.getProperty("bintray.user")
89-
key = properties.getProperty("bintray.apikey")
90-
configurations = ['archives']
91-
pkg {
92-
repo = "maven"
93-
name = "flowlayout" // #CONFIG# project name in jcenter
94-
websiteUrl = siteUrl
95-
vcsUrl = gitUrl
96-
licenses = ["Apache-2.0"]
97-
publish = true
98-
}
99-
}
100-

0 commit comments

Comments
 (0)