blob: da4a9d867ea45ddf58f5243d3219b07027cb1bd5 (
plain)
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
|
package org.fox.ttrss.glide;
import android.graphics.drawable.Drawable;
import com.bumptech.glide.request.Request;
import com.bumptech.glide.request.animation.GlideAnimation;
import com.bumptech.glide.request.target.SizeReadyCallback;
import com.bumptech.glide.request.target.Target;
import androidx.annotation.NonNull;
public class WrappingTarget<Z> implements Target<Z> {
protected final @NonNull Target<? super Z> target;
public WrappingTarget(@NonNull Target<? super Z> target) {
this.target = target;
}
public @NonNull Target<? super Z> getWrappedTarget() {
return target;
}
@Override public void getSize(SizeReadyCallback cb) {
target.getSize(cb);
}
@Override public void onLoadStarted(Drawable placeholder) {
target.onLoadStarted(placeholder);
}
@Override public void onLoadFailed(Exception e, Drawable errorDrawable) {
target.onLoadFailed(e, errorDrawable);
}
@SuppressWarnings("unchecked")
@Override public void onResourceReady(Z resource, GlideAnimation<? super Z> glideAnimation) {
target.onResourceReady(resource, (GlideAnimation)glideAnimation);
}
@Override public void onLoadCleared(Drawable placeholder) {
target.onLoadCleared(placeholder);
}
@Override public Request getRequest() {
return target.getRequest();
}
@Override public void setRequest(Request request) {
target.setRequest(request);
}
@Override public void onStart() {
target.onStart();
}
@Override public void onStop() {
target.onStop();
}
@Override public void onDestroy() {
target.onDestroy();
}
}
|