Java Code Examples for com.nostra13.universalimageloader.utils.L#w()

The following examples show how to use com.nostra13.universalimageloader.utils.L#w() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ViewAware.java    From MiBandDecompiled with Apache License 2.0 6 votes vote down vote up
public boolean setImageDrawable(Drawable drawable)
{
    if (Looper.myLooper() == Looper.getMainLooper())
    {
        View view = (View)viewRef.get();
        if (view != null)
        {
            setImageDrawableInto(drawable, view);
            return true;
        }
    } else
    {
        L.w("Can't set a drawable into view. You should call ImageLoader on UI thread for it.", new Object[0]);
    }
    return false;
}
 
Example 2
Source File: LimitedMemoryCache.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
public LimitedMemoryCache(int i)
{
    c = i;
    if (i > 0x1000000)
    {
        Object aobj[] = new Object[1];
        aobj[0] = Integer.valueOf(16);
        L.w("You set too large memory cache size (more than %1$d Mb)", aobj);
    }
}
 
Example 3
Source File: LimitedMemoryCache.java    From candybar with Apache License 2.0 5 votes vote down vote up
/**
 * @param sizeLimit Maximum size for cache (in bytes)
 */
public LimitedMemoryCache(int sizeLimit) {
    this.sizeLimit = sizeLimit;
    cacheSize = new AtomicInteger();
    if (sizeLimit > MAX_NORMAL_CACHE_SIZE) {
        L.w("You set too large memory cache size (more than %1$d Mb)", MAX_NORMAL_CACHE_SIZE_IN_MB);
    }
}
 
Example 4
Source File: ImageLoaderConfiguration.java    From letv with Apache License 2.0 5 votes vote down vote up
public Builder diskCacheFileCount(int maxFileCount) {
    if (maxFileCount <= 0) {
        throw new IllegalArgumentException("maxFileCount must be a positive number");
    }
    if (this.diskCache != null) {
        L.w(WARNING_OVERLAP_DISK_CACHE_PARAMS, new Object[0]);
    }
    this.diskCacheFileCount = maxFileCount;
    return this;
}
 
Example 5
Source File: ImageLoaderConfiguration.java    From mobile-manager-tool with MIT License 5 votes vote down vote up
/**
 * Sets maximum file count in disk cache directory.<br />
 * By default: disk cache is unlimited.<br />
 * <b>NOTE:</b> If you use this method then
 * {@link com.nostra13.universalimageloader.cache.disc.impl.ext.LruDiscCache LruDiscCache}
 * will be used as disk cache. You can use {@link #diskCache(DiskCache)} method for introduction your own
 * implementation of {@link DiskCache}
 */
public Builder diskCacheFileCount(int maxFileCount) {
	if (maxFileCount <= 0) throw new IllegalArgumentException("maxFileCount must be a positive number");

	if (diskCache != null) {
		L.w(WARNING_OVERLAP_DISK_CACHE_PARAMS);
	}

	this.diskCacheFileCount = maxFileCount;
	return this;
}
 
Example 6
Source File: BaseImageDecoder.java    From WliveTV with Apache License 2.0 5 votes vote down vote up
protected ExifInfo defineExifOrientation(String imageUri) {
	int rotation = 0;
	boolean flip = false;
	try {
		ExifInterface exif = new ExifInterface(Scheme.FILE.crop(imageUri));
		int exifOrientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
		switch (exifOrientation) {
			case ExifInterface.ORIENTATION_FLIP_HORIZONTAL:
				flip = true;
			case ExifInterface.ORIENTATION_NORMAL:
				rotation = 0;
				break;
			case ExifInterface.ORIENTATION_TRANSVERSE:
				flip = true;
			case ExifInterface.ORIENTATION_ROTATE_90:
				rotation = 90;
				break;
			case ExifInterface.ORIENTATION_FLIP_VERTICAL:
				flip = true;
			case ExifInterface.ORIENTATION_ROTATE_180:
				rotation = 180;
				break;
			case ExifInterface.ORIENTATION_TRANSPOSE:
				flip = true;
			case ExifInterface.ORIENTATION_ROTATE_270:
				rotation = 270;
				break;
		}
	} catch (IOException e) {
		L.w("Can't read EXIF tags from file [%s]", imageUri);
	}
	return new ExifInfo(rotation, flip);
}
 
