Android Open Source - bitmapfun Bitmap Data






From Project

Back to project page bitmapfun.

License

The source code is released under:

Apache License

If you think the Android project bitmapfun listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.example.android.bitmapfun.util;
/*from  w  w w.ja  v a 2 s .c  o m*/
import android.graphics.drawable.Drawable;

public class BitmapData {
  private final Object data;
  private final int desiredWidth;
  private final int desiredHeight;
  private final String memKey;
  private final String diskKey;
  private OnDrawable onDrawable;
  public interface OnDrawable{
    public Drawable onPreSetDrawable(BitmapData data, Drawable drawable);
    public void onAfterSetDrawable(BitmapData data);
  }
  public static BitmapData obtain(Object data, int desiredWidth, int desiredHeight){
    return new BitmapData(data, 
        ""+data, 
        data+""+desiredWidth+","+desiredHeight, 
        desiredWidth, 
        desiredHeight);
  }
  protected BitmapData(Object data, String diskKey, 
      String memKey, int desiredWidth, int desiredHeight){
    this.data = data;
    this.desiredWidth =desiredWidth;
    this.desiredHeight = desiredHeight;
    this.memKey = memKey;
    this.diskKey = diskKey;
  }
  public Object getData(){
    return data;
  }
  public String getDiskKey(){
    return data.toString();
  }
  public String getMemKey(){
    return memKey;
  }
  public int getDesiredWidth(){
    return desiredWidth;
  }
  public int getDesiredHeight(){
    return desiredHeight;
  }
  public void setOnDrawable(OnDrawable onDrawable){
    this.onDrawable = onDrawable;
  }
  public OnDrawable getOnDrawable(){
    return this.onDrawable;
  }
  
  @Override
  public String toString(){
    StringBuilder sb = new StringBuilder();
    sb.append("data: ")
    .append(data)
    .append(", memKey: ")
    .append(memKey)
    .append(", desiredWidth: ")
    .append(desiredWidth)
    .append(", desiredHeight: ")
    .append(desiredHeight);
    return sb.toString();
  }
}




Java Source Code List

com.example.android.bitmapfun.util.AsyncTask.java
com.example.android.bitmapfun.util.BitmapData.java
com.example.android.bitmapfun.util.BitmapUtils.java
com.example.android.bitmapfun.util.DiskLruCache.java
com.example.android.bitmapfun.util.ImageCache.java
com.example.android.bitmapfun.util.ImageDetailActivity.java
com.example.android.bitmapfun.util.ImageDetailFragment.java
com.example.android.bitmapfun.util.ImageFetcher.java
com.example.android.bitmapfun.util.ImageResizer.java
com.example.android.bitmapfun.util.ImageSetFactory.java
com.example.android.bitmapfun.util.ImageSet.java
com.example.android.bitmapfun.util.ImageWorker.java
com.example.android.bitmapfun.util.RecyclingBitmapDrawable.java
com.example.android.bitmapfun.util.RecyclingImageView.java
com.example.android.bitmapfun.util.Utils.java