use of org.qii.weiciyuan.support.asyncdrawable.IPictureWorker in project weiciyuan by qii.
the class AbstractAppListAdapter method interruptPicDownload.
protected void interruptPicDownload(GridLayout gridLayout) {
for (int i = 0; i < gridLayout.getChildCount(); i++) {
ImageView iv = (ImageView) gridLayout.getChildAt(i);
if (iv != null) {
Drawable drawable = iv.getDrawable();
if (drawable instanceof PictureBitmapDrawable) {
PictureBitmapDrawable downloadedDrawable = (PictureBitmapDrawable) drawable;
IPictureWorker worker = downloadedDrawable.getBitmapDownloaderTask();
if (worker != null) {
((MyAsyncTask) worker).cancel(true);
}
iv.setImageDrawable(null);
}
}
}
}
use of org.qii.weiciyuan.support.asyncdrawable.IPictureWorker in project weiciyuan by qii.
the class AbstractAppListAdapter method interruptPicDownload.
protected void interruptPicDownload(IWeiciyuanDrawable view) {
Drawable drawable = view.getImageView().getDrawable();
if (drawable instanceof PictureBitmapDrawable) {
PictureBitmapDrawable downloadedDrawable = (PictureBitmapDrawable) drawable;
IPictureWorker worker = downloadedDrawable.getBitmapDownloaderTask();
if (worker != null) {
((MyAsyncTask) worker).cancel(true);
}
}
view.getImageView().setImageDrawable(null);
}
Aggregations