yangkong / android-query

Automatically exported from code.google.com/p/android-query
0 stars 0 forks source link

Should delay for specific file path #50

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,
This is not an issue but a feature request.
Is it possible to write a shouldDelay method that take a file or a path instead 
of an url in order to load asynchronously an image that has not be cached by 
AQUery before ?
For exemple, I'm writing an app where I download myself a .zip containing 
images. Then I save them in a folder in the sdcard and I want to display them 
in a list/gridview with the benefits of the shouldDelay method.
Thanks again for this awesome lib, I use it a lot in Traktoid : 
https://github.com/florianmski/Traktoid

Original issue reported on code.google.com by tinyeeliu@gmail.com on 16 May 2012 at 4:47

GoogleCodeExporter commented 9 years ago
There was a should delay method for files in previous version, but file 
checking can hold the UI thread (most of time it's very fast, but sometimes can 
be slow depends on file system activities). 

Due to that reason I don't want to add to the lib and encourage this practice.

However, you can easily check the cached file with the 
getCachedFile(java.lang.String url). If the result is not null, that means the 
file is cached.

http://android-query.googlecode.com/svn/trunk/javadoc/com/androidquery/AbstractA
Query.html

Original comment by tinyeeliu@gmail.com on 14 Dec 2012 at 10:12