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


Java CubeDebug类代码示例

本文整理汇总了Java中in.srain.cube.util.CubeDebug的典型用法代码示例。如果您正苦于以下问题:Java CubeDebug类的具体用法?Java CubeDebug怎么用?Java CubeDebug使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CubeDebug类属于in.srain.cube.util包,在下文中一共展示了CubeDebug类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getCacheKey

import in.srain.cube.util.CubeDebug; //导入依赖的package包/类
@Override
public String getCacheKey() {
    if (mCacheKey == null) {
        String cacheKey = null;
        String url = getRequestData().getRequestUrl();
        try {
            URI uri = null;
            uri = new URI(url);
            cacheKey = uri.getPath();
            if (cacheKey.startsWith("/")) {
                cacheKey = cacheKey.substring(1);
            }
            cacheKey = cacheKey.replace("/", "-");
        } catch (URISyntaxException e) {
            if (CubeDebug.DEBUG_REQUEST) {
                e.printStackTrace();
            }
        }
        if (TextUtils.isEmpty(cacheKey)) {
            throw new RuntimeException("Cache key is null");
        }
        mCacheKey = cacheKey;
    }
    return mCacheKey;
}
 
开发者ID:liaohuqiu,项目名称:cube-sdk,代码行数:26,代码来源:CacheAbleRequest.java

示例2: obtain

import in.srain.cube.util.CubeDebug; //导入依赖的package包/类
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,代码行数:21,代码来源:ImageTask.java

示例3: tryToRecycle

import in.srain.cube.util.CubeDebug; //导入依赖的package包/类
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,代码行数:23,代码来源:ImageTask.java

示例4: renewForRequest

import in.srain.cube.util.CubeDebug; //导入依赖的package包/类
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,代码行数:18,代码来源:ImageTask.java

示例5: onCreate

import in.srain.cube.util.CubeDebug; //导入依赖的package包/类
@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,代码行数:28,代码来源:PtrDemoApplication.java

示例6: getRemoteUrl

import in.srain.cube.util.CubeDebug; //导入依赖的package包/类
@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,代码行数:11,代码来源:DemoDuiTangImageReSizer.java

示例7: onCreate

import in.srain.cube.util.CubeDebug; //导入依赖的package包/类
@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,代码行数:28,代码来源:PtrDemoApplication.java

示例8: onCreate

import in.srain.cube.util.CubeDebug; //导入依赖的package包/类
@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,代码行数:28,代码来源:App.java

示例9: getView

import in.srain.cube.util.CubeDebug; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    if (CubeDebug.DEBUG_LIST) {
        CLog.d(LOG_TAG, "getView %s", position);
    }
    ItemDataType itemData = getItem(position);
    ViewHolderBase<ItemDataType> holderBase = null;
    if (mForceCreateView || convertView == null || (!(convertView.getTag() instanceof ViewHolderBase<?>))) {
        LayoutInflater inflater = LayoutInflater.from(parent.getContext());
        holderBase = createViewHolder(position);
        if (holderBase != null) {
            convertView = holderBase.createView(inflater);
            if (convertView != null) {
                if (!mForceCreateView) {
                    convertView.setTag(holderBase);
                }
            }
        }
    } else {
        holderBase = (ViewHolderBase<ItemDataType>) convertView.getTag();
    }
    if (holderBase != null) {
        holderBase.setItemData(position, convertView);
        holderBase.showData(position, itemData);
    }
    return convertView;
}
 
开发者ID:liaohuqiu,项目名称:cube-sdk,代码行数:29,代码来源:ListViewDataAdapterBase.java

示例10: downloadAndGetInputStream

import in.srain.cube.util.CubeDebug; //导入依赖的package包/类
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,代码行数:30,代码来源:ImageDiskCacheProvider.java

示例11: onRequestFail

import in.srain.cube.util.CubeDebug; //导入依赖的package包/类
@Override
public void onRequestFail(FailData failData) {
    if (failData != null && failData.getRequest() != null && failData.getRequest().getRequestData() != null) {
        CLog.e(CubeDebug.DEBUG_REQUEST_LOG_TAG, "onRequestFail: %s", failData.getRequest().getRequestData().getRequestUrl());
    }
}
 
开发者ID:liaohuqiu,项目名称:cube-sdk,代码行数:7,代码来源:CacheAbleRequestDefaultHandler.java

示例12: onRequestFinish

import in.srain.cube.util.CubeDebug; //导入依赖的package包/类
@Override
public void onRequestFinish(T1 data) {
    if (CubeDebug.DEBUG_REQUEST) {
        CLog.d(CubeDebug.DEBUG_REQUEST_LOG_TAG, "onRequestFinish: %s", data);
    }
}
 
开发者ID:liaohuqiu,项目名称:cube-sdk,代码行数:7,代码来源:CacheAbleRequestDefaultHandler.java


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