Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
沉迷打码的小凳子
glide
提交
785dc5ee
G
glide
项目概览
沉迷打码的小凳子
/
glide
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
glide
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
785dc5ee
编写于
6月 01, 2014
作者:
S
Sam Judd
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make ResourceCallback return non generic resources
上级
44e0516e
变更
21
隐藏空白更改
内联
并排
Showing
21 changed file
with
183 addition
and
94 deletion
+183
-94
library/robolectric/src/com/bumptech/glide/load/engine/EngineJobTest.java
...ric/src/com/bumptech/glide/load/engine/EngineJobTest.java
+2
-2
library/robolectric/src/com/bumptech/glide/load/engine/EngineTest.java
...ectric/src/com/bumptech/glide/load/engine/EngineTest.java
+2
-2
library/robolectric/src/com/bumptech/glide/load/engine/ResourceRunnerTest.java
...rc/com/bumptech/glide/load/engine/ResourceRunnerTest.java
+2
-5
library/robolectric/src/com/bumptech/glide/load/engine/SourceResourceRunnerTest.java
.../bumptech/glide/load/engine/SourceResourceRunnerTest.java
+1
-1
library/robolectric/src/com/bumptech/glide/request/GenericRequestTest.java
...ic/src/com/bumptech/glide/request/GenericRequestTest.java
+18
-6
library/robolectric/src/com/bumptech/glide/request/target/ImageViewTargetFactoryTest.java
...tech/glide/request/target/ImageViewTargetFactoryTest.java
+33
-0
library/src/com/bumptech/glide/BitmapRequestBuilder.java
library/src/com/bumptech/glide/BitmapRequestBuilder.java
+4
-2
library/src/com/bumptech/glide/GenericRequestBuilder.java
library/src/com/bumptech/glide/GenericRequestBuilder.java
+37
-28
library/src/com/bumptech/glide/Glide.java
library/src/com/bumptech/glide/Glide.java
+27
-13
library/src/com/bumptech/glide/ListPreloader.java
library/src/com/bumptech/glide/ListPreloader.java
+1
-1
library/src/com/bumptech/glide/Resource.java
library/src/com/bumptech/glide/Resource.java
+3
-3
library/src/com/bumptech/glide/load/engine/DefaultResourceRunnerFactory.java
...ptech/glide/load/engine/DefaultResourceRunnerFactory.java
+1
-1
library/src/com/bumptech/glide/load/engine/Engine.java
library/src/com/bumptech/glide/load/engine/Engine.java
+4
-4
library/src/com/bumptech/glide/load/engine/EngineJob.java
library/src/com/bumptech/glide/load/engine/EngineJob.java
+5
-8
library/src/com/bumptech/glide/load/engine/ResourceRunner.java
...ry/src/com/bumptech/glide/load/engine/ResourceRunner.java
+3
-3
library/src/com/bumptech/glide/load/engine/SourceResourceRunner.java
.../com/bumptech/glide/load/engine/SourceResourceRunner.java
+2
-2
library/src/com/bumptech/glide/request/ResourceCallback.java
library/src/com/bumptech/glide/request/ResourceCallback.java
+2
-2
library/src/com/bumptech/glide/request/bitmap/GenericRequest.java
...src/com/bumptech/glide/request/bitmap/GenericRequest.java
+17
-6
library/src/com/bumptech/glide/request/target/BitmapImageViewTarget.java
.../bumptech/glide/request/target/BitmapImageViewTarget.java
+2
-3
library/src/com/bumptech/glide/request/target/ImageViewTargetFactory.java
...bumptech/glide/request/target/ImageViewTargetFactory.java
+16
-0
library/src/com/bumptech/glide/request/target/Target.java
library/src/com/bumptech/glide/request/target/Target.java
+1
-2
未找到文件。
library/robolectric/src/com/bumptech/glide/load/engine/EngineJobTest.java
浏览文件 @
785dc5ee
...
...
@@ -174,11 +174,11 @@ public class EngineJobTest {
Key
key
=
mock
(
Key
.
class
);
MemoryCache
memoryCache
=
mock
(
MemoryCache
.
class
);
Handler
mainHandler
=
new
Handler
();
ResourceCallback
<
Object
>
cb
=
mock
(
ResourceCallback
.
class
);
ResourceCallback
cb
=
mock
(
ResourceCallback
.
class
);
Resource
<
Object
>
resource
=
mock
(
Resource
.
class
);
EngineJobListener
listener
=
mock
(
EngineJobListener
.
class
);
EngineJob
<
Object
>
job
=
new
EngineJob
<
Object
>
(
key
,
memoryCache
,
mainHandler
,
listener
);
EngineJob
job
=
new
EngineJob
(
key
,
memoryCache
,
mainHandler
,
listener
);
public
EngineJobHarness
()
{
job
.
addCallback
(
cb
);
...
...
library/robolectric/src/com/bumptech/glide/load/engine/EngineTest.java
浏览文件 @
785dc5ee
...
...
@@ -218,7 +218,7 @@ public class EngineTest {
ResourceDecoder
<
Object
,
Object
>
decoder
=
mock
(
ResourceDecoder
.
class
);
ResourceEncoder
<
Object
>
encoder
=
mock
(
ResourceEncoder
.
class
);
Priority
priority
=
Priority
.
NORMAL
;
ResourceCallback
<
Object
>
cb
=
mock
(
ResourceCallback
.
class
);
ResourceCallback
cb
=
mock
(
ResourceCallback
.
class
);
Resource
<
Object
>
resource
=
mock
(
Resource
.
class
);
Map
<
Key
,
ResourceRunner
>
runners
=
new
HashMap
<
Key
,
ResourceRunner
>();
Transformation
transformation
=
mock
(
Transformation
.
class
);
...
...
@@ -228,7 +228,7 @@ public class EngineTest {
MemoryCache
cache
=
mock
(
MemoryCache
.
class
);
ResourceRunner
<
Object
>
runner
=
mock
(
ResourceRunner
.
class
);
EngineJob
<
Object
>
job
;
EngineJob
job
;
Engine
engine
;
public
EngineTestHarness
()
{
...
...
library/robolectric/src/com/bumptech/glide/load/engine/ResourceRunnerTest.java
浏览文件 @
785dc5ee
...
...
@@ -2,11 +2,8 @@ package com.bumptech.glide.load.engine;
import
android.os.Handler
;
import
com.bumptech.glide.Resource
;
import
com.bumptech.glide.load.ResourceDecoder
;
import
com.bumptech.glide.load.engine.EngineJob
;
import
com.bumptech.glide.load.Key
;
import
com.bumptech.glide.load.engine.ResourceRunner
;
import
com.bumptech.glide.load.engine.SourceResourceRunner
;
import
com.bumptech.glide.load.ResourceDecoder
;
import
com.bumptech.glide.load.engine.cache.DiskCache
;
import
org.junit.Before
;
import
org.junit.Test
;
...
...
@@ -185,7 +182,7 @@ public class ResourceRunnerTest {
ResourceDecoder
<
Object
,
Object
>
decoder
=
mock
(
ResourceDecoder
.
class
);
SourceResourceRunner
<
Object
,
Object
>
sourceRunner
=
mock
(
SourceResourceRunner
.
class
);
ExecutorService
service
=
mock
(
ExecutorService
.
class
);
EngineJob
<
Object
>
engineJob
=
mock
(
EngineJob
.
class
);
EngineJob
engineJob
=
mock
(
EngineJob
.
class
);
Handler
bgHandler
=
mock
(
Handler
.
class
);
int
width
=
100
;
int
height
=
100
;
...
...
library/robolectric/src/com/bumptech/glide/load/engine/SourceResourceRunnerTest.java
浏览文件 @
785dc5ee
...
...
@@ -169,7 +169,7 @@ public class SourceResourceRunnerTest {
ResourceEncoder
<
Object
>
encoder
=
mock
(
ResourceEncoder
.
class
);
DiskCache
diskCache
=
mock
(
DiskCache
.
class
);
Priority
priority
=
Priority
.
LOW
;
ResourceCallback
<
Object
>
cb
=
mock
(
ResourceCallback
.
class
);
ResourceCallback
cb
=
mock
(
ResourceCallback
.
class
);
Resource
<
Object
>
result
=
mock
(
Resource
.
class
);
Transformation
<
Object
>
transformation
=
mock
(
Transformation
.
class
);
int
width
=
150
;
...
...
library/robolectric/src/com/bumptech/glide/request/GenericRequestTest.java
浏览文件 @
785dc5ee
...
...
@@ -64,7 +64,7 @@ public class GenericRequestTest {
public
GenericRequest
<
Object
,
Object
,
Object
>
getRequest
()
{
return
new
GenericRequest
<
Object
,
Object
,
Object
>(
loadProvider
,
model
,
context
,
priority
,
target
,
1
f
,
placeholderDrawable
,
placeholderResourceId
,
errorDrawable
,
errorResourceId
,
null
,
0
,
null
,
requestCoordinator
,
engine
,
mock
(
Transformation
.
class
));
requestCoordinator
,
engine
,
mock
(
Transformation
.
class
)
,
Object
.
class
);
}
}
...
...
@@ -80,10 +80,20 @@ public class GenericRequestTest {
assertFalse
(
request
.
isComplete
());
}
@Test
public
void
testCanHandleNullResources
()
{
GenericRequest
request
=
harness
.
getRequest
();
request
.
onResourceReady
(
null
);
assertTrue
(
request
.
isFailed
());
}
@Test
public
void
testIsCompleteAfterReceivingResource
()
{
GenericRequest
request
=
harness
.
getRequest
();
when
(
harness
.
resource
.
get
()).
thenReturn
(
new
Object
());
request
.
onResourceReady
(
harness
.
resource
);
assertTrue
(
request
.
isComplete
());
...
...
@@ -95,15 +105,16 @@ public class GenericRequestTest {
doAnswer
(
new
Answer
()
{
@Override
public
Object
answer
(
InvocationOnMock
invocation
)
throws
Throwable
{
com
.
bumptech
.
glide
.
request
.
Request
request
=
(
com
.
bumptech
.
glide
.
request
.
Request
)
invocation
.
getArguments
()[
0
];
Request
request
=
(
Request
)
invocation
.
getArguments
()[
0
];
assertFalse
(
request
.
isComplete
());
return
true
;
}
}).
when
(
requestCoordinator
).
canSetImage
(
any
(
com
.
bumptech
.
glide
.
request
.
Request
.
class
));
}).
when
(
requestCoordinator
).
canSetImage
(
any
(
Request
.
class
));
harness
.
requestCoordinator
=
requestCoordinator
;
GenericRequest
request
=
harness
.
getRequest
();
when
(
harness
.
resource
.
get
()).
thenReturn
(
new
Object
());
request
.
onResourceReady
(
harness
.
resource
);
verify
(
requestCoordinator
).
canSetImage
(
eq
(
request
));
...
...
@@ -157,6 +168,7 @@ public class GenericRequestTest {
public
void
testResourceIsRecycledOnClear
()
{
GenericRequest
request
=
harness
.
getRequest
();
when
(
harness
.
resource
.
get
()).
thenReturn
(
new
Object
());
request
.
onResourceReady
(
harness
.
resource
);
request
.
clear
();
...
...
@@ -272,11 +284,11 @@ public class GenericRequestTest {
return
context
;
}
private
static
class
MockTarget
implements
Target
<
Object
>
{
private
static
class
MockTarget
implements
Target
{
private
Drawable
currentPlaceholder
;
@Override
public
void
onResourceReady
(
Resource
<
Object
>
resource
)
{
public
void
onResourceReady
(
Object
resource
)
{
currentPlaceholder
=
null
;
}
...
...
@@ -294,7 +306,7 @@ public class GenericRequestTest {
}
@Override
public
void
setRequest
(
com
.
bumptech
.
glide
.
request
.
Request
request
)
{
public
void
setRequest
(
Request
request
)
{
}
@Override
...
...
library/robolectric/src/com/bumptech/glide/request/target/ImageViewTargetFactoryTest.java
0 → 100644
浏览文件 @
785dc5ee
package
com.bumptech.glide.request.target
;
import
android.graphics.Bitmap
;
import
android.widget.ImageView
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.robolectric.Robolectric
;
import
org.robolectric.RobolectricTestRunner
;
import
static
junit
.
framework
.
Assert
.
assertNotNull
;
@RunWith
(
RobolectricTestRunner
.
class
)
public
class
ImageViewTargetFactoryTest
{
private
ImageViewTargetFactory
factory
;
private
ImageView
view
;
@Before
public
void
setUp
()
{
factory
=
new
ImageViewTargetFactory
();
view
=
new
ImageView
(
Robolectric
.
application
);
}
@Test
public
void
testReturnsTargetForBitmaps
()
{
assertNotNull
(
factory
.
buildTarget
(
view
,
Bitmap
.
class
));
}
@Test
(
expected
=
IllegalArgumentException
.
class
)
public
void
testThrowsForUnknownType
()
{
factory
.
buildTarget
(
view
,
Object
.
class
);
}
}
library/src/com/bumptech/glide/BitmapRequestBuilder.java
浏览文件 @
785dc5ee
...
...
@@ -15,6 +15,7 @@ import com.bumptech.glide.load.data.bitmap.StreamBitmapDecoder;
import
com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool
;
import
com.bumptech.glide.provider.LoadProvider
;
import
com.bumptech.glide.request.bitmap.RequestListener
;
import
com.bumptech.glide.request.target.ImageViewTargetFactory
;
import
java.io.InputStream
;
...
...
@@ -33,8 +34,9 @@ public class BitmapRequestBuilder<ModelType> extends GenericRequestBuilder<Model
BitmapRequestBuilder
(
Context
context
,
ModelType
model
,
LoadProvider
<
ModelType
,
InputStream
,
Bitmap
>
streamLoadProvider
,
LoadProvider
<
ModelType
,
ParcelFileDescriptor
,
Bitmap
>
fileDescriptorLoadProvider
,
BitmapPool
bitmapPool
)
{
super
(
context
,
model
,
streamLoadProvider
,
fileDescriptorLoadProvider
);
LoadProvider
<
ModelType
,
ParcelFileDescriptor
,
Bitmap
>
fileDescriptorLoadProvider
,
BitmapPool
bitmapPool
,
ImageViewTargetFactory
factory
)
{
super
(
context
,
model
,
streamLoadProvider
,
fileDescriptorLoadProvider
,
Bitmap
.
class
,
factory
);
this
.
bitmapPool
=
bitmapPool
;
}
...
...
library/src/com/bumptech/glide/GenericRequestBuilder.java
浏览文件 @
785dc5ee
...
...
@@ -3,6 +3,7 @@ package com.bumptech.glide;
import
android.content.Context
;
import
android.graphics.Bitmap
;
import
android.graphics.drawable.Drawable
;
import
android.view.View
;
import
android.view.animation.Animation
;
import
android.widget.ImageView
;
import
com.bumptech.glide.load.MultiTransformation
;
...
...
@@ -15,10 +16,13 @@ import com.bumptech.glide.load.model.ModelLoader;
import
com.bumptech.glide.provider.ChildLoadProvider
;
import
com.bumptech.glide.provider.LoadProvider
;
import
com.bumptech.glide.request.MultiTypeRequestCoordinator
;
import
com.bumptech.glide.request.Request
;
import
com.bumptech.glide.request.RequestCoordinator
;
import
com.bumptech.glide.request.ThumbnailRequestCoordinator
;
import
com.bumptech.glide.request.bitmap.GenericRequest
;
import
com.bumptech.glide.request.bitmap.RequestListener
;
import
com.bumptech.glide.request.target.BitmapImageViewTarget
;
import
com.bumptech.glide.request.target.ImageViewTargetFactory
;
import
com.bumptech.glide.request.target.Target
;
import
java.util.ArrayList
;
...
...
@@ -42,6 +46,8 @@ public class GenericRequestBuilder<ModelType, ImageDataType, VideoDataType, Reso
private
final
ModelType
model
;
private
final
ChildLoadProvider
<
ModelType
,
ImageDataType
,
ResourceType
>
imageLoadProvider
;
private
final
ChildLoadProvider
<
ModelType
,
VideoDataType
,
ResourceType
>
videoLoadProvider
;
private
final
Class
<
ResourceType
>
resourceClass
;
private
final
ImageViewTargetFactory
viewTargetFactory
;
private
int
animationId
;
private
Animation
animation
;
private
int
placeholderId
;
...
...
@@ -56,7 +62,10 @@ public class GenericRequestBuilder<ModelType, ImageDataType, VideoDataType, Reso
public
GenericRequestBuilder
(
Context
context
,
ModelType
model
,
LoadProvider
<
ModelType
,
ImageDataType
,
ResourceType
>
imageLoadProvider
,
LoadProvider
<
ModelType
,
VideoDataType
,
ResourceType
>
videoLoadProvider
)
{
LoadProvider
<
ModelType
,
VideoDataType
,
ResourceType
>
videoLoadProvider
,
Class
<
ResourceType
>
resourceClass
,
ImageViewTargetFactory
viewTargetFactory
)
{
this
.
resourceClass
=
resourceClass
;
this
.
viewTargetFactory
=
viewTargetFactory
;
this
.
imageLoadProvider
=
imageLoadProvider
!=
null
?
new
ChildLoadProvider
<
ModelType
,
ImageDataType
,
ResourceType
>(
imageLoadProvider
)
:
null
;
this
.
videoLoadProvider
=
videoLoadProvider
!=
null
?
...
...
@@ -313,12 +322,12 @@ public class GenericRequestBuilder<ModelType, ImageDataType, VideoDataType, Reso
* @return The given target.
*/
public
<
Y
extends
Target
<
ResourceType
>>
Y
into
(
Y
target
)
{
com
.
bumptech
.
glide
.
request
.
Request
previous
=
target
.
getRequest
();
Request
previous
=
target
.
getRequest
();
if
(
previous
!=
null
)
{
previous
.
clear
();
}
com
.
bumptech
.
glide
.
request
.
Request
request
=
buildRequest
(
target
);
Request
request
=
buildRequest
(
target
);
target
.
setRequest
(
request
);
if
(
request
!=
null
)
{
request
.
run
();
...
...
@@ -326,22 +335,21 @@ public class GenericRequestBuilder<ModelType, ImageDataType, VideoDataType, Reso
return
target
;
}
//TODO:
// /**
// * Sets the {@link ImageView} the image will be loaded into, cancels any existing loads into the view, and frees
// * any resources Glide has loaded into the view so they may be reused.
// *
// * @see Glide#clear(View)
// *
// * @param view The view to cancel previous loads for and load the new image into.
// * @return The {@link BitmapImageViewTarget} used to wrap the given {@link ImageView}.
// */
// public BitmapImageViewTarget into(ImageView view) {
// return into(new BitmapImageViewTarget(view));
// }
private
com
.
bumptech
.
glide
.
request
.
Request
buildRequest
(
Target
<
ResourceType
>
target
)
{
final
com
.
bumptech
.
glide
.
request
.
Request
result
;
/**
* Sets the {@link ImageView} the image will be loaded into, cancels any existing loads into the view, and frees
* any resources Glide has loaded into the view so they may be reused.
*
* @see Glide#clear(View)
*
* @param view The view to cancel previous loads for and load the new image into.
* @return The {@link BitmapImageViewTarget} used to wrap the given {@link ImageView}.
*/
public
Target
<
ResourceType
>
into
(
ImageView
view
)
{
return
into
(
viewTargetFactory
.
buildTarget
(
view
,
resourceClass
));
}
private
Request
buildRequest
(
Target
<
ResourceType
>
target
)
{
final
Request
result
;
if
(
priority
==
null
)
{
priority
=
Priority
.
NORMAL
;
...
...
@@ -349,7 +357,7 @@ public class GenericRequestBuilder<ModelType, ImageDataType, VideoDataType, Reso
if
(
thumbnailRequestBuilder
!=
null
)
{
ThumbnailRequestCoordinator
requestCoordinator
=
new
ThumbnailRequestCoordinator
();
com
.
bumptech
.
glide
.
request
.
Request
fullRequest
=
buildRequest
(
target
,
sizeMultiplier
,
priority
,
requestCoordinator
);
Request
fullRequest
=
buildRequest
(
target
,
sizeMultiplier
,
priority
,
requestCoordinator
);
if
(
thumbnailRequestBuilder
.
animationId
<=
0
)
{
thumbnailRequestBuilder
.
animationId
=
animationId
;
...
...
@@ -367,15 +375,15 @@ public class GenericRequestBuilder<ModelType, ImageDataType, VideoDataType, Reso
thumbnailRequestBuilder
.
priority
=
getThumbnailPriority
();
}
com
.
bumptech
.
glide
.
request
.
Request
thumbnailRequest
=
thumbnailRequestBuilder
.
buildRequest
(
target
,
Request
thumbnailRequest
=
thumbnailRequestBuilder
.
buildRequest
(
target
,
thumbnailRequestBuilder
.
sizeMultiplier
,
thumbnailRequestBuilder
.
priority
,
requestCoordinator
);
requestCoordinator
.
setRequests
(
fullRequest
,
thumbnailRequest
);
result
=
requestCoordinator
;
}
else
if
(
thumbSizeMultiplier
!=
null
)
{
ThumbnailRequestCoordinator
requestCoordinator
=
new
ThumbnailRequestCoordinator
();
com
.
bumptech
.
glide
.
request
.
Request
fullRequest
=
buildRequest
(
target
,
sizeMultiplier
,
priority
,
requestCoordinator
);
com
.
bumptech
.
glide
.
request
.
Request
thumbnailRequest
=
buildRequest
(
target
,
thumbSizeMultiplier
,
getThumbnailPriority
(),
Request
fullRequest
=
buildRequest
(
target
,
sizeMultiplier
,
priority
,
requestCoordinator
);
Request
thumbnailRequest
=
buildRequest
(
target
,
thumbSizeMultiplier
,
getThumbnailPriority
(),
requestCoordinator
);
requestCoordinator
.
setRequests
(
fullRequest
,
thumbnailRequest
);
result
=
requestCoordinator
;
...
...
@@ -397,7 +405,7 @@ public class GenericRequestBuilder<ModelType, ImageDataType, VideoDataType, Reso
return
result
;
}
private
com
.
bumptech
.
glide
.
request
.
Request
buildRequest
(
Target
<
ResourceType
>
target
,
float
sizeMultiplier
,
Priority
priority
,
private
Request
buildRequest
(
Target
<
ResourceType
>
target
,
float
sizeMultiplier
,
Priority
priority
,
RequestCoordinator
requestCoordinator
)
{
if
(
model
==
null
)
{
return
buildRequestForDataType
(
target
,
imageLoadProvider
,
sizeMultiplier
,
priority
,
null
);
...
...
@@ -408,21 +416,22 @@ public class GenericRequestBuilder<ModelType, ImageDataType, VideoDataType, Reso
return
buildRequestForDataType
(
target
,
imageLoadProvider
,
sizeMultiplier
,
priority
,
requestCoordinator
);
}
else
{
MultiTypeRequestCoordinator
typeCoordinator
=
new
MultiTypeRequestCoordinator
(
requestCoordinator
);
com
.
bumptech
.
glide
.
request
.
Request
imageRequest
=
Request
imageRequest
=
buildRequestForDataType
(
target
,
imageLoadProvider
,
sizeMultiplier
,
priority
,
typeCoordinator
);
com
.
bumptech
.
glide
.
request
.
Request
videoRequest
=
Request
videoRequest
=
buildRequestForDataType
(
target
,
videoLoadProvider
,
sizeMultiplier
,
priority
,
typeCoordinator
);
typeCoordinator
.
setRequests
(
imageRequest
,
videoRequest
);
return
typeCoordinator
;
}
}
private
<
Z
>
com
.
bumptech
.
glide
.
request
.
Request
buildRequestForDataType
(
Target
<
ResourceType
>
target
,
private
<
Z
>
Request
buildRequestForDataType
(
Target
<
ResourceType
>
target
,
LoadProvider
<
ModelType
,
Z
,
ResourceType
>
loadProvider
,
float
sizeMultiplier
,
Priority
priority
,
RequestCoordinator
requestCoordinator
)
{
return
new
GenericRequest
<
ModelType
,
Z
,
ResourceType
>(
loadProvider
,
model
,
context
,
priority
,
target
,
sizeMultiplier
,
placeholderDrawable
,
placeholderId
,
errorPlaceholder
,
errorId
,
requestListener
,
animationId
,
animation
,
requestCoordinator
,
Glide
.
get
(
context
).
getEngine
(),
getFinalTransformation
());
animationId
,
animation
,
requestCoordinator
,
Glide
.
get
(
context
).
getEngine
(),
getFinalTransformation
(),
resourceClass
);
}
@SuppressWarnings
(
"unchecked"
)
...
...
library/src/com/bumptech/glide/Glide.java
浏览文件 @
785dc5ee
...
...
@@ -34,6 +34,7 @@ import com.bumptech.glide.load.model.stream.StreamUrlLoader;
import
com.bumptech.glide.provider.FixedLoadProvider
;
import
com.bumptech.glide.provider.LoadProvider
;
import
com.bumptech.glide.request.Request
;
import
com.bumptech.glide.request.target.ImageViewTargetFactory
;
import
com.bumptech.glide.request.target.Target
;
import
com.bumptech.glide.request.target.ViewTarget
;
import
com.bumptech.glide.volley.VolleyUrlLoader
;
...
...
@@ -66,6 +67,7 @@ public class Glide {
private
final
MemoryCache
memoryCache
;
private
final
DataLoadProvider
<
InputStream
,
Bitmap
>
defaultStreamProvider
;
private
final
DataLoadProvider
<
ParcelFileDescriptor
,
Bitmap
>
defaultFileDescriptorProvider
;
private
final
ImageViewTargetFactory
factory
=
new
ImageViewTargetFactory
();
/**
* Try to get the external cache directory if available and default to the internal. Use a default name for the
...
...
@@ -393,8 +395,9 @@ public class Glide {
* @return A model request to pass in the object representing the image to be loaded.
*/
public
static
ModelRequest
with
(
Context
context
)
{
return
new
ModelRequest
(
context
,
Glide
.
get
(
context
).
defaultStreamProvider
,
Glide
.
get
(
context
).
defaultFileDescriptorProvider
,
Glide
.
get
(
context
).
bitmapPool
);
Glide
glide
=
Glide
.
get
(
context
);
return
new
ModelRequest
(
context
,
glide
.
defaultStreamProvider
,
glide
.
defaultFileDescriptorProvider
,
glide
.
bitmapPool
,
glide
.
factory
);
}
/**
...
...
@@ -405,13 +408,16 @@ public class Glide {
private
final
DataLoadProvider
<
InputStream
,
Bitmap
>
streamDataProvider
;
private
final
DataLoadProvider
<
ParcelFileDescriptor
,
Bitmap
>
fileDescriptorDataProvider
;
private
BitmapPool
bitmapPool
;
private
ImageViewTargetFactory
factory
;
private
ModelRequest
(
Context
context
,
DataLoadProvider
<
InputStream
,
Bitmap
>
streamDataProvider
,
DataLoadProvider
<
ParcelFileDescriptor
,
Bitmap
>
fileDescriptorDataProvider
,
BitmapPool
bitmapPool
)
{
DataLoadProvider
<
ParcelFileDescriptor
,
Bitmap
>
fileDescriptorDataProvider
,
BitmapPool
bitmapPool
,
ImageViewTargetFactory
factory
)
{
this
.
context
=
context
;
this
.
streamDataProvider
=
streamDataProvider
;
this
.
fileDescriptorDataProvider
=
fileDescriptorDataProvider
;
this
.
bitmapPool
=
bitmapPool
;
this
.
factory
=
factory
;
}
/**
...
...
@@ -423,7 +429,7 @@ public class Glide {
* @return A new {@link ImageModelRequest}.
*/
public
<
T
>
ImageModelRequest
<
T
>
using
(
final
StreamModelLoader
<
T
>
modelLoader
)
{
return
new
ImageModelRequest
<
T
>(
context
,
modelLoader
,
streamDataProvider
,
bitmapPool
);
return
new
ImageModelRequest
<
T
>(
context
,
modelLoader
,
streamDataProvider
,
bitmapPool
,
factory
);
}
/**
...
...
@@ -433,7 +439,7 @@ public class Glide {
* @return A new {@link ImageModelRequest}.
*/
public
ImageModelRequest
<
byte
[]>
using
(
StreamByteArrayLoader
modelLoader
)
{
return
new
ImageModelRequest
<
byte
[]>(
context
,
modelLoader
,
streamDataProvider
,
bitmapPool
);
return
new
ImageModelRequest
<
byte
[]>(
context
,
modelLoader
,
streamDataProvider
,
bitmapPool
,
factory
);
}
/**
...
...
@@ -445,7 +451,7 @@ public class Glide {
* @return A new {@link VideoModelRequest}.
*/
public
<
T
>
VideoModelRequest
<
T
>
using
(
final
FileDescriptorModelLoader
<
T
>
modelLoader
)
{
return
new
VideoModelRequest
<
T
>(
context
,
modelLoader
,
fileDescriptorDataProvider
,
bitmapPool
);
return
new
VideoModelRequest
<
T
>(
context
,
modelLoader
,
fileDescriptorDataProvider
,
bitmapPool
,
factory
);
}
/**
...
...
@@ -559,7 +565,7 @@ public class Glide {
LoadProvider
<
byte
[],
InputStream
,
Bitmap
>
loadProvider
=
new
FixedLoadProvider
<
byte
[],
InputStream
,
Bitmap
>(
loader
,
streamDataProvider
);
return
new
BitmapRequestBuilder
<
byte
[]>(
context
,
model
,
loadProvider
,
null
,
bitmapPool
);
return
new
BitmapRequestBuilder
<
byte
[]>(
context
,
model
,
loadProvider
,
null
,
bitmapPool
,
factory
);
}
/**
...
...
@@ -618,7 +624,8 @@ public class Glide {
new
FixedLoadProvider
<
T
,
ParcelFileDescriptor
,
Bitmap
>(
fileDescriptorModelLoader
,
fileDescriptorDataProvider
);
}
return
new
BitmapRequestBuilder
<
T
>(
context
,
model
,
streamLoadProvider
,
fileDescriptorLoadProvider
,
bitmapPool
);
return
new
BitmapRequestBuilder
<
T
>(
context
,
model
,
streamLoadProvider
,
fileDescriptorLoadProvider
,
bitmapPool
,
factory
);
}
}
...
...
@@ -633,18 +640,22 @@ public class Glide {
private
final
ModelLoader
<
T
,
ParcelFileDescriptor
>
loader
;
private
DataLoadProvider
<
ParcelFileDescriptor
,
Bitmap
>
dataLoadProvider
;
private
BitmapPool
bitmapPool
;
private
ImageViewTargetFactory
factory
;
private
VideoModelRequest
(
Context
context
,
ModelLoader
<
T
,
ParcelFileDescriptor
>
loader
,
DataLoadProvider
<
ParcelFileDescriptor
,
Bitmap
>
dataLoadProvider
,
BitmapPool
bitmapPool
)
{
DataLoadProvider
<
ParcelFileDescriptor
,
Bitmap
>
dataLoadProvider
,
BitmapPool
bitmapPool
,
ImageViewTargetFactory
factory
)
{
this
.
context
=
context
;
this
.
loader
=
loader
;
this
.
dataLoadProvider
=
dataLoadProvider
;
this
.
bitmapPool
=
bitmapPool
;
this
.
factory
=
factory
;
}
public
BitmapRequestBuilder
<
T
>
loadFromVideo
(
T
model
)
{
return
new
BitmapRequestBuilder
<
T
>(
context
,
model
,
null
,
new
FixedLoadProvider
<
T
,
ParcelFileDescriptor
,
Bitmap
>(
loader
,
dataLoadProvider
),
bitmapPool
);
new
FixedLoadProvider
<
T
,
ParcelFileDescriptor
,
Bitmap
>(
loader
,
dataLoadProvider
),
bitmapPool
,
factory
);
}
}
...
...
@@ -659,18 +670,21 @@ public class Glide {
private
final
ModelLoader
<
T
,
InputStream
>
loader
;
private
DataLoadProvider
<
InputStream
,
Bitmap
>
dataLoadProvider
;
private
BitmapPool
bitmapPool
;
private
ImageViewTargetFactory
factory
;
private
ImageModelRequest
(
Context
context
,
ModelLoader
<
T
,
InputStream
>
loader
,
DataLoadProvider
<
InputStream
,
Bitmap
>
dataLoadProvider
,
BitmapPool
bitmapPool
)
{
DataLoadProvider
<
InputStream
,
Bitmap
>
dataLoadProvider
,
BitmapPool
bitmapPool
,
ImageViewTargetFactory
factory
)
{
this
.
context
=
context
;
this
.
loader
=
loader
;
this
.
dataLoadProvider
=
dataLoadProvider
;
this
.
bitmapPool
=
bitmapPool
;
this
.
factory
=
factory
;
}
public
BitmapRequestBuilder
<
T
>
load
(
T
model
)
{
return
new
BitmapRequestBuilder
<
T
>(
context
,
model
,
new
FixedLoadProvider
<
T
,
InputStream
,
Bitmap
>(
loader
,
dataLoadProvider
),
null
,
bitmapPool
);
new
FixedLoadProvider
<
T
,
InputStream
,
Bitmap
>(
loader
,
dataLoadProvider
),
null
,
bitmapPool
,
factory
);
}
}
...
...
@@ -680,7 +694,7 @@ public class Glide {
}
@Override
public
void
onResourceReady
(
Resource
<
Object
>
resource
)
{
}
public
void
onResourceReady
(
Object
resource
)
{
}
@Override
public
void
setPlaceholder
(
Drawable
placeholder
)
{
}
...
...
library/src/com/bumptech/glide/ListPreloader.java
浏览文件 @
785dc5ee
...
...
@@ -169,7 +169,7 @@ public abstract class ListPreloader<T> implements AbsListView.OnScrollListener {
private
int
photoWidth
;
@Override
public
void
onResourceReady
(
Resource
resource
)
{
public
void
onResourceReady
(
Object
resource
)
{
}
@Override
...
...
library/src/com/bumptech/glide/Resource.java
浏览文件 @
785dc5ee
...
...
@@ -8,13 +8,13 @@ import android.os.Looper;
* Public methods are non final only to allow for mocking, subclasses must only override abstract methods.
* </p>
*
* @param <
T
> The type of resource wrapped by this class.
* @param <
Z
> The type of resource wrapped by this class.
*/
public
abstract
class
Resource
<
T
>
{
public
abstract
class
Resource
<
Z
>
{
private
volatile
int
acquired
;
private
volatile
boolean
isRecycled
;
public
abstract
T
get
();
public
abstract
Z
get
();
public
abstract
int
getSize
();
...
...
library/src/com/bumptech/glide/load/engine/DefaultResourceRunnerFactory.java
浏览文件 @
785dc5ee
...
...
@@ -35,7 +35,7 @@ class DefaultResourceRunnerFactory implements ResourceRunnerFactory {
Transformation
<
Z
>
transformation
,
ResourceEncoder
<
Z
>
encoder
,
Priority
priority
,
EngineJobListener
listener
)
{
EngineJob
<
Z
>
engineJob
=
new
EngineJob
<
Z
>
(
key
,
memoryCache
,
mainHandler
,
listener
);
EngineJob
engineJob
=
new
EngineJob
(
key
,
memoryCache
,
mainHandler
,
listener
);
SourceResourceRunner
<
T
,
Z
>
sourceRunner
=
new
SourceResourceRunner
<
T
,
Z
>(
key
,
width
,
height
,
fetcher
,
decoder
,
transformation
,
encoder
,
diskCache
,
priority
,
engineJob
);
...
...
library/src/com/bumptech/glide/load/engine/Engine.java
浏览文件 @
785dc5ee
...
...
@@ -61,20 +61,20 @@ public class Engine implements EngineJobListener, MemoryCache.ResourceRemovedLis
*/
public
<
T
,
Z
>
LoadStatus
load
(
String
id
,
int
width
,
int
height
,
ResourceDecoder
<
InputStream
,
Z
>
cacheDecoder
,
ResourceFetcher
<
T
>
fetcher
,
ResourceDecoder
<
T
,
Z
>
decoder
,
Transformation
<
Z
>
transformation
,
ResourceEncoder
<
Z
>
encoder
,
Priority
priority
,
ResourceCallback
<
Z
>
cb
)
{
ResourceEncoder
<
Z
>
encoder
,
Priority
priority
,
ResourceCallback
cb
)
{
Key
key
=
keyFactory
.
buildKey
(
id
,
width
,
height
,
cacheDecoder
,
decoder
,
transformation
,
encoder
);
Resource
<
Z
>
cached
=
cache
.
get
(
key
);
Resource
cached
=
cache
.
get
(
key
);
if
(
cached
!=
null
)
{
cached
.
acquire
(
1
);
cb
.
onResourceReady
(
cached
);
return
null
;
}
ResourceRunner
<
Z
>
current
=
runners
.
get
(
key
);
ResourceRunner
current
=
runners
.
get
(
key
);
if
(
current
!=
null
)
{
EngineJob
<
Z
>
job
=
current
.
getJob
();
EngineJob
job
=
current
.
getJob
();
job
.
addCallback
(
cb
);
return
new
LoadStatus
(
cb
,
job
);
}
...
...
library/src/com/bumptech/glide/load/engine/EngineJob.java
浏览文件 @
785dc5ee
...
...
@@ -9,15 +9,12 @@ import com.bumptech.glide.request.ResourceCallback;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @param <Z> The type of the resource that will be decoded.
*/
public
class
EngineJob
<
Z
>
implements
ResourceCallback
<
Z
>
{
public
class
EngineJob
implements
ResourceCallback
{
private
final
EngineJobListener
listener
;
private
Key
key
;
private
MemoryCache
cache
;
private
Handler
mainHandler
;
private
List
<
ResourceCallback
<
Z
>>
cbs
=
new
ArrayList
<
ResourceCallback
<
Z
>
>();
private
List
<
ResourceCallback
>
cbs
=
new
ArrayList
<
ResourceCallback
>();
private
boolean
isCancelled
;
private
boolean
isComplete
;
...
...
@@ -28,7 +25,7 @@ public class EngineJob<Z> implements ResourceCallback<Z> {
this
.
mainHandler
=
mainHandler
;
}
public
void
addCallback
(
ResourceCallback
<
Z
>
cb
)
{
public
void
addCallback
(
ResourceCallback
cb
)
{
cbs
.
add
(
cb
);
}
...
...
@@ -54,7 +51,7 @@ public class EngineJob<Z> implements ResourceCallback<Z> {
}
@Override
public
void
onResourceReady
(
final
Resource
<
Z
>
resource
)
{
public
void
onResourceReady
(
final
Resource
resource
)
{
mainHandler
.
post
(
new
Runnable
()
{
@Override
public
void
run
()
{
...
...
@@ -68,7 +65,7 @@ public class EngineJob<Z> implements ResourceCallback<Z> {
resource
.
acquire
(
cbs
.
size
()
+
1
);
listener
.
onEngineJobComplete
(
key
);
cache
.
put
(
key
,
resource
);
for
(
ResourceCallback
<
Z
>
cb
:
cbs
)
{
for
(
ResourceCallback
cb
:
cbs
)
{
cb
.
onResourceReady
(
resource
);
}
...
...
library/src/com/bumptech/glide/load/engine/ResourceRunner.java
浏览文件 @
785dc5ee
...
...
@@ -22,7 +22,7 @@ public class ResourceRunner<Z> implements Runnable {
private
final
Key
key
;
private
final
SourceResourceRunner
sourceRunner
;
private
final
ExecutorService
executorService
;
private
final
EngineJob
<
Z
>
job
;
private
final
EngineJob
job
;
private
final
ResourceDecoder
<
InputStream
,
Z
>
cacheDecoder
;
private
final
int
width
;
private
final
int
height
;
...
...
@@ -32,7 +32,7 @@ public class ResourceRunner<Z> implements Runnable {
private
volatile
boolean
isCancelled
;
public
ResourceRunner
(
Key
key
,
int
width
,
int
height
,
DiskCache
diskCache
,
ResourceDecoder
<
InputStream
,
Z
>
cacheDecoder
,
SourceResourceRunner
sourceRunner
,
ExecutorService
executorService
,
Handler
bgHandler
,
EngineJob
<
Z
>
job
)
{
SourceResourceRunner
sourceRunner
,
ExecutorService
executorService
,
Handler
bgHandler
,
EngineJob
job
)
{
this
.
key
=
key
;
this
.
width
=
width
;
this
.
height
=
height
;
...
...
@@ -44,7 +44,7 @@ public class ResourceRunner<Z> implements Runnable {
this
.
job
=
job
;
}
public
EngineJob
<
Z
>
getJob
()
{
public
EngineJob
getJob
()
{
return
job
;
}
...
...
library/src/com/bumptech/glide/load/engine/SourceResourceRunner.java
浏览文件 @
785dc5ee
...
...
@@ -28,13 +28,13 @@ public class SourceResourceRunner<T, Z> implements Runnable, DiskCache.Writer, P
private
final
ResourceEncoder
<
Z
>
encoder
;
private
DiskCache
diskCache
;
private
Priority
priority
;
private
ResourceCallback
<
Z
>
cb
;
private
ResourceCallback
cb
;
private
Resource
<
Z
>
result
;
private
volatile
boolean
isCancelled
;
public
SourceResourceRunner
(
Key
key
,
int
width
,
int
height
,
ResourceFetcher
<
T
>
resourceFetcher
,
ResourceDecoder
<
T
,
Z
>
decoder
,
Transformation
<
Z
>
transformation
,
ResourceEncoder
<
Z
>
encoder
,
DiskCache
diskCache
,
Priority
priority
,
ResourceCallback
<
Z
>
cb
)
{
DiskCache
diskCache
,
Priority
priority
,
ResourceCallback
cb
)
{
this
.
key
=
key
;
this
.
width
=
width
;
this
.
height
=
height
;
...
...
library/src/com/bumptech/glide/request/ResourceCallback.java
浏览文件 @
785dc5ee
...
...
@@ -2,9 +2,9 @@ package com.bumptech.glide.request;
import
com.bumptech.glide.Resource
;
public
interface
ResourceCallback
<
Z
>
{
public
interface
ResourceCallback
{
public
void
onResourceReady
(
Resource
<
Z
>
resource
);
public
void
onResourceReady
(
Resource
resource
);
public
void
onException
(
Exception
e
);
}
library/src/com/bumptech/glide/request/bitmap/GenericRequest.java
浏览文件 @
785dc5ee
...
...
@@ -22,13 +22,13 @@ import com.bumptech.glide.request.target.Target;
import
java.io.InputStream
;
/**
* A {@link
com.bumptech.glide.request.
Request} that loads a {@link Resource} into a given {@link Target}.
* A {@link Request} that loads a {@link Resource} into a given {@link Target}.
*
* @param <A> The type of the model that the resource will be loaded from.
* @param <T> The type of the data that the resource will be loaded from.
* @param <Z> The type of the resource that will be loaded.
*/
public
class
GenericRequest
<
A
,
T
,
Z
>
implements
Request
,
Target
.
SizeReadyCallback
,
ResourceCallback
<
Z
>
{
public
class
GenericRequest
<
A
,
T
,
Z
>
implements
Request
,
Target
.
SizeReadyCallback
,
ResourceCallback
{
private
static
final
String
TAG
=
"Request"
;
private
final
int
placeholderResourceId
;
...
...
@@ -39,6 +39,7 @@ public class GenericRequest<A, T, Z> implements Request, Target.SizeReadyCallbac
private
final
int
animationId
;
private
final
RequestCoordinator
requestCoordinator
;
private
final
A
model
;
private
final
Class
<
Z
>
resourceClass
;
private
Priority
priority
;
private
final
Target
<
Z
>
target
;
private
final
RequestListener
<
A
>
requestListener
;
...
...
@@ -50,14 +51,14 @@ public class GenericRequest<A, T, Z> implements Request, Target.SizeReadyCallbac
private
boolean
isCancelled
;
private
boolean
isError
;
private
boolean
loadedFromMemoryCache
;
private
Resource
<
Z
>
resource
;
private
Resource
resource
;
private
Engine
.
LoadStatus
loadStatus
;
public
GenericRequest
(
LoadProvider
<
A
,
T
,
Z
>
loadProvider
,
A
model
,
Context
context
,
Priority
priority
,
Target
<
Z
>
target
,
float
sizeMultiplier
,
Drawable
placeholderDrawable
,
int
placeholderResourceId
,
Drawable
errorDrawable
,
int
errorResourceId
,
RequestListener
<
A
>
requestListener
,
int
animationId
,
Animation
animation
,
RequestCoordinator
requestCoordinator
,
Engine
engine
,
Transformation
<
Z
>
transformation
)
{
Transformation
<
Z
>
transformation
,
Class
<
Z
>
resourceClass
)
{
this
.
loadProvider
=
loadProvider
;
this
.
model
=
model
;
this
.
context
=
context
;
...
...
@@ -74,6 +75,7 @@ public class GenericRequest<A, T, Z> implements Request, Target.SizeReadyCallbac
this
.
requestCoordinator
=
requestCoordinator
;
this
.
engine
=
engine
;
this
.
transformation
=
transformation
;
this
.
resourceClass
=
resourceClass
;
}
@Override
...
...
@@ -175,12 +177,21 @@ public class GenericRequest<A, T, Z> implements Request, Target.SizeReadyCallbac
}
@Override
public
void
onResourceReady
(
Resource
<
Z
>
resource
)
{
public
void
onResourceReady
(
Resource
resource
)
{
if
(!
canSetImage
())
{
resource
.
release
();
return
;
}
target
.
onResourceReady
(
resource
);
if
(
resource
==
null
||
!
resourceClass
.
isAssignableFrom
(
resource
.
get
().
getClass
()))
{
if
(
resource
!=
null
)
{
resource
.
release
();
}
onException
(
new
Exception
(
"Expected to receive an object of "
+
resourceClass
+
" but instead got "
+
(
resource
!=
null
?
resource
.
get
()
:
null
)));
return
;
}
Z
result
=
(
Z
)
resource
.
get
();
target
.
onResourceReady
(
result
);
if
(!
loadedFromMemoryCache
&&
!
isAnyImageSet
())
{
if
(
animation
==
null
&&
animationId
>
0
)
{
animation
=
AnimationUtils
.
loadAnimation
(
context
,
animationId
);
...
...
library/src/com/bumptech/glide/request/target/BitmapImageViewTarget.java
浏览文件 @
785dc5ee
...
...
@@ -3,7 +3,6 @@ package com.bumptech.glide.request.target;
import
android.graphics.Bitmap
;
import
android.graphics.drawable.Drawable
;
import
android.widget.ImageView
;
import
com.bumptech.glide.Resource
;
/**
* A target wrapping an ImageView. Obtains the runtime dimensions of the ImageView.
...
...
@@ -17,8 +16,8 @@ public class BitmapImageViewTarget extends ViewTarget<ImageView, Bitmap> {
}
@Override
public
void
onResourceReady
(
Resource
<
Bitmap
>
resource
)
{
view
.
setImageBitmap
(
resource
.
get
()
);
public
void
onResourceReady
(
Bitmap
resource
)
{
view
.
setImageBitmap
(
resource
);
}
@Override
...
...
library/src/com/bumptech/glide/request/target/ImageViewTargetFactory.java
0 → 100644
浏览文件 @
785dc5ee
package
com.bumptech.glide.request.target
;
import
android.graphics.Bitmap
;
import
android.widget.ImageView
;
public
class
ImageViewTargetFactory
{
@SuppressWarnings
(
"unchecked"
)
public
<
Z
>
Target
<
Z
>
buildTarget
(
ImageView
view
,
Class
<
Z
>
clazz
)
{
if
(
Bitmap
.
class
.
equals
(
clazz
))
{
return
(
Target
<
Z
>)
new
BitmapImageViewTarget
(
view
);
}
else
{
throw
new
IllegalArgumentException
(
"Unhandled class: "
+
clazz
);
}
}
}
library/src/com/bumptech/glide/request/target/Target.java
浏览文件 @
785dc5ee
...
...
@@ -2,7 +2,6 @@ package com.bumptech.glide.request.target;
import
android.graphics.drawable.Drawable
;
import
android.view.animation.Animation
;
import
com.bumptech.glide.Resource
;
import
com.bumptech.glide.request.Request
;
/**
...
...
@@ -24,7 +23,7 @@ public interface Target<Z> {
* The method that will be called when the image load has finished
* @param resource the loaded resource.
*/
public
void
onResourceReady
(
Resource
<
Z
>
resource
);
public
void
onResourceReady
(
Z
resource
);
/**
* A method that can optionally be implemented to set any placeholder that might have been passed to Glide to
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录