本文整理汇总了Java中in.srain.cube.image.ImageTask类的典型用法代码示例。如果您正苦于以下问题:Java ImageTask类的具体用法?Java ImageTask怎么用?Java ImageTask使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ImageTask类属于in.srain.cube.image包,在下文中一共展示了ImageTask类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onLoading
import in.srain.cube.image.ImageTask; //导入依赖的package包/类
@Override
public void onLoading(ImageTask imageTask, CubeImageView imageView) {
if (imageView == null) {
return;
}
if (DEBUG) {
CLog.d(LOG_TAG, MSG_LOADING, imageTask, imageView);
}
if (Version.hasHoneycomb()) {
if (mLoadingDrawable != null && imageView != null && imageView.getDrawable() != mLoadingDrawable) {
imageView.setImageDrawable(mLoadingDrawable);
}
} else {
imageView.setImageDrawable(null);
}
}
开发者ID:liaohuqiu,项目名称:cube-sdk,代码行数:17,代码来源:DefaultImageLoadHandler.java
示例2: onLoadError
import in.srain.cube.image.ImageTask; //导入依赖的package包/类
@Override
public void onLoadError(ImageTask imageTask, CubeImageView imageView, int errorCode) {
if (DEBUG) {
CLog.d(LOG_TAG, MSG_LOAD_ERROR, imageTask, imageView);
}
if (imageView != null) {
if (Version.hasHoneycomb()) {
if (mErrorDrawable != null && imageView != null && imageView.getDrawable() != mErrorDrawable) {
imageView.setImageDrawable(mErrorDrawable);
}
} else {
imageView.setImageDrawable(null);
}
imageView.setImageDrawable(mErrorDrawable);
}
}
开发者ID:liaohuqiu,项目名称:cube-sdk,代码行数:17,代码来源:DefaultImageLoadHandler.java
示例3: getRemoteUrl
import in.srain.cube.image.ImageTask; //导入依赖的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);
CLog.d("test", "getRemoteUrl: %s %s", imageTask.getRequestSize(), url);
return url;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:DemoDuiTangImageReSizer.java
示例4: getRemoteUrl
import in.srain.cube.image.ImageTask; //导入依赖的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
示例5: onLoading
import in.srain.cube.image.ImageTask; //导入依赖的package包/类
@Override
public void onLoading(ImageTask imageTask, CubeImageView cubeImageView) {
if (cubeImageView != null) {
cubeImageView.setImageDrawable(new ColorDrawable(Color.GRAY));
}
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:7,代码来源:PtrImageLoadHandler.java
示例6: onLoadFinish
import in.srain.cube.image.ImageTask; //导入依赖的package包/类
@Override
public void onLoadFinish(ImageTask imageTask, CubeImageView cubeImageView, BitmapDrawable bitmapDrawable) {
if (bitmapDrawable != null && cubeImageView != null) {
cubeImageView.setImageDrawable(bitmapDrawable);
}
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:7,代码来源:PtrImageLoadHandler.java
示例7: onLoadError
import in.srain.cube.image.ImageTask; //导入依赖的package包/类
@Override
public void onLoadError(ImageTask imageTask, CubeImageView cubeImageView, int i) {
if (cubeImageView != null) {
cubeImageView.setImageDrawable(new ColorDrawable(Color.RED));
}
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:7,代码来源:PtrImageLoadHandler.java
示例8: downloadToStream
import in.srain.cube.image.ImageTask; //导入依赖的package包/类
public boolean downloadToStream(ImageTask imageTask,
String url,
OutputStream outputStream,
ProgressUpdateHandler progressUpdateHandler);
开发者ID:liaohuqiu,项目名称:cube-sdk,代码行数:5,代码来源:ImageDownloader.java
示例9: getInSampleSize
import in.srain.cube.image.ImageTask; //导入依赖的package包/类
@Override
public int getInSampleSize(ImageTask imageTask) {
int size = calculateInSampleSize(imageTask.getBitmapOriginSize().x, imageTask.getBitmapOriginSize().y, imageTask.getRequestSize().x, imageTask.getRequestSize().y);
return size;
}
开发者ID:liaohuqiu,项目名称:cube-sdk,代码行数:6,代码来源:DefaultImageReSizer.java
示例10: getRemoteUrl
import in.srain.cube.image.ImageTask; //导入依赖的package包/类
@Override
public String getRemoteUrl(ImageTask imageTask) {
return imageTask.getRemoteUrl();
}
开发者ID:liaohuqiu,项目名称:cube-sdk,代码行数:5,代码来源:DefaultImageReSizer.java
示例11: onLoadFinish
import in.srain.cube.image.ImageTask; //导入依赖的package包/类
@Override
public void onLoadFinish(ImageTask imageTask, CubeImageView imageView, BitmapDrawable drawable) {
if (imageView == null) {
return;
}
Drawable d = drawable;
if (drawable != null) {
if (mResizeImageViewAfterLoad) {
int w = drawable.getBitmap().getWidth();
int h = drawable.getBitmap().getHeight();
if (w > 0 && h > 0) {
ViewGroup.LayoutParams lyp = imageView.getLayoutParams();
if (lyp != null) {
lyp.width = w;
lyp.height = h;
imageView.setLayoutParams(lyp);
}
}
}
// RoundedDrawable will not recycle automatically when API level is lower than 11
if ((mDisplayTag & DISPLAY_ROUNDED) == DISPLAY_ROUNDED && Version.hasHoneycomb()) {
d = new RoundedDrawable(drawable.getBitmap(), mCornerRadius);
}
if ((mDisplayTag & DISPLAY_FADE_IN) == DISPLAY_FADE_IN) {
int loadingColor = android.R.color.transparent;
if (mLoadingColor != -1 && (mDisplayTag & DISPLAY_ROUNDED) != DISPLAY_ROUNDED) {
loadingColor = mLoadingColor;
}
final TransitionDrawable td = new TransitionDrawable(new Drawable[]{new ColorDrawable(loadingColor), d});
imageView.setImageDrawable(td);
td.startTransition(200);
} else {
if (DEBUG) {
Drawable oldDrawable = imageView.getDrawable();
int w = 0, h = 0;
if (oldDrawable != null) {
w = oldDrawable.getIntrinsicWidth();
h = oldDrawable.getIntrinsicHeight();
}
CLog.d(LOG_TAG, MSG_LOAD_FINISH,
imageTask, imageView, w, h, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
}
imageView.setImageDrawable(drawable);
}
}
}
开发者ID:liaohuqiu,项目名称:cube-sdk,代码行数:54,代码来源:DefaultImageLoadHandler.java
示例12: getInSampleSize
import in.srain.cube.image.ImageTask; //导入依赖的package包/类
/**
* Return the {@link BitmapFactory.Options#inSampleSize}, which will be used when load the image from the disk.
* <p/>
* You should better calculate this value according the hard device of the mobile.
*/
public int getInSampleSize(ImageTask imageTask);
开发者ID:liaohuqiu,项目名称:cube-sdk,代码行数:7,代码来源:ImageReSizer.java
示例13: onLoading
import in.srain.cube.image.ImageTask; //导入依赖的package包/类
/**
* When begin to load the image from disk or network.
*/
void onLoading(ImageTask imageTask, CubeImageView cubeImageView);
开发者ID:liaohuqiu,项目名称:cube-sdk,代码行数:5,代码来源:ImageLoadHandler.java
示例14: onLoadFinish
import in.srain.cube.image.ImageTask; //导入依赖的package包/类
/**
* After image is loaded.
*/
void onLoadFinish(ImageTask imageTask, CubeImageView cubeImageView, BitmapDrawable drawable);
开发者ID:liaohuqiu,项目名称:cube-sdk,代码行数:5,代码来源:ImageLoadHandler.java
示例15: onLoadError
import in.srain.cube.image.ImageTask; //导入依赖的package包/类
/**
* Some errors has occurred
*/
void onLoadError(ImageTask imageTask, CubeImageView imageView, int errorCode);
开发者ID:liaohuqiu,项目名称:cube-sdk,代码行数:5,代码来源:ImageLoadHandler.java
示例16: onImageLoaded
import in.srain.cube.image.ImageTask; //导入依赖的package包/类
public void onImageLoaded(ImageTask imageTask, ImageTaskStatistics stat);
开发者ID:liaohuqiu,项目名称:cube-sdk,代码行数:2,代码来源:ImageLoadProfiler.java
示例17: getRemoteUrl
import in.srain.cube.image.ImageTask; //导入依赖的package包/类
public String getRemoteUrl(ImageTask imageTask);
开发者ID:liaohuqiu,项目名称:cube-sdk,代码行数:2,代码来源:ImageReSizer.java
示例18: onProgressChange
import in.srain.cube.image.ImageTask; //导入依赖的package包/类
void onProgressChange(ImageTask imageTask, CubeImageView cubeImageView, int loaded, int total);
开发者ID:liaohuqiu,项目名称:cube-sdk,代码行数:2,代码来源:ImageLoadProgressHandler.java
注:本文中的in.srain.cube.image.ImageTask类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论