Example 7
Source File: ViewAware.java    From WliveTV with Apache License 2.0 5 votes vote down vote up
@Override
public boolean setImageDrawable(Drawable drawable) {
	if (Looper.myLooper() == Looper.getMainLooper()) {
		View view = viewRef.get();
		if (view != null) {
			setImageDrawableInto(drawable, view);
			return true;
		}
	} else {
		L.w(WARN_CANT_SET_DRAWABLE);
	}
	return false;
}
 
Example 8
Source File: ImageLoaderConfiguration.java    From letv with Apache License 2.0 5 votes vote down vote up
public Builder taskExecutorForCachedImages(Executor executorForCachedImages) {
    if (!(this.threadPoolSize == 3 && this.threadPriority == 4 && this.tasksProcessingType == DEFAULT_TASK_PROCESSING_TYPE)) {
        L.w(WARNING_OVERLAP_EXECUTOR, new Object[0]);
    }
    this.taskExecutorForCachedImages = executorForCachedImages;
    return this;
}
 
Example 9
Source File: ImageLoaderConfiguration.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
public Builder tasksProcessingOrder(QueueProcessingType queueprocessingtype)
{
    if (k != null || l != null)
    {
        L.w("threadPoolSize(), threadPriority() and tasksProcessingOrder() calls can overlap taskExecutor() and taskExecutorForCachedImages() calls.", new Object[0]);
    }
    r = queueprocessingtype;
    return this;
}
 
Example 10
Source File: ImageLoaderConfiguration$Builder.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
public y memoryCache(MemoryCache memorycache)
{
    if (s != 0)
    {
        L.w("memoryCache() and memoryCacheSize() calls overlap each other", new Object[0]);
    }
    v = memorycache;
    return this;
}
 
Example 11
Source File: BaseImageDecoder.java    From android-open-project-demo with Apache License 2.0 5 votes vote down vote up
protected ExifInfo defineExifOrientation(String imageUri) {
	int rotation = 0;
	boolean flip = false;
	try {
		ExifInterface exif = new ExifInterface(Scheme.FILE.crop(imageUri));
		int exifOrientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
		switch (exifOrientation) {
			case ExifInterface.ORIENTATION_FLIP_HORIZONTAL:
				flip = true;
			case ExifInterface.ORIENTATION_NORMAL:
				rotation = 0;
				break;
			case ExifInterface.ORIENTATION_TRANSVERSE:
				flip = true;
			case ExifInterface.ORIENTATION_ROTATE_90:
				rotation = 90;
				break;
			case ExifInterface.ORIENTATION_FLIP_VERTICAL:
				flip = true;
			case ExifInterface.ORIENTATION_ROTATE_180:
				rotation = 180;
				break;
			case ExifInterface.ORIENTATION_TRANSPOSE:
				flip = true;
			case ExifInterface.ORIENTATION_ROTATE_270:
				rotation = 270;
				break;
		}
	} catch (IOException e) {
		L.w("Can't read EXIF tags from file [%s]", imageUri);
	}
	return new ExifInfo(rotation, flip);
}
 
Example 12
Source File: ImageLoaderConfiguration.java    From WliveTV with Apache License 2.0 5 votes vote down vote up
/**
 * Sets type of queue processing for tasks for loading and displaying images.<br />
 * Default value - {@link QueueProcessingType#FIFO}
 */
public Builder tasksProcessingOrder(QueueProcessingType tasksProcessingType) {
	if (taskExecutor != null || taskExecutorForCachedImages != null) {
		L.w(WARNING_OVERLAP_EXECUTOR);
	}

	this.tasksProcessingType = tasksProcessingType;
	return this;
}
 
Example 13
Source File: ViewAware.java    From BigApp_WordPress_Android with Apache License 2.0 5 votes vote down vote up
@Override
public boolean setImageBitmap(Bitmap bitmap) {
	if (Looper.myLooper() == Looper.getMainLooper()) {
		View view = viewRef.get();
		if (view != null) {
			setImageBitmapInto(bitmap, view);
			return true;
		}
	} else {
		L.w(WARN_CANT_SET_BITMAP);
	}
	return false;
}
 
