mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Bitmap is cleared only when setUri is called with empty/null uri (#97)
* Bitmap is cleared only when setUri is called with empty/null uri * update gradle & buildtools versions * fix gradle plugin version * rename assembleRelease to assemble task
This commit is contained in:
@@ -20,7 +20,7 @@ def computeBuildToolsVersion() {
|
||||
return buildToolsVersion
|
||||
}
|
||||
else {
|
||||
return "23.0.3"
|
||||
return "25.0.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,6 +67,6 @@ task copyAar << {
|
||||
}
|
||||
}
|
||||
|
||||
assembleRelease.dependsOn(cleanBuildDir)
|
||||
copyAar.dependsOn(assembleRelease)
|
||||
assemble.dependsOn(cleanBuildDir)
|
||||
copyAar.dependsOn(assemble)
|
||||
build.dependsOn(copyAar)
|
||||
@@ -167,6 +167,14 @@ public class ImageView extends android.widget.ImageView implements BitmapOwner {
|
||||
mDecodeHeight = decodeHeight;
|
||||
mUseCache = useCache;
|
||||
mAsync = async;
|
||||
|
||||
// Clear current bitmap only if we set empty URI.
|
||||
// We support settimg bitmap through ImageSource (e.g. Bitmap).
|
||||
if (uri == null || uri.trim() == "") {
|
||||
this.setImageBitmap(null);
|
||||
}
|
||||
|
||||
// Begin loading image only if we are attached to window.
|
||||
if (mAttachedToWindow) {
|
||||
loadImage();
|
||||
}
|
||||
@@ -181,8 +189,6 @@ public class ImageView extends android.widget.ImageView implements BitmapOwner {
|
||||
if (mUri != null && fetcher != null) {
|
||||
// Get the Bitmap from cache.
|
||||
fetcher.loadImage(mUri, this, mDecodeWidth, mDecodeHeight, mUseCache, mAsync, mListener);
|
||||
} else {
|
||||
this.setImageBitmap(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user