summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
authorMark Wei <markwei@google.com>2013-10-24 14:51:54 -0700
committerMark Wei <markwei@google.com>2013-10-29 20:22:10 -0700
commit9c6ac19d4a3d39b7c2992060957920118ff56a65 (patch)
tree7ee9bd8104520b791f101c4e037795e16e3ec30c /sample
parent46616414f6dabb6d57b0ac433a5fabe2abb8b5a9 (diff)
downloadbitmap-9c6ac19d4a3d39b7c2992060957920118ff56a65.tar.gz
Relax BasicBitmapView to allow non-BasicBitmapDrawables to be assigned to it.
Rename BasicBitmapView to BitmapDrawableImageView. Allow asynchronous creating of file. Change-Id: I0407bf0bf36ae92ce45d2175121a15483f8f72f2
Diffstat (limited to 'sample')
-rw-r--r--sample/src/com/example/bitmapsample/BitmapRequestKeyImpl.java5
-rw-r--r--sample/src/com/example/bitmapsample/BitmapView.java7
-rw-r--r--sample/src/com/example/bitmapsample/MainActivity.java4
3 files changed, 8 insertions, 8 deletions
diff --git a/sample/src/com/example/bitmapsample/BitmapRequestKeyImpl.java b/sample/src/com/example/bitmapsample/BitmapRequestKeyImpl.java
index 639f4f5..6c375f1 100644
--- a/sample/src/com/example/bitmapsample/BitmapRequestKeyImpl.java
+++ b/sample/src/com/example/bitmapsample/BitmapRequestKeyImpl.java
@@ -16,8 +16,6 @@
package com.example.bitmapsample;
-import android.os.ParcelFileDescriptor;
-
import com.android.bitmap.RequestKey;
import java.io.IOException;
@@ -65,7 +63,8 @@ public class BitmapRequestKeyImpl implements RequestKey {
}
@Override
- public ParcelFileDescriptor createFd() throws IOException {
+ public Cancelable createFileDescriptorFactoryAsync(final RequestKey key,
+ final Callback callback) {
return null;
}
diff --git a/sample/src/com/example/bitmapsample/BitmapView.java b/sample/src/com/example/bitmapsample/BitmapView.java
index d8de0c9..f192963 100644
--- a/sample/src/com/example/bitmapsample/BitmapView.java
+++ b/sample/src/com/example/bitmapsample/BitmapView.java
@@ -19,9 +19,10 @@ package com.example.bitmapsample;
import android.content.Context;
import android.util.AttributeSet;
-import com.android.bitmap.view.BasicImageView;
+import com.android.bitmap.drawable.BasicBitmapDrawable;
+import com.android.bitmap.view.BitmapDrawableImageView;
-public class BitmapView extends BasicImageView {
+public class BitmapView extends BitmapDrawableImageView {
private float mDensity;
public BitmapView(Context c) {
@@ -40,6 +41,6 @@ public class BitmapView extends BasicImageView {
@Override
protected void onSizeChanged(final int w, final int h, int oldw, int oldh) {
- getDrawable().setDecodeDimensions(w, h);
+ getBasicBitmapDrawable().setDecodeDimensions(w, h);
}
} \ No newline at end of file
diff --git a/sample/src/com/example/bitmapsample/MainActivity.java b/sample/src/com/example/bitmapsample/MainActivity.java
index f580dd8..4ad18e5 100644
--- a/sample/src/com/example/bitmapsample/MainActivity.java
+++ b/sample/src/com/example/bitmapsample/MainActivity.java
@@ -93,9 +93,9 @@ public class MainActivity extends Activity {
v = new BitmapView(MainActivity.this);
final BasicBitmapDrawable drawable = new BasicBitmapDrawable(getResources(), mCache,
true /* limit density */);
- v.setDrawable(drawable);
+ v.setBasicBitmapDrawable(drawable);
}
- v.getDrawable().bind(new BitmapRequestKeyImpl(mItems[position]));
+ v.getBasicBitmapDrawable().bind(new BitmapRequestKeyImpl(mItems[position]));
return v;
}
}