FloaterView.java 2.33 KB
package com.bitstrips.imoji.ui.views;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.AppCompatImageView;
import android.util.AttributeSet;
import com.squareup.picasso.Picasso.LoadedFrom;
import com.squareup.picasso.Target;

public class FloaterView
  extends AppCompatImageView
  implements Target
{
  public FloaterView(Context paramContext)
  {
    super(paramContext);
  }
  
  public FloaterView(Context paramContext, AttributeSet paramAttributeSet)
  {
    super(paramContext, paramAttributeSet);
  }
  
  public void onBitmapFailed(Drawable paramDrawable) {}
  
  public void onBitmapLoaded(Bitmap paramBitmap, Picasso.LoadedFrom paramLoadedFrom)
  {
    setImageBitmap(paramBitmap);
  }
  
  public void onPrepareLoad(Drawable paramDrawable) {}
  
  public void setImageBitmap(Bitmap paramBitmap)
  {
    int i = getResources().getDimensionPixelSize(2131362021);
    Bitmap localBitmap = Bitmap.createScaledBitmap(paramBitmap, paramBitmap.getWidth() + i, i + paramBitmap.getHeight(), false);
    Object localObject = new int[localBitmap.getHeight() * localBitmap.getWidth()];
    localBitmap.getPixels((int[])localObject, 0, localBitmap.getWidth(), 0, 0, localBitmap.getWidth(), localBitmap.getHeight());
    int j = getResources().getColor(2131624039);
    i = 0;
    while (i < localObject.length)
    {
      if (localObject[i] != 0) {
        localObject[i] = j;
      }
      i += 1;
    }
    localBitmap.setPixels((int[])localObject, 0, localBitmap.getWidth(), 0, 0, localBitmap.getWidth(), localBitmap.getHeight());
    localObject = Bitmap.createBitmap(localBitmap.getWidth(), localBitmap.getHeight(), localBitmap.getConfig());
    Canvas localCanvas = new Canvas((Bitmap)localObject);
    i = (localCanvas.getWidth() - paramBitmap.getWidth()) / 2;
    j = (localCanvas.getHeight() - paramBitmap.getHeight()) / 2;
    localCanvas.drawBitmap(localBitmap, new Matrix(), null);
    localCanvas.drawBitmap(paramBitmap, i, j, null);
    super.setImageBitmap((Bitmap)localObject);
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/com/bitstrips/imoji/ui/views/FloaterView.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */