-
Notifications
You must be signed in to change notification settings - Fork 418
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
280 additions
and
60 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
language: android | ||
|
||
android: | ||
components: | ||
- build-tools-20.0.0 | ||
- android-19 | ||
|
||
jdk: oraclejdk7 | ||
|
||
script: | ||
- ./gradlew check |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
buildscript { | ||
repositories { | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:1.+' | ||
} | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
jcenter() | ||
mavenCentral(); | ||
maven { | ||
url 'https://oss.sonatype.org/content/repositories/releases' | ||
} | ||
maven { | ||
url 'https://oss.sonatype.org/content/repositories/snapshots' | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
### GridView with Header and Footer | ||
|
||
![Screen Shot](https://raw.githubusercontent.com/liaohuqiu/android-GridViewWithHeaderAndFooter/master/screen-shot.png) | ||
|
||
只有一个文件,你可以将源代码放入你的项目中。另外项目发布到了Maven中央库,你可以通过`pom`或者`gradle`引入。 | ||
|
||
#### Maven | ||
|
||
```xml | ||
<dependency> | ||
<groupId>in.srain.cube</groupId> | ||
<artifactId>grid-view-with-header-footer</artifactId> | ||
<type>jar</type> | ||
<version>{lib_version}</version> | ||
</dependency> | ||
``` | ||
|
||
#### Gradle | ||
|
||
``` groovy | ||
compile 'in.srain.cube:grid-view-with-header-footer:{lib_version}' | ||
``` | ||
|
||
### 使用示例 | ||
|
||
```java | ||
GridViewWithHeaderAndFooter gridView = (GridViewWithHeaderAndFooter) v.findViewById(R.id.ly_image_list_grid); | ||
|
||
LayoutInflater layoutInflater = LayoutInflater.from(this); | ||
View headerView = layoutInflater.inflate(R.layout.test_header_view, null); | ||
View footerView = layoutInflater.inflate(R.layout.test_footer_view, null); | ||
gridView.addHeaderView(headerView); | ||
gridView.addFooterView(footerView); | ||
``` | ||
|
||
### Thanks | ||
|
||
[HeaderGridView](https://android.googlesource.com/platform/packages/apps/Gallery2/+/idea133/src/com/android/photos/views/HeaderGridView.java) | ||
|
||
### License | ||
|
||
Apache 2 | ||
|
||
### 联系方式 / 帮助支持 | ||
|
||
Please fell free to contact me if there is any problem when using the library. | ||
|
||
* [email protected] | ||
* twitter: https://twitter.com/liaohuqiu | ||
* 微博: http://weibo.com/liaohuqiu | ||
* QQ 群: 271918140 |
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#### [中文版文档](https://github.com/liaohuqiu/android-GridViewWithHeaderAndFooter/blob/master/README-cn.md) | ||
|
||
### GridView with Header and Footer | ||
|
||
![Screen Shot](https://raw.githubusercontent.com/liaohuqiu/android-GridViewWithHeaderAndFooter/master/screen-shot.png) | ||
|
||
This library is contained by `CUBE-SDK`: https://github.com/etao-open-source/cube-sdk. The Demo is HERE: https://github.com/liaohuqiu/android-cube-app . | ||
|
||
#### Maven | ||
|
||
```xml | ||
<dependency> | ||
<groupId>in.srain.cube</groupId> | ||
<artifactId>grid-view-with-header-footer</artifactId> | ||
<type>jar</type> | ||
<version>{lib_version}</version> | ||
</dependency> | ||
``` | ||
|
||
#### Gradle | ||
|
||
``` groovy | ||
compile 'in.srain.cube:grid-view-with-header-footer:{lib_version}' | ||
``` | ||
|
||
### Usage | ||
|
||
```java | ||
GridViewWithHeaderAndFooter gridView = (GridViewWithHeaderAndFooter) v.findViewById(R.id.ly_image_list_grid); | ||
|
||
LayoutInflater layoutInflater = LayoutInflater.from(this); | ||
View headerView = layoutInflater.inflate(R.layout.test_header_view, null); | ||
View footerView = layoutInflater.inflate(R.layout.test_footer_view, null); | ||
gridView.addHeaderView(headerView); | ||
gridView.addFooterView(footerView); | ||
``` | ||
|
||
### Thanks | ||
|
||
[HeaderGridView](https://android.googlesource.com/platform/packages/apps/Gallery2/+/idea133/src/com/android/photos/views/HeaderGridView.java) | ||
|
||
### License | ||
|
||
Apache 2 | ||
|
||
### contact or help | ||
|
||
Please fell free to contact me if there is any problem when using the library. | ||
|
||
* [email protected] | ||
* twitter: https://twitter.com/liaohuqiu | ||
* weibo: http://weibo.com/liaohuqiu | ||
* QQ tribe: 271918140 |
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 |
---|---|---|
@@ -0,0 +1,100 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>in.srain</groupId> | ||
<artifactId>cube-parent-for-oss</artifactId> | ||
<version>1.0.1</version> | ||
</parent> | ||
|
||
<groupId>in.srain.cube</groupId> | ||
<artifactId>grid-view-with-header-footer</artifactId> | ||
<packaging>jar</packaging> | ||
<name>GridViewWithHeaderAndFooter</name> | ||
<version>{lib_version}</version> | ||
|
||
<description>GridView with Header and Footer</description> | ||
<url>https://github.com/liaohuqiu/android-GridViewWithHeaderAndFooter</url> | ||
<inceptionYear>2014</inceptionYear> | ||
|
||
<scm> | ||
<url>https://github.com/liaohuqiu/android-GridViewWithHeaderAndFooter</url> | ||
<connection>scm:git:[email protected]:liaohuqiu/android-GridViewWithHeaderAndFooter.git</connection> | ||
<developerConnection>scm:git:[email protected]:liaohuqiu/android-GridViewWithHeaderAndFooter.git | ||
</developerConnection> | ||
</scm> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.google.android</groupId> | ||
<artifactId>android</artifactId> | ||
<version>4.1.1.4</version> | ||
<scope>provided</scope> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>*</groupId> | ||
<artifactId>*</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
</dependencies> | ||
|
||
<developers> | ||
<developer> | ||
<name>Huqiu Liao</name> | ||
<email>[email protected]</email> | ||
<id>liaohuqiu</id> | ||
<url>http://www.liaohuqiu.net</url> | ||
<timezone>+8</timezone> | ||
<roles> | ||
<role>developer</role> | ||
</roles> | ||
</developer> | ||
</developers> | ||
|
||
<licenses> | ||
<license> | ||
<name>Apache License Version 2.0</name> | ||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
|
||
<organization> | ||
<name>Huqiu Liao</name> | ||
<url>http://www.liaohuqiu.net</url> | ||
</organization> | ||
|
||
<issueManagement> | ||
<system>GitHub Issues</system> | ||
<url>https://github.com/liaohuqiu/android-GridViewWithHeaderAndFooter/issues</url> | ||
</issueManagement> | ||
|
||
<properties> | ||
<android.maven.plugin.version>3.7.0</android.maven.plugin.version> | ||
<android.compile.apilevel>16</android.compile.apilevel> | ||
</properties> | ||
|
||
<build> | ||
<finalName>${project.artifactId}</finalName> | ||
<sourceDirectory>src</sourceDirectory> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.jayway.maven.plugins.android.generation2</groupId> | ||
<artifactId>android-maven-plugin</artifactId> | ||
<extensions>true</extensions> | ||
<version>${android.maven.plugin.version}</version> | ||
<configuration> | ||
<sdk> | ||
<path>${env.ANDROID_HOME}</path> | ||
<platform>${android.compile.apilevel}</platform> | ||
</sdk> | ||
<sign> | ||
<debug>false</debug> | ||
</sign> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
python update-project.py | ||
mvn deploy |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import os | ||
vars = { | ||
'lib_version': '1.0.10' | ||
} | ||
|
||
files = [ | ||
'README.md', | ||
'README-cn.md', | ||
'pom.xml', | ||
] | ||
|
||
current_dir = os.path.dirname(os.path.realpath(__file__)) | ||
print current_dir | ||
src_dir = current_dir + '/template/' | ||
dst_dir = current_dir + '/' | ||
|
||
def update_var_for_file(file, vars): | ||
src_file = src_dir + file | ||
dst_file = dst_dir + file | ||
print "update_var_for_file: %s => %s" % (src_file, dst_file) | ||
infile = open(src_file) | ||
outfile = open(dst_file, 'w') | ||
|
||
for line in infile: | ||
for src, target in vars.iteritems(): | ||
line = line.replace(src, target) | ||
outfile.write(line) | ||
infile.close() | ||
outfile.close() | ||
|
||
real_vars = {} | ||
for src, target in vars.iteritems(): | ||
real_vars['{' + src + '}'] = target | ||
|
||
for f in files: | ||
update_var_for_file(f, real_vars) |