a.java 1.6 KB
package com.instabug.library.internal.layer;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import com.instabug.library.util.InstabugSDKLogger;
import java.lang.ref.WeakReference;

public class a
  implements c
{
  private WeakReference<CapturableView> a;
  private Bitmap b;
  
  public a(CapturableView paramCapturableView)
  {
    this.a = new WeakReference(paramCapturableView);
  }
  
  public void a(Canvas paramCanvas)
  {
    int[] arrayOfInt = new int[2];
    ((CapturableView)this.a.get()).getLocationOnScreen(arrayOfInt);
    paramCanvas.drawBitmap(this.b, arrayOfInt[0], arrayOfInt[1], null);
  }
  
  public void a(final c.a parama)
  {
    if ((this.a == null) || (this.a.get() == null) || (!((CapturableView)this.a.get()).isVisible())) {
      parama.a();
    }
    ((CapturableView)this.a.get()).snapshot(new CapturableView.SnapshotPreparationCallback()
    {
      public final void onSnapshotFailed()
      {
        parama.a();
      }
      
      public final void onSnapshotReady(Bitmap paramAnonymousBitmap)
      {
        a.a(a.this, paramAnonymousBitmap);
        parama.a();
      }
    });
  }
  
  public boolean a()
  {
    if (this.a.get() == null)
    {
      InstabugSDKLogger.w(this, "Capturable view reference no longer exists. Skipping.");
      return false;
    }
    return true;
  }
  
  public Object b()
  {
    if (this.a == null) {
      return null;
    }
    return this.a.get();
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/com/instabug/library/internal/layer/a.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */