Android Open Source - android-imgpro-lib Set Image View Bitmap Task






From Project

Back to project page android-imgpro-lib.

License

The source code is released under:

MIT License

If you think the Android project android-imgpro-lib 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 net.akhyar.android.perf;
// ww  w  . j a  va 2  s. co  m
import java.lang.ref.WeakReference;

import android.graphics.Bitmap;
import android.widget.ImageView;

public class SetImageViewBitmapTask extends BitmapTask {

  private final WeakReference<ImageView> imgViewRef;

  public SetImageViewBitmapTask(ImageView weakImageView, BitmapTask nextTask) {
    super(null, nextTask);

    imgViewRef = new WeakReference<ImageView>(weakImageView);
  }

  public SetImageViewBitmapTask(ImageView weakImageView) {
    this(weakImageView, null);
  }

  @Override
  protected Bitmap doInBackground(Bitmap... args) {
    if (args.length > 0)
      return args[0];
    else
      return null;
  }

  @Override
  protected void onPostExecute(Bitmap bitmap) {
    final ImageView iv = imgViewRef.get();
    if (iv != null && bitmap != null) {
      iv.setImageBitmap(bitmap);
    }

    super.onPostExecute(bitmap);
  }
}




Java Source Code List

net.akhyar.android.imgpro.Action.java
net.akhyar.android.imgpro.Channel.java
net.akhyar.android.imgpro.FilterListener.java
net.akhyar.android.imgpro.FilterTask.java
net.akhyar.android.imgpro.Filter.java
net.akhyar.android.imgpro.ImgPro.java
net.akhyar.android.imgpro.actions.Blend.java
net.akhyar.android.imgpro.actions.Blur.java
net.akhyar.android.imgpro.actions.Brightness.java
net.akhyar.android.imgpro.actions.ChannelMix.java
net.akhyar.android.imgpro.actions.Colorize.java
net.akhyar.android.imgpro.actions.Contrast.java
net.akhyar.android.imgpro.actions.Desaturate.java
net.akhyar.android.imgpro.actions.Invert.java
net.akhyar.android.imgpro.filters.Default.java
net.akhyar.android.imgpro.filters.Vintage.java
net.akhyar.android.imgpro.filters.XProcess.java
net.akhyar.android.perf.BitmapTask.java
net.akhyar.android.perf.SetBitmap.java
net.akhyar.android.perf.SetImageViewBitmapTask.java
net.akhyar.android.perf.Worker.java