本文整理汇总了Java中in.srain.cube.util.CubeDebug.DEBUG_IMAGE属性的典型用法代码示例。如果您正苦于以下问题:Java CubeDebug.DEBUG_IMAGE属性的具体用法?Java CubeDebug.DEBUG_IMAGE怎么用?Java CubeDebug.DEBUG_IMAGE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类in.srain.cube.util.CubeDebug
的用法示例。
在下文中一共展示了CubeDebug.DEBUG_IMAGE属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tryToRecycle
public void tryToRecycle() {
if (!USE_POOL) {
return;
}
clearForRecycle();
// mark top as the next of current, then push current as pop
synchronized (sPoolSync) {
if (sPoolSize < MAX_POOL_SIZE) {
next = sTop;
sTop = this;
sPoolSize++;
if (CubeDebug.DEBUG_IMAGE) {
CLog.d(LOG_TAG, "%s is put to recycle poll, pool size: %d", this, sPoolSize);
} else {
if (CubeDebug.DEBUG_IMAGE) {
CLog.d(LOG_TAG, "%s is not recycled, the poll is full: %d", this, sPoolSize);
}
}
}
}
}
示例2: obtain
public static ImageTask obtain() {
if (!USE_POOL) {
return null;
}
// pop top, make top.next as top
synchronized (sPoolSync) {
if (sTop != null) {
ImageTask m = sTop;
sTop = m.next;
m.next = null;
sPoolSize--;
m.mHasRecycled = false;
if (CubeDebug.DEBUG_IMAGE) {
CLog.d(LOG_TAG, "%s, obtain reused, pool remain: %d", m, sPoolSize);
}
return m;
}
}
return null;
}
示例3: renewForRequest
public ImageTask renewForRequest(ImageLoadRequest request) {
if (CubeDebug.DEBUG_IMAGE) {
int lastId = mId;
mId = ++sId;
CLog.d(LOG_TAG, "%s, renew: %s => %s", this, lastId, mId);
} else {
mId = ++sId;
}
mStr = null;
if (ImagePerformanceStatistics.sample(mId)) {
mImageTaskStatistics = new ImageTaskStatistics();
}
mOriginUrl = request.getUrl();
mRequestSize.set(request.getRequestWidth(), request.getRequestHeight());
mRequest = request;
return this;
}
示例4: onCreate
@Override
public void onCreate() {
super.onCreate();
instance = this;
String environment = "";
if (environment.equals("production")) {
CLog.setLogLevel(CLog.LEVEL_ERROR);
} else if (environment.equals("beta")) {
CLog.setLogLevel(CLog.LEVEL_WARNING);
} else {
// development
CLog.setLogLevel(CLog.LEVEL_VERBOSE);
}
CubeDebug.DEBUG_IMAGE = true;
PtrFrameLayout.DEBUG = true;
PtrFrameLayout.DEBUG = false;
ImageLoaderFactory.setDefaultImageReSizer(DemoDuiTangImageReSizer.getInstance());
ImageLoaderFactory.setDefaultImageLoadHandler(new PtrImageLoadHandler());
String dir = "request-cache";
// ImageLoaderFactory.init(this);
RequestCacheManager.init(this, dir, 1024 * 10, 1024 * 10);
Cube.onCreate(this);
}
示例5: getRemoteUrl
@Override
public String getRemoteUrl(ImageTask imageTask) {
String url = imageTask.getOriginUrl();
int size = findBestCDNSize(CDN_FIX_WIDTH_SIZE, imageTask.getRequestSize().x, true);
url = url.replace(TAG, TAG + DOT + size + SP + size);
if (CubeDebug.DEBUG_IMAGE) {
CLog.d("cube_image", "getRemoteUrl: %s %s", imageTask.getRequestSize(), url);
}
return url;
}
示例6: onCreate
@Override
public void onCreate() {
super.onCreate();
instance = this;
String environment = "";
if (environment.equals("production")) {
CLog.setLogLevel(CLog.LEVEL_ERROR);
} else if (environment.equals("beta")) {
CLog.setLogLevel(CLog.LEVEL_WARNING);
} else {
// development
CLog.setLogLevel(CLog.LEVEL_VERBOSE);
}
CubeDebug.DEBUG_IMAGE = true;
PtrFrameLayout.DEBUG = true;
//PtrFrameLayout.DEBUG = false;
ImageLoaderFactory.setDefaultImageReSizer(DemoDuiTangImageReSizer.getInstance());
ImageLoaderFactory.setDefaultImageLoadHandler(new PtrImageLoadHandler());
String dir = "request-cache";
// ImageLoaderFactory.init(this);
RequestCacheManager.init(this, dir, 1024 * 10, 1024 * 10);
Cube.onCreate(this);
}
开发者ID:tangnuo,项目名称:android-Ultra-Pull-To-Refresh-With-Load-More-master,代码行数:27,代码来源:PtrDemoApplication.java
示例7: onCreate
@Override
public void onCreate() {
super.onCreate();
instance = this;
String environment = "";
if (environment.equals("production")) {
CLog.setLogLevel(CLog.LEVEL_ERROR);
} else if (environment.equals("beta")) {
CLog.setLogLevel(CLog.LEVEL_WARNING);
} else {
// development
CLog.setLogLevel(CLog.LEVEL_VERBOSE);
}
CubeDebug.DEBUG_IMAGE = true;
PtrFrameLayout.DEBUG = true;
PtrFrameLayout.DEBUG = false;
ImageLoaderFactory.setDefaultImageReSizer(ImageReSizer.getInstance());
ImageLoaderFactory.setDefaultImageLoadHandler(new PtrImageLoadHandler());
String dir = "request-cache";
RequestCacheManager.init(this, dir, 1024 * 10, 1024 * 10);
Cube.onCreate(this);
}
示例8: downloadAndGetInputStream
public FileInputStream downloadAndGetInputStream(ImageDownloader imageDownloader, ImageTask imageTask, String fileCacheKey, String url) {
if (imageDownloader == null) {
imageDownloader = SimpleDownloader.getInstance();
}
try {
CacheEntry cacheEntry = mDiskCache.beginEdit(fileCacheKey);
if (cacheEntry != null) {
OutputStream outputStream = cacheEntry.newOutputStream();
boolean ret = imageDownloader.downloadToStream(imageTask, url, outputStream, null);
if (DEBUG) {
CLog.i(LOG_TAG, "download: %s %s %s", ret, fileCacheKey, url);
}
if (ret) {
cacheEntry.commit();
InputStream inputStream = cacheEntry.getInputStream();
if (inputStream instanceof FileInputStream) {
return (FileInputStream) inputStream;
}
} else {
cacheEntry.abortEdit();
}
}
} catch (IOException e) {
if (CubeDebug.DEBUG_IMAGE) {
e.printStackTrace();
}
}
return null;
}