e.java 5.81 KB
package com.instabug.library;

import android.content.res.Resources;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import com.instabug.library.util.b;
import com.instabug.library.util.c;
import com.instabug.library.util.l;
import com.instabug.library.view.AnnotationView;
import java.io.FileNotFoundException;

public class e
  extends h
  implements View.OnClickListener
{
  FrameLayout a;
  AnnotationView b;
  Uri c;
  String d;
  
  public static e a(Uri paramUri)
  {
    e locale = new e();
    Bundle localBundle = new Bundle();
    localBundle.putParcelable("image", paramUri);
    locale.setArguments(localBundle);
    return locale;
  }
  
  public static e a(Uri paramUri, String paramString)
  {
    e locale = new e();
    Bundle localBundle = new Bundle();
    localBundle.putParcelable("image", paramUri);
    localBundle.putString("title", paramString);
    locale.setArguments(localBundle);
    return locale;
  }
  
  protected void a()
  {
    this.c = ((Uri)getArguments().getParcelable("image"));
    this.d = getArguments().getString("title");
  }
  
  protected void a(Bundle paramBundle)
  {
    this.b.buildDrawingCache();
    paramBundle.putParcelable("image", this.b.getDrawingCache());
  }
  
  protected int b()
  {
    return R.layout.instabug_lyt_annotation;
  }
  
  protected void b(Bundle paramBundle)
  {
    paramBundle = (Bitmap)paramBundle.getParcelable("image");
    this.b.setImageBitmap(paramBundle);
  }
  
  protected String c()
  {
    return l.a(IBGCustomTextPlaceHolder.Key.BUG_REPORT_HEADER, getString(R.string.instabug_str_bug_header));
  }
  
  public void onClick(View paramView)
  {
    int i = paramView.getId();
    if (i == R.id.instabug_btn_clear_annotation) {
      this.b.a();
    }
    do
    {
      return;
      if (i == R.id.instabug_btn_done)
      {
        paramView = (Uri)getArguments().getParcelable("image");
        this.b.buildDrawingCache();
        ((a)getActivity()).a(paramView, this.b.getDrawingCache());
        return;
      }
      ((FrameLayout)getView().findViewById(R.id.instabug_btn_pick_color_red_frame)).setForeground(null);
      ((FrameLayout)getView().findViewById(R.id.instabug_btn_pick_color_blue_frame)).setForeground(null);
      ((FrameLayout)getView().findViewById(R.id.instabug_btn_pick_color_yellow_frame)).setForeground(null);
      ((FrameLayout)getView().findViewById(R.id.instabug_btn_pick_color_gray_frame)).setForeground(null);
      ((FrameLayout)getView().findViewById(R.id.instabug_btn_pick_color_green_frame)).setForeground(null);
      if (i == R.id.instabug_btn_pick_color_blue)
      {
        ((FrameLayout)getView().findViewById(R.id.instabug_btn_pick_color_blue_frame)).setForeground(getResources().getDrawable(R.drawable.instabug_ic_check));
        this.b.a(R.color.instabug_annotation_color_blue);
        return;
      }
      if (i == R.id.instabug_btn_pick_color_red)
      {
        ((FrameLayout)getView().findViewById(R.id.instabug_btn_pick_color_red_frame)).setForeground(getResources().getDrawable(R.drawable.instabug_ic_check));
        this.b.a(R.color.instabug_annotation_color_red);
        return;
      }
      if (i == R.id.instabug_btn_pick_color_gray)
      {
        ((FrameLayout)getView().findViewById(R.id.instabug_btn_pick_color_gray_frame)).setForeground(getResources().getDrawable(R.drawable.instabug_ic_check));
        this.b.a(R.color.instabug_annotation_color_gray);
        return;
      }
      if (i == R.id.instabug_btn_pick_color_yellow)
      {
        ((FrameLayout)getView().findViewById(R.id.instabug_btn_pick_color_yellow_frame)).setForeground(getResources().getDrawable(R.drawable.instabug_ic_check));
        this.b.a(R.color.instabug_annotation_color_yellow);
        return;
      }
    } while (i != R.id.instabug_btn_pick_color_green);
    ((FrameLayout)getView().findViewById(R.id.instabug_btn_pick_color_green_frame)).setForeground(getResources().getDrawable(R.drawable.instabug_ic_check));
    this.b.a(R.color.instabug_annotation_color_green);
  }
  
  public void onViewCreated(View paramView, @Nullable Bundle paramBundle)
  {
    super.onViewCreated(paramView, paramBundle);
    if (this.d != null) {
      a(this.d);
    }
    this.a = ((FrameLayout)paramView.findViewById(R.id.instabug_image_container));
    this.b = ((AnnotationView)paramView.findViewById(R.id.instabug_image));
    paramView.findViewById(R.id.instabug_btn_clear_annotation).setOnClickListener(this);
    paramView.findViewById(R.id.instabug_btn_pick_color_blue).setOnClickListener(this);
    paramView.findViewById(R.id.instabug_btn_pick_color_red).setOnClickListener(this);
    paramView.findViewById(R.id.instabug_btn_pick_color_yellow).setOnClickListener(this);
    paramView.findViewById(R.id.instabug_btn_pick_color_gray).setOnClickListener(this);
    paramView.findViewById(R.id.instabug_btn_pick_color_green).setOnClickListener(this);
    paramView = (ImageButton)paramView.findViewById(R.id.instabug_btn_done);
    paramView.setImageResource(R.drawable.instabug_ic_next);
    paramView.setOnClickListener(this);
    c.a(paramView);
    if (!d()) {
      paramView = (Uri)getArguments().getParcelable("image");
    }
    try
    {
      paramView = b.a(getActivity().getContentResolver(), paramView);
      this.b.setImageBitmap(paramView);
      return;
    }
    catch (FileNotFoundException paramView)
    {
      paramView.printStackTrace();
    }
  }
  
  public static abstract interface a
  {
    public abstract void a(Uri paramUri, Bitmap paramBitmap);
  }
}


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