summaryrefslogtreecommitdiff
path: root/sample/src/com/example/bitmapsample/BitmapView.java
diff options
context:
space:
mode:
Diffstat (limited to 'sample/src/com/example/bitmapsample/BitmapView.java')
-rw-r--r--sample/src/com/example/bitmapsample/BitmapView.java26
1 files changed, 3 insertions, 23 deletions
diff --git a/sample/src/com/example/bitmapsample/BitmapView.java b/sample/src/com/example/bitmapsample/BitmapView.java
index 37904f4..d8de0c9 100644
--- a/sample/src/com/example/bitmapsample/BitmapView.java
+++ b/sample/src/com/example/bitmapsample/BitmapView.java
@@ -17,15 +17,11 @@
package com.example.bitmapsample;
import android.content.Context;
-import android.os.Build;
import android.util.AttributeSet;
-import android.view.View;
-import com.android.bitmap.BitmapCache;
-import com.android.bitmap.drawable.BasicBitmapDrawable;
+import com.android.bitmap.view.BasicImageView;
-public class BitmapView extends View {
- private BasicBitmapDrawable mBitmapDrawable;
+public class BitmapView extends BasicImageView {
private float mDensity;
public BitmapView(Context c) {
@@ -44,22 +40,6 @@ public class BitmapView extends View {
@Override
protected void onSizeChanged(final int w, final int h, int oldw, int oldh) {
- mBitmapDrawable.setDecodeDimensions(w, h);
+ getDrawable().setDecodeDimensions(w, h);
}
-
- public void setImage(String uriString) {
- if (mBitmapDrawable != null) {
- mBitmapDrawable.bind(new BitmapRequestKeyImpl(uriString));
- }
- }
-
- public void initialize(BitmapCache cache) {
- mBitmapDrawable = new BasicBitmapDrawable(getResources(), cache, true /* limitDensity */);
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
- setBackground(mBitmapDrawable);
- } else {
- setBackgroundDrawable(mBitmapDrawable);
- }
- }
-
} \ No newline at end of file