Skip to content

Commit

Permalink
update for 1.0.44.7 SNAPSHOT
Browse files Browse the repository at this point in the history
  • Loading branch information
liaohuqiu committed Feb 25, 2015
1 parent e118a36 commit a41e555
Show file tree
Hide file tree
Showing 30 changed files with 100 additions and 86 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

项目已经发布到了Maven中央库,包括`aar``apklib`两种格式。在Maven或者Gradle中可如下直接引入。

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

在gradle中:

Expand Down Expand Up @@ -43,7 +43,7 @@ mavenCentral()
<type>aar</type>
<!-- or apklib format, if you want -->
<!-- <type>apklib</type> -->
<version>1.0.44.6-SNAPSHOT</version>
<version>1.0.44.7-SNAPSHOT</version>
</dependency>

稳定版
Expand All @@ -62,7 +62,7 @@ mavenCentral()
gradle / Android Studio, 最新版

```
compile 'in.srain.cube:cube-sdk:1.0.44.6-SNAPSHOT@aar'
compile 'in.srain.cube:cube-sdk:1.0.44.7-SNAPSHOT@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 @@ -15,7 +15,7 @@ http://cube-sdk.liaohuqiu.net

### Import to your project

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

```
maven {
Expand All @@ -38,7 +38,7 @@ pom.xml, latest version:
<type>aar</type>
<!-- or apklib format, if you want -->
<!-- <type>apklib</type> -->
<version>1.0.44.6-SNAPSHOT</version>
<version>1.0.44.7-SNAPSHOT</version>
</dependency>
```

Expand All @@ -58,7 +58,7 @@ pom.xml, stable version:
gradle, latest version:

```
compile 'in.srain.cube:cube-sdk:1.0.44.6-SNAPSHOT@aar'
compile 'in.srain.cube:cube-sdk:1.0.44.7-SNAPSHOT@aar'
```

gradle, stable version:
Expand Down
2 changes: 1 addition & 1 deletion build-template.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
vars = {
'cube_sdk_version': '1.0.44.6-SNAPSHOT',
'cube_sdk_version': '1.0.44.7-SNAPSHOT',
'cube_sdk_stable_version': '1.0.42'
}

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.6-SNAPSHOT
VERSION_NAME=1.0.44.7-SNAPSHOT

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.6-SNAPSHOT</version>
<version>1.0.44.7-SNAPSHOT</version>

<dependencies>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions core/src/in/srain/cube/app/CubeFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import in.srain.cube.app.lifecycle.LifeCycleComponent;
import in.srain.cube.app.lifecycle.LifeCycleComponentManager;
import in.srain.cube.util.CLog;
import in.srain.cube.util.Debug;
import in.srain.cube.util.CubeDebug;

/**
* Implement {@link ICubeFragment}, {@link IComponentContainer}
Expand All @@ -19,7 +19,7 @@
*/
public abstract class CubeFragment extends Fragment implements ICubeFragment, IComponentContainer {

private static final boolean DEBUG = Debug.DEBUG_LIFE_CYCLE;
private static final boolean DEBUG = CubeDebug.DEBUG_LIFE_CYCLE;
protected Object mDataIn;
private boolean mFirstResume = true;

Expand Down
4 changes: 2 additions & 2 deletions core/src/in/srain/cube/app/XActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import in.srain.cube.app.lifecycle.IComponentContainer;
import in.srain.cube.app.lifecycle.LifeCycleComponent;
import in.srain.cube.app.lifecycle.LifeCycleComponentManager;
import in.srain.cube.util.Debug;
import in.srain.cube.util.CubeDebug;

/**
* 1. manager the components when move from a lifetime to another
Expand All @@ -16,7 +16,7 @@ public abstract class XActivity extends CubeFragmentActivity implements ICompone

private LifeCycleComponentManager mComponentContainer = new LifeCycleComponentManager();

private static final boolean DEBUG = Debug.DEBUG_LIFE_CYCLE;
private static final boolean DEBUG = CubeDebug.DEBUG_LIFE_CYCLE;

@Override
protected void onRestart() {
Expand Down
4 changes: 2 additions & 2 deletions core/src/in/srain/cube/cache/CacheManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import in.srain.cube.concurrent.SimpleTask;
import in.srain.cube.request.JsonData;
import in.srain.cube.util.CLog;
import in.srain.cube.util.Debug;
import in.srain.cube.util.CubeDebug;

import java.io.IOException;

Expand All @@ -16,7 +16,7 @@
*/
public class CacheManager {

private static final boolean DEBUG = Debug.DEBUG_CACHE;
private static final boolean DEBUG = CubeDebug.DEBUG_CACHE;
private static final String LOG_TAG = "cube-cache-manager";

private static final int DEFAULT_CACHE_SIZE_IN_KB = 1024 * 10;
Expand Down
6 changes: 3 additions & 3 deletions core/src/in/srain/cube/image/ImageDiskCacheProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import in.srain.cube.diskcache.lru.SimpleDiskLruCache;
import in.srain.cube.image.impl.SimpleDownloader;
import in.srain.cube.util.CLog;
import in.srain.cube.util.Debug;
import in.srain.cube.util.CubeDebug;

import java.io.*;

Expand All @@ -21,8 +21,8 @@
*/
public class ImageDiskCacheProvider extends DiskCacheProvider {

protected static final boolean DEBUG = Debug.DEBUG_IMAGE;
protected static final String LOG_TAG = Debug.DEBUG_IMAGE_LOG_TAG_PROVIDER;
protected static final boolean DEBUG = CubeDebug.DEBUG_IMAGE;
protected static final String LOG_TAG = CubeDebug.DEBUG_IMAGE_LOG_TAG_PROVIDER;

// Compression settings when writing images to disk cache
private static final CompressFormat DEFAULT_COMPRESS_FORMAT = CompressFormat.JPEG;
Expand Down
6 changes: 3 additions & 3 deletions core/src/in/srain/cube/image/ImageLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import in.srain.cube.image.iface.ImageResizer;
import in.srain.cube.image.iface.ImageTaskExecutor;
import in.srain.cube.util.CLog;
import in.srain.cube.util.Debug;
import in.srain.cube.util.CubeDebug;

import java.util.Iterator;
import java.util.Map.Entry;
Expand All @@ -40,8 +40,8 @@ public class ImageLoader implements LifeCycleComponent {
private static final String MSG_TASK_RECYCLE = "%s, %s LoadImageTask.removeAndRecycle";
private static final String MSG_HIT_CACHE = "%s hit cache %s %s";

protected static final boolean DEBUG = Debug.DEBUG_IMAGE;
protected static final String LOG_TAG = Debug.DEBUG_IMAGE_LOG_TAG;
protected static final boolean DEBUG = CubeDebug.DEBUG_IMAGE;
protected static final String LOG_TAG = CubeDebug.DEBUG_IMAGE_LOG_TAG;

protected ImageTaskExecutor mImageTaskExecutor;
protected ImageResizer mImageResizer;
Expand Down
6 changes: 3 additions & 3 deletions core/src/in/srain/cube/image/ImageProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import in.srain.cube.image.iface.ImageMemoryCache;
import in.srain.cube.image.iface.ImageResizer;
import in.srain.cube.util.CLog;
import in.srain.cube.util.Debug;
import in.srain.cube.util.CubeDebug;
import in.srain.cube.util.Version;

import java.io.FileDescriptor;
Expand All @@ -29,9 +29,9 @@
*/
public class ImageProvider {

protected static final boolean DEBUG = Debug.DEBUG_IMAGE;
protected static final boolean DEBUG = CubeDebug.DEBUG_IMAGE;

protected static final String TAG = Debug.DEBUG_IMAGE_LOG_TAG_PROVIDER;
protected static final String TAG = CubeDebug.DEBUG_IMAGE_LOG_TAG_PROVIDER;

private static final String MSG_FETCH_BEGIN = "%s fetchBitmapData";
private static final String MSG_FETCH_BEGIN_IDENTITY_KEY = "%s identityKey: %s";
Expand Down
12 changes: 6 additions & 6 deletions core/src/in/srain/cube/image/ImageTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import android.graphics.drawable.BitmapDrawable;
import in.srain.cube.image.iface.ImageLoadHandler;
import in.srain.cube.util.CLog;
import in.srain.cube.util.Debug;
import in.srain.cube.util.CubeDebug;
import in.srain.cube.util.Encrypt;

import java.lang.ref.WeakReference;
Expand All @@ -16,7 +16,7 @@
*/
public class ImageTask {

protected static final String LOG_TAG = Debug.DEBUG_IMAGE_LOG_TAG_TASK;
protected static final String LOG_TAG = CubeDebug.DEBUG_IMAGE_LOG_TAG_TASK;
private static final Object sPoolSync = new Object();
private static ImageTask sTop;
private static int sPoolSize = 0;
Expand Down Expand Up @@ -99,7 +99,7 @@ public static ImageTask obtain() {
m.next = null;
sPoolSize--;
m.mHasRecycled = false;
if (Debug.DEBUG_IMAGE) {
if (CubeDebug.DEBUG_IMAGE) {
CLog.d(LOG_TAG, "%s, obtain reused, pool remain: %d", m, sPoolSize);
}
return m;
Expand All @@ -120,10 +120,10 @@ public void tryToRecycle() {
next = sTop;
sTop = this;
sPoolSize++;
if (Debug.DEBUG_IMAGE) {
if (CubeDebug.DEBUG_IMAGE) {
CLog.d(LOG_TAG, "%s is put to recycle poll, pool size: %d", this, sPoolSize);
} else {
if (Debug.DEBUG_IMAGE) {
if (CubeDebug.DEBUG_IMAGE) {
CLog.d(LOG_TAG, "%s is not recycled, the poll is full: %d", this, sPoolSize);
}
}
Expand All @@ -132,7 +132,7 @@ public void tryToRecycle() {
}

public ImageTask renew() {
if (Debug.DEBUG_IMAGE) {
if (CubeDebug.DEBUG_IMAGE) {
int lastId = mId;
mId = ++sId;
CLog.d(LOG_TAG, "%s, renew: %s => %s", this, lastId, mId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.util.Log;
import in.srain.cube.util.Debug;
import in.srain.cube.util.CubeDebug;

/**
* A BitmapDrawable that keeps track of whether it is being displayed or cached.
Expand All @@ -15,7 +15,7 @@
*/
public class RecyclingBitmapDrawable extends BitmapDrawable {

private final static String LOG_TAG = Debug.DEBUG_IMAGE_LOG_TAG;
private final static String LOG_TAG = CubeDebug.DEBUG_IMAGE_LOG_TAG;
static final boolean DEBUG = false;

private int mCacheRefCount = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import in.srain.cube.image.drawable.TextDrawable;
import in.srain.cube.image.iface.ImageLoadHandler;
import in.srain.cube.util.CLog;
import in.srain.cube.util.Debug;
import in.srain.cube.util.CubeDebug;
import in.srain.cube.util.Version;

/**
Expand All @@ -27,8 +27,8 @@
*/
public class DefaultImageLoadHandler implements ImageLoadHandler {

private final static boolean DEBUG = Debug.DEBUG_IMAGE;
private final static String LOG_TAG = Debug.DEBUG_IMAGE_LOG_TAG;
private final static boolean DEBUG = CubeDebug.DEBUG_IMAGE;
private final static String LOG_TAG = CubeDebug.DEBUG_IMAGE_LOG_TAG;
private final static String MSG_LOADING = "%s => %s handler on loading";
private final static String MSG_LOAD_ERROR = "%s => %s handler on load error";
private final static String MSG_LOAD_FINISH = "%s => %s handler on load finish: %s %s %s %s";
Expand Down
6 changes: 3 additions & 3 deletions core/src/in/srain/cube/image/impl/DefaultMemoryCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
import in.srain.cube.image.ImageProvider;
import in.srain.cube.image.drawable.RecyclingBitmapDrawable;
import in.srain.cube.image.iface.ImageMemoryCache;
import in.srain.cube.util.Debug;
import in.srain.cube.util.CubeDebug;

public class DefaultMemoryCache implements ImageMemoryCache {

protected static final boolean DEBUG = Debug.DEBUG_IMAGE;
protected static final String LOG_TAG = Debug.DEBUG_IMAGE_LOG_TAG_PROVIDER;
protected static final boolean DEBUG = CubeDebug.DEBUG_IMAGE;
protected static final String LOG_TAG = CubeDebug.DEBUG_IMAGE_LOG_TAG_PROVIDER;
private LruCache<String, BitmapDrawable> mMemoryCache;

public DefaultMemoryCache(int cacheSizeInKB) {
Expand Down
4 changes: 2 additions & 2 deletions core/src/in/srain/cube/image/impl/SimpleDownloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.os.Build;
import in.srain.cube.util.CLog;
import in.srain.cube.util.Debug;
import in.srain.cube.util.CubeDebug;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
Expand All @@ -16,7 +16,7 @@
*/
public class SimpleDownloader {

protected static final String LOG_TAG = Debug.DEBUG_IMAGE_LOG_TAG_PROVIDER;
protected static final String LOG_TAG = CubeDebug.DEBUG_IMAGE_LOG_TAG_PROVIDER;

private static final int IO_BUFFER_SIZE = 8 * 1024;

Expand Down
6 changes: 3 additions & 3 deletions core/src/in/srain/cube/request/CacheAbleRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import in.srain.cube.cache.CacheResultType;
import in.srain.cube.concurrent.SimpleTask;
import in.srain.cube.util.CLog;
import in.srain.cube.util.Debug;
import in.srain.cube.util.CubeDebug;

import java.net.URI;
import java.net.URISyntaxException;
Expand All @@ -20,7 +20,7 @@ public static enum ResultType {
USE_CACHE_ON_FAIL,
}

protected static final boolean DEBUG = Debug.DEBUG_CACHE;
protected static final boolean DEBUG = CubeDebug.DEBUG_CACHE;
protected static final String LOG_TAG = "cube-cache-request";

private CacheAbleRequestHandler<T> mHandler;
Expand Down Expand Up @@ -185,7 +185,7 @@ public void onCacheData(CacheResultType cacheResultType, T data, boolean outOfDa
}
mCacheData = data;
mOutOfDate = outOfDate;
if (null == mHandler) {
if (mHandler != null) {
mHandler.onCacheData(data, outOfDate);

if (mUseCacheAnyway) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
package in.srain.cube.request;

import in.srain.cube.util.CLog;
import in.srain.cube.util.CubeDebug;

public abstract class CacheAbleRequestDefaultHandler<T1> implements CacheAbleRequestHandler<T1> {

public void onCacheData(T1 data, boolean outOfDate) {
}

@Override
public void onRequestFail(FailData failData) {
if (failData.getRequest() != null && failData.getRequest().getRequestData() != null) {
CLog.e(CubeDebug.DEBUG_REQUEST_LOG_TAG, "onRequestFail: %s", failData.getRequest().getRequestData().getRequestUrl());
}
}

@Override
public void onRequestFinish(T1 data) {

if (CubeDebug.DEBUG_REQUEST) {
CLog.e(CubeDebug.DEBUG_REQUEST_LOG_TAG, "onRequestFinish: %s", data);
}
}
}
Loading

0 comments on commit a41e555

Please sign in to comment.