Skip to content

Commit 244e96a

Browse files
committed
update release 1.0.44
1 parent 29314ca commit 244e96a

File tree

8 files changed

+47
-11
lines changed

8 files changed

+47
-11
lines changed

README-cn.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Demo 项目移到了这里: https://github.com/liaohuqiu/android-cube-app
1414

1515
#### 依赖源
1616

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

1919
* 在gradle中:
2020

@@ -61,7 +61,7 @@ mavenCentral()
6161
<type>aar</type>
6262
<!-- or apklib format, if you want -->
6363
<!-- <type>apklib</type> -->
64-
<version>1.0.44.17-SNAPSHOT</version>
64+
<version>1.0.44</version>
6565
</dependency>
6666
```
6767

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

8383
```
84-
compile 'in.srain.cube:cube-sdk:1.0.44.17-SNAPSHOT@aar'
84+
compile 'in.srain.cube:cube-sdk:1.0.44@aar'
8585
```
8686

8787
* gradle / Android Studio, 稳定版

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ http://cube-sdk.liaohuqiu.net
1717

1818
#### Repository
1919

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

2222
* gradle
2323

@@ -62,7 +62,7 @@ The stable version: `1.0.42`, https://oss.sonatype.org/content/repositories/rele
6262
<type>aar</type>
6363
<!-- or apklib format, if you want -->
6464
<!-- <type>apklib</type> -->
65-
<version>1.0.44.17-SNAPSHOT</version>
65+
<version>1.0.44</version>
6666
</dependency>
6767
```
6868

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

8484
```
85-
compile 'in.srain.cube:cube-sdk:1.0.44.17-SNAPSHOT@aar'
85+
compile 'in.srain.cube:cube-sdk:1.0.44@aar'
8686
```
8787

8888
* gradle, stable version:

core/gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION_NAME=1.0.44.17-SNAPSHOT
1+
VERSION_NAME=1.0.44
22

33
ANDROID_BUILD_MIN_SDK_VERSION=8
44
ANDROID_BUILD_TARGET_SDK_VERSION=16

core/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<artifactId>cube-sdk</artifactId>
1414
<packaging>aar</packaging>
1515
<name>Cube SDK</name>
16-
<version>1.0.44.17-SNAPSHOT</version>
16+
<version>1.0.44</version>
1717

1818
<dependencies>
1919
<dependency>

core/src/in/srain/cube/image/CubeImageView.java

+2
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ protected void onLayout(boolean changed, int left, int top, int right, int botto
182182
private void tryLoadImage() {
183183

184184
if (TextUtils.isEmpty(mUrl)) {
185+
setImageDrawable(null);
186+
mImageTask = null;
185187
return;
186188
}
187189

core/src/in/srain/cube/request/JsonData.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ public final class JsonData {
1212

1313
private Object mJson;
1414
private static final String EMPTY_STRING = "";
15+
private static final JSONArray EMPTY_JSON_ARRAY = new JSONArray();
16+
private static final JSONObject EMPTY_JSON_OBJECT = new JSONObject();
1517

1618
public static JsonData newMap() {
1719
return create(new HashMap<String, Object>());
@@ -145,7 +147,7 @@ public JSONObject optMapOrNew() {
145147
if (mJson instanceof JSONObject) {
146148
return (JSONObject) mJson;
147149
}
148-
return new JSONObject();
150+
return EMPTY_JSON_OBJECT;
149151
}
150152

151153
private Object valueForPut(Object value) {
@@ -234,7 +236,7 @@ public JSONArray optArrayOrNew() {
234236
if (mJson instanceof JSONArray) {
235237
return (JSONArray) mJson;
236238
}
237-
return new JSONArray();
239+
return EMPTY_JSON_ARRAY;
238240
}
239241

240242
public int length() {

core/src/in/srain/cube/views/list/ListPageInfo.java

+32
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ public void updateListInfo(List<T> dataList, int total) {
2323
}
2424

2525
private void addMore(List<T> dataList) {
26+
if (dataList == null) {
27+
return;
28+
}
2629
if (mStart == 0 || mDataList == null) {
2730
mDataList = new ArrayList<T>();
2831
}
@@ -79,6 +82,11 @@ public boolean isEmpty() {
7982
return mDataList == null || mDataList.size() == 0;
8083
}
8184

85+
/**
86+
* try to move to next page
87+
*
88+
* @return
89+
*/
8290
public boolean nextPage() {
8391
if (hasMore()) {
8492
mStart += mNumPerPage;
@@ -98,6 +106,30 @@ public int getListLength() {
98106
return mDataList.size();
99107
}
100108

109+
/**
110+
* the first item in list
111+
*
112+
* @return
113+
*/
114+
public T firstItem() {
115+
if (mDataList == null || mDataList.size() == 0) {
116+
return null;
117+
}
118+
return mDataList.get(0);
119+
}
120+
121+
/**
122+
* the last item in list
123+
*
124+
* @return
125+
*/
126+
public T lastItem() {
127+
if (mDataList == null || mDataList.size() == 0) {
128+
return null;
129+
}
130+
return mDataList.get(mDataList.size() - 1);
131+
}
132+
101133
public boolean hasMore() {
102134
return mDataList == null || mHasMore;
103135
}

update-project.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22
vars = {
3-
'cube_sdk_version': '1.0.44.17-SNAPSHOT',
3+
'cube_sdk_version': '1.0.44',
44
'cube_sdk_stable_version': '1.0.42'
55
}
66

0 commit comments

Comments
 (0)