-
Notifications
You must be signed in to change notification settings - Fork 384
Expand file tree
/
Copy pathImageLoader.java
More file actions
57 lines (45 loc) · 1.13 KB
/
Copy pathImageLoader.java
File metadata and controls
57 lines (45 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package com.hitomi.tilibrary.loader;
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
import java.io.File;
/**
* 图片加载器接口,实现 ImageLoader 可扩展自己的图片加载器
* Created by Vans Z on 2017/1/20.
* <p>
* email: 196425254@qq.com
*/
public interface ImageLoader {
/**
* 状态码,加载原图失败
*/
int STATUS_DISPLAY_FAILED = 0;
/**
* 状态码,加载原图成功
*/
int STATUS_DISPLAY_SUCCESS = 1;
/**
* 加载原图
*
* @param imageUrl 图片地址
* @param callback 源图加载的回调
*/
void loadSource(String imageUrl, @Nullable final SourceCallback callback);
/**
* 获取 url 关联的图片缓存
*/
File getCache(String url);
File getCacheDir();
String getCacheFileName(String url);
/**
* 清除 ImageLoader 缓存
*/
void clearCache();
interface SourceCallback {
@UiThread
void onStart();
@UiThread
void onProgress(int progress);
@UiThread
void onDelivered(int status, @Nullable File source);
}
}