listener is now field on ImageView (#93)

This commit is contained in:
Hristo Hristov
2017-03-28 13:06:50 +03:00
committed by GitHub
parent 053e3071b7
commit d0130a0334

View File

@@ -160,18 +160,21 @@ public class ImageView extends android.widget.ImageView {
} }
} }
public void setUri(String uri, int decodeWidth, int decodeHeight, boolean useCache, boolean async, Worker.OnImageLoadedListener listener) { public void setUri(String uri, int decodeWidth, int decodeHeight, boolean useCache, boolean async) {
mUri = uri; mUri = uri;
mDecodeWidth = decodeWidth; mDecodeWidth = decodeWidth;
mDecodeHeight = decodeHeight; mDecodeHeight = decodeHeight;
mUseCache = useCache; mUseCache = useCache;
mAsync = async; mAsync = async;
mListener = listener;
if (mAttachedToWindow) { if (mAttachedToWindow) {
loadImage(); loadImage();
} }
} }
public void setImageLoadedListener(Worker.OnImageLoadedListener listener) {
mListener = listener;
}
private void loadImage() { private void loadImage() {
Fetcher fetcher = Fetcher.getInstance(this.getContext()); Fetcher fetcher = Fetcher.getInstance(this.getContext());
if (mUri != null && fetcher != null) { if (mUri != null && fetcher != null) {