71c01abdb5421bc2edb2b14be9f0d0e11a7a307b.svn-base 676 B

123456789101112131415161718192021222324252627282930313233343536
  1. package com.hjq.image;
  2. import android.app.Application;
  3. import android.content.Context;
  4. import android.graphics.drawable.Drawable;
  5. /**
  6. * desc : 图片加载器生产机器
  7. */
  8. public interface ImageFactory<T extends ImageHandler> {
  9. /**
  10. * 创建一个图片加载器
  11. */
  12. T create();
  13. /**
  14. * 初始化图片加载器
  15. */
  16. void init(Application application, T handler);
  17. /**
  18. * 获取图片加载占位图
  19. */
  20. Drawable getLoadingPic(Context context);
  21. /**
  22. * 获取图片加载失败占位图
  23. */
  24. Drawable getErrorPic(Context context);
  25. /**
  26. * 清理缓存
  27. */
  28. void clear(Context context);
  29. }