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:
@@ -5,7 +5,7 @@ buildscript {
|
|||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:2.1.2'
|
classpath 'com.android.tools.build:gradle:2.3.1'
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
|
|||||||
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
|||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ def computeBuildToolsVersion() {
|
|||||||
return buildToolsVersion
|
return buildToolsVersion
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return "23.0.3"
|
return "25.0.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,6 +67,6 @@ task copyAar << {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
assembleRelease.dependsOn(cleanBuildDir)
|
assemble.dependsOn(cleanBuildDir)
|
||||||
copyAar.dependsOn(assembleRelease)
|
copyAar.dependsOn(assemble)
|
||||||
build.dependsOn(copyAar)
|
build.dependsOn(copyAar)
|
||||||
@@ -167,6 +167,14 @@ public class ImageView extends android.widget.ImageView implements BitmapOwner {
|
|||||||
mDecodeHeight = decodeHeight;
|
mDecodeHeight = decodeHeight;
|
||||||
mUseCache = useCache;
|
mUseCache = useCache;
|
||||||
mAsync = async;
|
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) {
|
if (mAttachedToWindow) {
|
||||||
loadImage();
|
loadImage();
|
||||||
}
|
}
|
||||||
@@ -181,8 +189,6 @@ public class ImageView extends android.widget.ImageView implements BitmapOwner {
|
|||||||
if (mUri != null && fetcher != null) {
|
if (mUri != null && fetcher != null) {
|
||||||
// Get the Bitmap from cache.
|
// Get the Bitmap from cache.
|
||||||
fetcher.loadImage(mUri, this, mDecodeWidth, mDecodeHeight, mUseCache, mAsync, mListener);
|
fetcher.loadImage(mUri, this, mDecodeWidth, mDecodeHeight, mUseCache, mAsync, mListener);
|
||||||
} else {
|
|
||||||
this.setImageBitmap(null);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user