Exemplo n.º 1
0
 /**
  * 将一个请求加入队列
  *
  * @param position
  * @param imageViewEntry
  */
 public synchronized void addImage(ImageViewEntry imageViewEntry) {
   // TODO 添加一个项中有多张图片请求
   Log.e(TAG, "线程是否运行?" + mImageLoaderThread.hasNext);
   if (!mImageLoaderThread.hasNext) {
     startLoad();
   }
   for (int i = 0; i < mImageViewPool.size(); i++) {
     ImageViewEntry entry = mImageViewPool.get(i);
     if (entry.isSame(imageViewEntry)) {
       return;
     }
   }
   Log.e(TAG, "添加位置为" + imageViewEntry.position + "的图片");
   mImageViewPool.add(imageViewEntry);
 }
Exemplo n.º 2
0
 /**
  * SDCard图片
  *
  * @param url
  * @return drawable
  */
 private Drawable getDrawableSDCard(ImageViewEntry entry) {
   String imagePath = SDCARD_PATH + entry.getFileName();
   Log.e(TAG, "从SDCard获取图片的地址:" + imagePath);
   return Drawable.createFromPath(imagePath);
 }