diff options
author | Mark Wei <markwei@google.com> | 2013-10-30 14:23:50 -0700 |
---|---|---|
committer | Mark Wei <markwei@google.com> | 2013-10-31 17:35:05 -0700 |
commit | 2e4d0863dba53435372ec96538f2ef3e1c3675bf (patch) | |
tree | 6d7bbae6bcb78563036ffe5f685ef1a334bd512c /src/com/android/bitmap/DecodeTask.java | |
parent | 22955165fab693684cc3614c84ee81883ae933c8 (diff) | |
download | bitmap-2e4d0863dba53435372ec96538f2ef3e1c3675bf.tar.gz |
Make ExtendedBitmapDrawable extend BasicBitmapDrawable.
Modify sample app to use ExtendedBitmapDrawable with the following features:
Parallax,
Placholder and progress,
Decode aggregator.
Change-Id: Ia9e0fe6e6fdab018077a465ddf2a40109efbddf7
Diffstat (limited to 'src/com/android/bitmap/DecodeTask.java')
-rw-r--r-- | src/com/android/bitmap/DecodeTask.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/com/android/bitmap/DecodeTask.java b/src/com/android/bitmap/DecodeTask.java index 76d6019..87beac1 100644 --- a/src/com/android/bitmap/DecodeTask.java +++ b/src/com/android/bitmap/DecodeTask.java @@ -134,16 +134,20 @@ public class DecodeTask extends AsyncTask<Void, Void, ReusableBitmap> { } } - Trace.beginSection("create fd and stream"); if (mFactory != null) { + Trace.beginSection("create fd"); fd = mFactory.createFileDescriptor(); + Trace.endSection(); } else { in = reset(in); if (in == null) { return null; } } - Trace.endSection(); + + if (isCancelled()) { + return null; + } Trace.beginSection("get bytesize"); final long byteSize; @@ -198,6 +202,9 @@ public class DecodeTask extends AsyncTask<Void, Void, ReusableBitmap> { if (in == null) { return null; } + if (isCancelled()) { + return null; + } } Trace.beginSection("decodeBounds"); @@ -286,8 +293,12 @@ public class DecodeTask extends AsyncTask<Void, Void, ReusableBitmap> { if (in == null) { return null; } + if (isCancelled()) { + return null; + } } + Bitmap decodeResult = null; final Rect srcRect = new Rect(); // Not orientation corrected. True coordinates. if (CROP_DURING_DECODE) { |