当前位置: 首页>>代码示例>>Java>>正文


Java CubeDebug.DEBUG_IMAGE属性代码示例

本文整理汇总了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);
                }
            }
        }
    }
}
 
开发者ID:liaohuqiu,项目名称:cube-sdk,代码行数:22,代码来源:ImageTask.java

示例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;
}
 
开发者ID:liaohuqiu,项目名称:cube-sdk,代码行数:20,代码来源:ImageTask.java

示例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;
}
 
开发者ID:liaohuqiu,项目名称:cube-sdk,代码行数:17,代码来源:ImageTask.java

示例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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:27,代码来源:PtrDemoApplication.java

示例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;
}
 
开发者ID:fengdongfei,项目名称:CXJPadProject,代码行数:10,代码来源:DemoDuiTangImageReSizer.java

示例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);
}
 
开发者ID:cnlinrong,项目名称:MyAndroidFramework,代码行数:27,代码来源:App.java

示例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;
}
 
开发者ID:liaohuqiu,项目名称:cube-sdk,代码行数:29,代码来源:ImageDiskCacheProvider.java


注:本文中的in.srain.cube.util.CubeDebug.DEBUG_IMAGE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。