Skip to content

Commit 3d34e98

Browse files
committed
Allow FlowLayoutManager to be compatible with minSDK = 15
1 parent 5b0a308 commit 3d34e98

2 files changed

Lines changed: 6 additions & 66 deletions

File tree

flowlayoutmanager/build.gradle

Lines changed: 5 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// to publish run ./gradlew clean bintrayUpload
22

33
apply plugin: 'com.android.library'
4-
apply plugin: 'com.github.dcendents.android-maven'
5-
apply plugin: 'com.jfrog.bintray'
64

75
project.ext {
86
libVersion = '1.2.3.2'
@@ -13,6 +11,10 @@ project.ext {
1311
siteUrl = 'https://github.com/xiaofeng-han/AndroidLibs'
1412
}
1513

14+
repositories {
15+
jcenter()
16+
}
17+
1618
group = 'com.xiaofeng.android'
1719
version = libVersion
1820

@@ -50,48 +52,13 @@ dependencies {
5052
androidTestCompile 'junit:junit:4.12'
5153
compile(group: 'com.android.support', name: 'appcompat-v7', version: supportLibVersion)
5254
compile(group: 'com.android.support', name: 'recyclerview-v7', version: supportLibVersion)
53-
androidTestCompile 'com.android.support:support-annotations:23.3.0'
55+
androidTestCompile 'com.android.support:support-annotations:25.0.0'
5456
androidTestCompile 'com.android.support.test:runner:0.5'
5557
}
5658

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

60-
install {
61-
repositories.mavenInstaller {
62-
// This generates POM.xml with proper parameters
63-
pom {
64-
project {
65-
packaging 'aar'
66-
67-
// Add your description here
68-
name 'FlowLayoutManager for android RecyclerView'
69-
url siteUrl
70-
71-
// Set your license
72-
licenses {
73-
license {
74-
name 'GPL-v3.0'
75-
url 'http://www.gnu.org/licenses/gpl-3.0.en.html'
76-
}
77-
}
78-
developers {
79-
developer {
80-
id 'xiaofeng-han'
81-
name 'Xiaofeng Han'
82-
email 'hhhanxf@gmail.com'
83-
}
84-
}
85-
scm {
86-
connection gitUrl
87-
developerConnection gitUrl
88-
url gitUrl
89-
90-
}
91-
}
92-
}
93-
}
94-
}
9562

9663
task sourcesJar(type: Jar) {
9764
from android.sourceSets.main.java.srcDirs
@@ -108,38 +75,11 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
10875
from javadoc.destinationDir
10976
}
11077

111-
11278
artifacts {
11379
archives sourcesJar
11480
archives javadocJar
11581
}
11682

117-
bintray {
118-
user = properties.getProperty('bintray.user')
119-
key = properties.getProperty('bintray.apikey')
120-
configurations = ['archives']
121-
pkg {
122-
repo = 'maven'
123-
name = 'FlowLayoutManager'
124-
userOrg = 'hhhanxf'
125-
licenses = ['GPL-3.0']
126-
vcsUrl = gitUrl
127-
githubRepo = 'xiaofeng-han/AndroidLibs'
128-
githubReleaseNotesFile = 'README.md'
129-
publish = true
130-
version {
131-
name = libVersion
132-
desc = 'FLowLayoutManager'
133-
released = new Date()
134-
vcsTag = libVersion
135-
gpg {
136-
sign = true
137-
passphrase = properties.getProperty('bintray.gpg.password')
138-
}
139-
}
140-
}
141-
}
142-
14383
task wrapper(type: Wrapper) {
14484
gradleVersion = '2.10'
14585
}

flowlayoutmanager/src/main/java/com/xiaofeng/flowlayoutmanager/FlowLayoutManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ public void onAttachedToWindow(final RecyclerView view) {
471471
view.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
472472
@Override
473473
public void onGlobalLayout() {
474-
view.getViewTreeObserver().removeOnGlobalLayoutListener(this);
474+
view.getViewTreeObserver().removeGlobalOnLayoutListener(this);
475475
cacheHelper.contentAreaWidth(layoutHelper.visibleAreaWidth());
476476
}
477477
});

0 commit comments

Comments
 (0)