Example 14
Source File: ImageLoaderConfiguration.java    From candybar with Apache License 2.0 5 votes vote down vote up
/**
 * Sets name generator for files cached in disk cache.<br />
 * Default value -
 * {@link com.nostra13.universalimageloader.core.DefaultConfigurationFactory#createFileNameGenerator()
 * DefaultConfigurationFactory.createFileNameGenerator()}
 */
public Builder diskCacheFileNameGenerator(FileNameGenerator fileNameGenerator) {
    if (diskCache != null) {
        L.w(WARNING_OVERLAP_DISK_CACHE_NAME_GENERATOR);
    }

    this.diskCacheFileNameGenerator = fileNameGenerator;
    return this;
}
 
Example 15
Source File: ImageLoader.java    From mobile-manager-tool with MIT License 5 votes vote down vote up
/**
 * Initializes ImageLoader instance with configuration.<br />
 * If configurations was set before ( {@link #isInited()} == true) then this method does nothing.<br />
 * To force initialization with new configuration you should {@linkplain #destroy() destroy ImageLoader} at first.
 *
 * @param configuration {@linkplain com.nostra13.universalimageloader.core.ImageLoaderConfiguration ImageLoader configuration}
 * @throws IllegalArgumentException if <b>configuration</b> parameter is null
 */
public synchronized void init(ImageLoaderConfiguration configuration) {
	if (configuration == null) {
		throw new IllegalArgumentException(ERROR_INIT_CONFIG_WITH_NULL);
	}
	if (this.configuration == null) {
		L.d(LOG_INIT_CONFIG);
		engine = new com.nostra13.universalimageloader.core.ImageLoaderEngine(configuration);
		this.configuration = configuration;
	} else {
		L.w(WARNING_RE_INIT_CONFIG);
	}
}
 
Example 16
Source File: ImageLoaderConfiguration.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
public Builder threadPoolSize(int i1)
{
    if (k != null || l != null)
    {
        L.w("threadPoolSize(), threadPriority() and tasksProcessingOrder() calls can overlap taskExecutor() and taskExecutorForCachedImages() calls.", new Object[0]);
    }
    o = i1;
    return this;
}
 
Example 17
Source File: ImageLoaderConfiguration$Builder.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
public k taskExecutorForCachedImages(Executor executor)
{
    if (o != 3 || p != 4 || r != DEFAULT_TASK_PROCESSING_TYPE)
    {
        L.w("threadPoolSize(), threadPriority() and tasksProcessingOrder() calls can overlap taskExecutor() and taskExecutorForCachedImages() calls.", new Object[0]);
    }
    l = executor;
    return this;
}
 
Example 18
Source File: ImageLoaderConfiguration$Builder.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
public l tasksProcessingOrder(QueueProcessingType queueprocessingtype)
{
    if (k != null || l != null)
    {
        L.w("threadPoolSize(), threadPriority() and tasksProcessingOrder() calls can overlap taskExecutor() and taskExecutorForCachedImages() calls.", new Object[0]);
    }
    r = queueprocessingtype;
    return this;
}
 
Example 19
Source File: ImageLoaderConfiguration.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
public Builder diskCacheFileNameGenerator(FileNameGenerator filenamegenerator)
{
    if (w != null)
    {
        L.w("diskCache() and diskCacheFileNameGenerator() calls overlap each other", new Object[0]);
    }
    x = filenamegenerator;
    return this;
}
 
Example 20
Source File: ImageLoaderConfiguration.java    From WliveTV with Apache License 2.0 3 votes vote down vote up
/**
 * Sets custom {@linkplain Executor executor} for tasks of loading and displaying images.<br />
 * <br />
 * <b>NOTE:</b> If you set custom executor then following configuration options will not be considered for this
 * executor:
 * <ul>
 * <li>{@link #threadPoolSize(int)}</li>
 * <li>{@link #threadPriority(int)}</li>
 * <li>{@link #tasksProcessingOrder(QueueProcessingType)}</li>
 * </ul>
 *
 * @see #taskExecutorForCachedImages(Executor)
 */
public Builder taskExecutor(Executor executor) {
	if (threadPoolSize != DEFAULT_THREAD_POOL_SIZE || threadPriority != DEFAULT_THREAD_PRIORITY || tasksProcessingType != DEFAULT_TASK_PROCESSING_TYPE) {
		L.w(WARNING_OVERLAP_EXECUTOR);
	}

	this.taskExecutor = executor;
	return this;
}