summaryrefslogtreecommitdiff
path: root/src/com/android
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/bitmap/drawable/BasicBitmapDrawable.java2
-rw-r--r--src/com/android/bitmap/drawable/ExtendedBitmapDrawable.java13
2 files changed, 6 insertions, 9 deletions
diff --git a/src/com/android/bitmap/drawable/BasicBitmapDrawable.java b/src/com/android/bitmap/drawable/BasicBitmapDrawable.java
index d0952f6..8fe1ff4 100644
--- a/src/com/android/bitmap/drawable/BasicBitmapDrawable.java
+++ b/src/com/android/bitmap/drawable/BasicBitmapDrawable.java
@@ -122,7 +122,7 @@ public class BasicBitmapDrawable extends Drawable implements DecodeCallback,
public final void setDecodeDimensions(int w, int h) {
mDecodeWidth = w;
mDecodeHeight = h;
- loadFileDescriptorFactory();
+ bind(mCurrKey);
}
/**
diff --git a/src/com/android/bitmap/drawable/ExtendedBitmapDrawable.java b/src/com/android/bitmap/drawable/ExtendedBitmapDrawable.java
index 2e3d43f..7be8b6e 100644
--- a/src/com/android/bitmap/drawable/ExtendedBitmapDrawable.java
+++ b/src/com/android/bitmap/drawable/ExtendedBitmapDrawable.java
@@ -142,9 +142,6 @@ public class ExtendedBitmapDrawable extends BasicBitmapDrawable implements
// this allows the initial transition to be specially instantaneous, so e.g. a cache hit
// doesn't unnecessarily trigger a fade-in
setLoadState(LOAD_STATE_UNINITIALIZED);
- if (key == null) {
- setLoadState(LOAD_STATE_FAILED);
- }
super.setImage(key);
}
@@ -159,12 +156,12 @@ public class ExtendedBitmapDrawable extends BasicBitmapDrawable implements
@Override
protected void loadFileDescriptorFactory() {
boolean executeStateChange = shouldExecuteStateChange();
+ if (mCurrKey == null || mDecodeWidth == 0 || mDecodeHeight == 0) {
+ return;
+ }
+
if (executeStateChange) {
- if (mCurrKey == null || mDecodeWidth == 0 || mDecodeHeight == 0) {
- setLoadState(LOAD_STATE_FAILED);
- } else {
- setLoadState(LOAD_STATE_NOT_YET_LOADED);
- }
+ setLoadState(LOAD_STATE_NOT_YET_LOADED);
}
super.loadFileDescriptorFactory();