use of com.androidquery.callback.BitmapAjaxCallback in project androidquery by androidquery.
the class AQueryImageTest method testImageByCallback2.
public void testImageByCallback2() {
clearCache();
AQUtility.post(new Runnable() {
@Override
public void run() {
BitmapAjaxCallback cb = new BitmapAjaxCallback() {
protected void callback(String url, ImageView iv, Bitmap bm, AjaxStatus status) {
iv.setImageBitmap(bm);
}
};
aq.id(R.id.image).image(ICON_URL, true, true, 0, 0, cb);
}
});
waitAsync(2000);
assertLoaded(aq.getImageView(), true);
Bitmap bm = aq.getCachedImage(ICON_URL);
assertNotNull(bm);
}
use of com.androidquery.callback.BitmapAjaxCallback in project androidquery by androidquery.
the class AQueryImageTest method testAutoRotate.
/*
public void testIfModified() {
String url = ICON_URL;
AjaxCallback<Bitmap> cb = new AjaxCallback<Bitmap>();
cb.type(Bitmap.class).url(url);
aq.sync(cb);
Bitmap bm = cb.getResult();
AjaxStatus status = cb.getStatus();
assertNotNull(bm);
assertEquals(304, status.getCode());
File file;
}
*/
public void testAutoRotate() throws IOException {
String imageUrl = "http://res.dbkon.co.kr/resource/201302091360376386575001.jpg";
BitmapAjaxCallback cb = new BitmapAjaxCallback();
cb.url(imageUrl).targetWidth(300).rotate(true);
aq.id(R.id.image).image(cb);
cb.block();
Bitmap bm = cb.getResult();
AjaxStatus status = cb.getStatus();
assertNotNull(bm);
}
use of com.androidquery.callback.BitmapAjaxCallback in project androidquery by androidquery.
the class ImageLoadingActivity method image_advance.
public void image_advance() {
aq.id(R.id.image).width(LayoutParams.FILL_PARENT);
String imageUrl = "http://farm3.static.flickr.com/2199/2218403922_062bc3bcf2.jpg";
BitmapAjaxCallback cb = new BitmapAjaxCallback();
cb.url(imageUrl).animation(AQuery.FADE_IN).ratio(1.0f);
aq.id(R.id.image).image(cb);
}
use of com.androidquery.callback.BitmapAjaxCallback in project androidquery by androidquery.
the class AQueryImageTest method testImageByCallbackAsync.
public void testImageByCallbackAsync() {
clearCache();
AQUtility.post(new Runnable() {
@Override
public void run() {
// aq.id(R.id.image).image(ICON_URL, true, true, 0, 0, null, AQuery.FADE_IN);
BitmapAjaxCallback cb = new BitmapAjaxCallback();
cb.url(ICON_URL);
// aq.id(R.id.image).image(cb);
ImageView iv = aq.id(R.id.image).getImageView();
cb.imageView(iv).async(getActivity());
}
});
waitAsync(2000);
assertLoaded(aq.getImageView(), true);
Bitmap bm = aq.getCachedImage(ICON_URL);
assertNotNull(bm);
}
use of com.androidquery.callback.BitmapAjaxCallback in project androidquery by androidquery.
the class ImageLoadingActivity method image_auto_rotate.
public void image_auto_rotate() {
String imageUrl = "http://res.dbkon.co.kr/resource/201302091360376386575001.jpg";
// imageUrl = "http://www.androidquery.com/z/images/vikispot/android-w.png";
BitmapAjaxCallback cb = new BitmapAjaxCallback();
cb.url(imageUrl).targetWidth(300).rotate(true);
aq.id(R.id.image).image(cb);
}
Aggregations