Skip to content

Commit

Permalink
update release 1.0.44
Browse files Browse the repository at this point in the history
  • Loading branch information
liaohuqiu committed Mar 13, 2015
1 parent 29314ca commit 244e96a
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 11 deletions.
6 changes: 3 additions & 3 deletions README-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Demo 项目移到了这里: https://github.com/liaohuqiu/android-cube-app

#### 依赖源

最新版版本号: `1.0.44.17-SNAPSHOT`, 发布到了: `https://oss.sonatype.org/content/repositories/snapshots`
最新版版本号: `1.0.44`, 发布到了: `https://oss.sonatype.org/content/repositories/snapshots`

* 在gradle中:

Expand Down Expand Up @@ -61,7 +61,7 @@ mavenCentral()
<type>aar</type>
<!-- or apklib format, if you want -->
<!-- <type>apklib</type> -->
<version>1.0.44.17-SNAPSHOT</version>
<version>1.0.44</version>
</dependency>
```

Expand All @@ -81,7 +81,7 @@ mavenCentral()
* gradle / Android Studio, 最新版

```
compile 'in.srain.cube:cube-sdk:1.0.44.17-SNAPSHOT@aar'
compile 'in.srain.cube:cube-sdk:1.0.44@aar'
```

* gradle / Android Studio, 稳定版
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ http://cube-sdk.liaohuqiu.net

#### Repository

The latest version: `1.0.44.17-SNAPSHOT`, has been published to: https://oss.sonatype.org/content/repositories/snapshots, in gradle:
The latest version: `1.0.44`, has been published to: https://oss.sonatype.org/content/repositories/snapshots, in gradle:

* gradle

Expand Down Expand Up @@ -62,7 +62,7 @@ The stable version: `1.0.42`, https://oss.sonatype.org/content/repositories/rele
<type>aar</type>
<!-- or apklib format, if you want -->
<!-- <type>apklib</type> -->
<version>1.0.44.17-SNAPSHOT</version>
<version>1.0.44</version>
</dependency>
```

Expand All @@ -82,7 +82,7 @@ The stable version: `1.0.42`, https://oss.sonatype.org/content/repositories/rele
* gradle, latest version:

```
compile 'in.srain.cube:cube-sdk:1.0.44.17-SNAPSHOT@aar'
compile 'in.srain.cube:cube-sdk:1.0.44@aar'
```

* gradle, stable version:
Expand Down
2 changes: 1 addition & 1 deletion core/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION_NAME=1.0.44.17-SNAPSHOT
VERSION_NAME=1.0.44

ANDROID_BUILD_MIN_SDK_VERSION=8
ANDROID_BUILD_TARGET_SDK_VERSION=16
Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<artifactId>cube-sdk</artifactId>
<packaging>aar</packaging>
<name>Cube SDK</name>
<version>1.0.44.17-SNAPSHOT</version>
<version>1.0.44</version>

<dependencies>
<dependency>
Expand Down
2 changes: 2 additions & 0 deletions core/src/in/srain/cube/image/CubeImageView.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ protected void onLayout(boolean changed, int left, int top, int right, int botto
private void tryLoadImage() {

if (TextUtils.isEmpty(mUrl)) {
setImageDrawable(null);
mImageTask = null;
return;
}

Expand Down
6 changes: 4 additions & 2 deletions core/src/in/srain/cube/request/JsonData.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ public final class JsonData {

private Object mJson;
private static final String EMPTY_STRING = "";
private static final JSONArray EMPTY_JSON_ARRAY = new JSONArray();
private static final JSONObject EMPTY_JSON_OBJECT = new JSONObject();

public static JsonData newMap() {
return create(new HashMap<String, Object>());
Expand Down Expand Up @@ -145,7 +147,7 @@ public JSONObject optMapOrNew() {
if (mJson instanceof JSONObject) {
return (JSONObject) mJson;
}
return new JSONObject();
return EMPTY_JSON_OBJECT;
}

private Object valueForPut(Object value) {
Expand Down Expand Up @@ -234,7 +236,7 @@ public JSONArray optArrayOrNew() {
if (mJson instanceof JSONArray) {
return (JSONArray) mJson;
}
return new JSONArray();
return EMPTY_JSON_ARRAY;
}

public int length() {
Expand Down
32 changes: 32 additions & 0 deletions core/src/in/srain/cube/views/list/ListPageInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public void updateListInfo(List<T> dataList, int total) {
}

private void addMore(List<T> dataList) {
if (dataList == null) {
return;
}
if (mStart == 0 || mDataList == null) {
mDataList = new ArrayList<T>();
}
Expand Down Expand Up @@ -79,6 +82,11 @@ public boolean isEmpty() {
return mDataList == null || mDataList.size() == 0;
}

/**
* try to move to next page
*
* @return
*/
public boolean nextPage() {
if (hasMore()) {
mStart += mNumPerPage;
Expand All @@ -98,6 +106,30 @@ public int getListLength() {
return mDataList.size();
}

/**
* the first item in list
*
* @return
*/
public T firstItem() {
if (mDataList == null || mDataList.size() == 0) {
return null;
}
return mDataList.get(0);
}

/**
* the last item in list
*
* @return
*/
public T lastItem() {
if (mDataList == null || mDataList.size() == 0) {
return null;
}
return mDataList.get(mDataList.size() - 1);
}

public boolean hasMore() {
return mDataList == null || mHasMore;
}
Expand Down
2 changes: 1 addition & 1 deletion update-project.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
vars = {
'cube_sdk_version': '1.0.44.17-SNAPSHOT',
'cube_sdk_version': '1.0.44',
'cube_sdk_stable_version': '1.0.42'
}

Expand Down

0 comments on commit 244e96a

Please sign in to comment.