本文整理汇总了Java中com.nostra13.universalimageloader.utils.L.d方法的典型用法代码示例。如果您正苦于以下问题:Java L.d方法的具体用法?Java L.d怎么用?Java L.d使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.nostra13.universalimageloader.utils.L
的用法示例。
在下文中一共展示了L.d方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: waitIfPaused
import com.nostra13.universalimageloader.utils.L; //导入方法依赖的package包/类
private boolean waitIfPaused() {
AtomicBoolean pause = this.engine.getPause();
if (pause.get()) {
synchronized (this.engine.getPauseLock()) {
if (pause.get()) {
L.d(LOG_WAITING_FOR_RESUME, this.memoryCacheKey);
try {
this.engine.getPauseLock().wait();
L.d(LOG_RESUME_AFTER_PAUSE, this.memoryCacheKey);
} catch (InterruptedException e) {
L.e(LOG_TASK_INTERRUPTED, this.memoryCacheKey);
return true;
}
}
}
}
return isTaskNotActual();
}
示例2: waitIfPaused
import com.nostra13.universalimageloader.utils.L; //导入方法依赖的package包/类
/** @return <b>true</b> - if task should be interrupted; <b>false</b> - otherwise */
private boolean waitIfPaused() {
AtomicBoolean pause = engine.getPause();
if (pause.get()) {
synchronized (engine.getPauseLock()) {
if (pause.get()) {
L.d(LOG_WAITING_FOR_RESUME, memoryCacheKey);
try {
engine.getPauseLock().wait();
} catch (InterruptedException e) {
L.e(LOG_TASK_INTERRUPTED, memoryCacheKey);
return true;
}
L.d(LOG_RESUME_AFTER_PAUSE, memoryCacheKey);
}
}
}
return isTaskNotActual();
}
示例3: prepareDecodingOptions
import com.nostra13.universalimageloader.utils.L; //导入方法依赖的package包/类
protected Options prepareDecodingOptions(ImageSize imageSize, ImageDecodingInfo decodingInfo) {
int scale;
ImageScaleType scaleType = decodingInfo.getImageScaleType();
if (scaleType == ImageScaleType.NONE) {
scale = 1;
} else if (scaleType == ImageScaleType.NONE_SAFE) {
scale = ImageSizeUtils.computeMinImageSampleSize(imageSize);
} else {
boolean powerOf2;
ImageSize targetSize = decodingInfo.getTargetSize();
if (scaleType == ImageScaleType.IN_SAMPLE_POWER_OF_2) {
powerOf2 = true;
} else {
powerOf2 = false;
}
scale = ImageSizeUtils.computeImageSampleSize(imageSize, targetSize, decodingInfo.getViewScaleType(), powerOf2);
}
if (scale > 1 && this.loggingEnabled) {
L.d(LOG_SUBSAMPLE_IMAGE, imageSize, imageSize.scaleDown(scale), Integer.valueOf(scale), decodingInfo.getImageKey());
}
Options decodingOptions = decodingInfo.getDecodingOptions();
decodingOptions.inSampleSize = scale;
return decodingOptions;
}
示例4: tryCacheImageOnDisk
import com.nostra13.universalimageloader.utils.L; //导入方法依赖的package包/类
/**
* @return <b>true</b> - if image was downloaded successfully; <b>false</b> - otherwise
*/
private boolean tryCacheImageOnDisk() throws TaskCancelledException {
L.d(LOG_CACHE_IMAGE_ON_DISK, memoryCacheKey);
boolean loaded;
try {
loaded = downloadImage();
if (loaded) {
int width = configuration.maxImageWidthForDiskCache;
int height = configuration.maxImageHeightForDiskCache;
if (width > 0 || height > 0) {
L.d(LOG_RESIZE_CACHED_IMAGE_FILE, memoryCacheKey);
resizeAndSaveImage(width, height); // TODO : process boolean result
}
}
} catch (IOException e) {
L.e(e);
loaded = false;
}
return loaded;
}
示例5: waitIfPaused
import com.nostra13.universalimageloader.utils.L; //导入方法依赖的package包/类
/**
* @return <b>true</b> - if task should be interrupted; <b>false</b> - otherwise
*/
private boolean waitIfPaused() {
AtomicBoolean pause = engine.getPause();
if (pause.get()) {
synchronized (engine.getPauseLock()) {
if (pause.get()) {
L.d(LOG_WAITING_FOR_RESUME, memoryCacheKey);
try {
engine.getPauseLock().wait();
} catch (InterruptedException e) {
L.e(LOG_TASK_INTERRUPTED, memoryCacheKey);
return true;
}
L.d(LOG_RESUME_AFTER_PAUSE, memoryCacheKey);
}
}
}
return isTaskNotActual();
}
示例6: tryCacheImageOnDisk
import com.nostra13.universalimageloader.utils.L; //导入方法依赖的package包/类
private boolean tryCacheImageOnDisk() throws TaskCancelledException {
L.d(LOG_CACHE_IMAGE_ON_DISK, this.memoryCacheKey);
try {
boolean loaded = downloadImage();
if (!loaded) {
return loaded;
}
int width = this.configuration.maxImageWidthForDiskCache;
int height = this.configuration.maxImageHeightForDiskCache;
if (width <= 0 && height <= 0) {
return loaded;
}
L.d(LOG_RESIZE_CACHED_IMAGE_FILE, this.memoryCacheKey);
resizeAndSaveImage(width, height);
return loaded;
} catch (IOException e) {
L.e(e);
return false;
}
}
示例7: isTaskInterrupted
import com.nostra13.universalimageloader.utils.L; //导入方法依赖的package包/类
/**
* @return <b>true</b> - if current task was interrupted; <b>false</b> - otherwise
*/
private boolean isTaskInterrupted() {
if (Thread.interrupted()) {
L.d(LOG_TASK_INTERRUPTED, memoryCacheKey);
return true;
}
return false;
}
示例8: delayIfNeed
import com.nostra13.universalimageloader.utils.L; //导入方法依赖的package包/类
/**
* @return <b>true</b> - if task should be interrupted; <b>false</b> - otherwise
*/
private boolean delayIfNeed() {
if (options.shouldDelayBeforeLoading()) {
L.d(LOG_DELAY_BEFORE_LOADING, options.getDelayBeforeLoading(), memoryCacheKey);
try {
Thread.sleep(options.getDelayBeforeLoading());
} catch (InterruptedException e) {
L.e(LOG_TASK_INTERRUPTED, memoryCacheKey);
return true;
}
return isTaskNotActual();
}
return false;
}
示例9: resizeAndSaveImage
import com.nostra13.universalimageloader.utils.L; //导入方法依赖的package包/类
/** Decodes image file into Bitmap, resize it and save it back */
private boolean resizeAndSaveImage(int maxWidth, int maxHeight) throws IOException {
// Decode image file, compress and re-save it
boolean saved = false;
File targetFile = configuration.diskCache.get(uri);
if (targetFile != null && targetFile.exists()) {
ImageSize targetImageSize = new ImageSize(maxWidth, maxHeight);
DisplayImageOptions specialOptions = new DisplayImageOptions.Builder().cloneFrom(options)
.imageScaleType(ImageScaleType.IN_SAMPLE_INT).build();
ImageDecodingInfo decodingInfo = new ImageDecodingInfo(memoryCacheKey,
Scheme.FILE.wrap(targetFile.getAbsolutePath()), uri, targetImageSize, ViewScaleType.FIT_INSIDE,
getDownloader(), specialOptions);
Bitmap bmp = decoder.decode(decodingInfo);
if (bmp != null && configuration.processorForDiskCache != null) {
L.d(LOG_PROCESS_IMAGE_BEFORE_CACHE_ON_DISK, memoryCacheKey);
bmp = configuration.processorForDiskCache.process(bmp);
if (bmp == null) {
L.e(ERROR_PROCESSOR_FOR_DISK_CACHE_NULL, memoryCacheKey);
}
}
if (bmp != null) {
saved = configuration.diskCache.save(uri, bmp);
bmp.recycle();
}
}
return saved;
}
示例10: isViewReused
import com.nostra13.universalimageloader.utils.L; //导入方法依赖的package包/类
/** @return <b>true</b> - if current ImageAware is reused for displaying another image; <b>false</b> - otherwise */
private boolean isViewReused() {
String currentCacheKey = engine.getLoadingUriForView(imageAware);
// Check whether memory cache key (image URI) for current ImageAware is actual.
// If ImageAware is reused for another task then current task should be cancelled.
boolean imageAwareWasReused = !memoryCacheKey.equals(currentCacheKey);
if (imageAwareWasReused) {
L.d(LOG_TASK_CANCELLED_IMAGEAWARE_REUSED, memoryCacheKey);
return true;
}
return false;
}
示例11: considerExactScaleAndOrientatiton
import com.nostra13.universalimageloader.utils.L; //导入方法依赖的package包/类
protected Bitmap considerExactScaleAndOrientatiton(Bitmap subsampledBitmap, ImageDecodingInfo decodingInfo, int rotation, boolean flipHorizontal) {
Matrix m = new Matrix();
ImageScaleType scaleType = decodingInfo.getImageScaleType();
if (scaleType == ImageScaleType.EXACTLY || scaleType == ImageScaleType.EXACTLY_STRETCHED) {
float scale = ImageSizeUtils.computeImageScale(new ImageSize(subsampledBitmap.getWidth(), subsampledBitmap.getHeight(), rotation), decodingInfo.getTargetSize(), decodingInfo.getViewScaleType(), scaleType == ImageScaleType.EXACTLY_STRETCHED);
if (Float.compare(scale, 1.0f) != 0) {
m.setScale(scale, scale);
if (this.loggingEnabled) {
L.d(LOG_SCALE_IMAGE, srcSize, srcSize.scale(scale), Float.valueOf(scale), decodingInfo.getImageKey());
}
}
}
if (flipHorizontal) {
m.postScale(-1.0f, 1.0f);
if (this.loggingEnabled) {
L.d(LOG_FLIP_IMAGE, decodingInfo.getImageKey());
}
}
if (rotation != 0) {
m.postRotate((float) rotation);
if (this.loggingEnabled) {
L.d(LOG_ROTATE_IMAGE, Integer.valueOf(rotation), decodingInfo.getImageKey());
}
}
Bitmap finalBitmap = Bitmap.createBitmap(subsampledBitmap, 0, 0, subsampledBitmap.getWidth(), subsampledBitmap.getHeight(), m, true);
if (finalBitmap != subsampledBitmap) {
subsampledBitmap.recycle();
}
return finalBitmap;
}
示例12: isViewCollected
import com.nostra13.universalimageloader.utils.L; //导入方法依赖的package包/类
/**
* @return <b>true</b> - if target ImageAware is collected by GC; <b>false</b> - otherwise
*/
private boolean isViewCollected() {
if (imageAware.isCollected()) {
L.d(LOG_TASK_CANCELLED_IMAGEAWARE_COLLECTED, memoryCacheKey);
return true;
}
return false;
}
示例13: run
import com.nostra13.universalimageloader.utils.L; //导入方法依赖的package包/类
public void run() {
L.d(LOG_POSTPROCESS_IMAGE, this.imageLoadingInfo.memoryCacheKey);
LoadAndDisplayImageTask.runTask(new DisplayBitmapTask(this.imageLoadingInfo.options
.getPostProcessor().process(this.bitmap), this.imageLoadingInfo, this.engine,
LoadedFrom.MEMORY_CACHE), this.imageLoadingInfo.options.isSyncLoading(), this
.handler, this.engine);
}
示例14: isViewReused
import com.nostra13.universalimageloader.utils.L; //导入方法依赖的package包/类
private boolean isViewReused() {
boolean imageAwareWasReused;
if (this.memoryCacheKey.equals(this.engine.getLoadingUriForView(this.imageAware))) {
imageAwareWasReused = false;
} else {
imageAwareWasReused = true;
}
if (!imageAwareWasReused) {
return false;
}
L.d(LOG_TASK_CANCELLED_IMAGEAWARE_REUSED, this.memoryCacheKey);
return true;
}
示例15: destroy
import com.nostra13.universalimageloader.utils.L; //导入方法依赖的package包/类
public void destroy() {
if (this.configuration != null) {
L.d(LOG_DESTROY, new Object[0]);
}
stop();
this.configuration.diskCache.close();
this.engine = null;
this.configuration = null;
}