mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
listener is now field on ImageView (#93)
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user