o.java 4.78 KB
package com.instabug.library;

import android.content.Intent;
import android.net.Uri;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.TextView;
import com.instabug.library.internal.d.a;
import com.instabug.library.internal.d.a.h;
import com.instabug.library.util.InstabugSDKLogger;
import com.instabug.library.util.k;
import com.instabug.library.util.l;
import java.io.File;
import rz.b;

public class o
  extends Fragment
  implements View.OnClickListener
{
  public static o a(boolean paramBoolean)
  {
    o localo = new o();
    Bundle localBundle = new Bundle();
    localBundle.putBoolean("hide_audio", paramBoolean);
    localo.setArguments(localBundle);
    return localo;
  }
  
  public void onActivityResult(int paramInt1, int paramInt2, Intent paramIntent)
  {
    super.onActivityResult(paramInt1, paramInt2, paramIntent);
    switch (paramInt1)
    {
    default: 
      return;
    }
    if ((paramInt2 == -1) && (paramIntent != null))
    {
      paramIntent = paramIntent.getData();
      paramIntent = a.a(getActivity(), paramIntent);
      v.a().a(getActivity(), Uri.fromFile(new File(paramIntent)));
      getActivity().onBackPressed();
    }
    for (;;)
    {
      v.a().a(false);
      return;
      if (paramInt2 == 0) {
        getActivity().onBackPressed();
      }
    }
  }
  
  public void onClick(View paramView)
  {
    int i = paramView.getId();
    if (i == R.id.instabug_btn_add_image)
    {
      v.a().a(true);
      k.a(this, "android.permission.WRITE_EXTERNAL_STORAGE", 1, new Runnable()new Runnable
      {
        public final void run()
        {
          o.a(o.this);
        }
      }, new Runnable()
      {
        public final void run()
        {
          InstabugSDKLogger.i(o.this, "Permission granted");
          o.a(o.this);
        }
      });
    }
    do
    {
      return;
      if (i == R.id.instabug_btn_take_screenshot)
      {
        v.a().a(true);
        h.a(v.a().b());
        Instabug.setSDKState(rz.b.c);
        getActivity().finish();
        return;
      }
    } while (i != R.id.instabug_btn_add_audio);
    getFragmentManager().popBackStack();
    paramView = new File(a.a(getActivity()), "audioMessage_" + String.valueOf(System.currentTimeMillis()) + ".mp4");
    FragmentTransaction localFragmentTransaction = getFragmentManager().beginTransaction();
    getActivity().findViewById(R.id.instabug_fragment_blackout).setVisibility(0);
    localFragmentTransaction.setCustomAnimations(R.anim.instabug_anim_options_sheet_enter, R.anim.instabug_anim_options_sheet_exit).add(R.id.instabug_bottomsheet_container, f.a(paramView.getAbsolutePath()), "record_audio").addToBackStack("Record Audio").commit();
  }
  
  @Nullable
  public View onCreateView(LayoutInflater paramLayoutInflater, ViewGroup paramViewGroup, Bundle paramBundle)
  {
    paramLayoutInflater = paramLayoutInflater.inflate(R.layout.instabug_lyt_new_attachment, paramViewGroup, false);
    ((TextView)paramLayoutInflater.findViewById(R.id.instabug_btn_add_image_text)).setText(l.a(IBGCustomTextPlaceHolder.Key.ADD_IMAGE_FROM_GALLERY, getString(R.string.instabug_str_add_photo)));
    ((TextView)paramLayoutInflater.findViewById(R.id.instabug_btn_add_screenshot_text)).setText(l.a(IBGCustomTextPlaceHolder.Key.ADD_EXTRA_SCREENSHOT, getString(R.string.instabug_str_take_screenshot)));
    ((TextView)paramLayoutInflater.findViewById(R.id.instabug_btn_add_audio_text)).setText(l.a(IBGCustomTextPlaceHolder.Key.ADD_VOICE_MESSAGE, getString(R.string.instabug_str_record_audio)));
    paramLayoutInflater.findViewById(R.id.instabug_btn_add_image).setOnClickListener(this);
    paramLayoutInflater.findViewById(R.id.instabug_btn_take_screenshot).setOnClickListener(this);
    paramLayoutInflater.findViewById(R.id.instabug_btn_add_audio).setOnClickListener(this);
    if ((Build.VERSION.SDK_INT < 23) && (!k.a(getActivity(), "android.permission.RECORD_AUDIO"))) {
      Instabug.setShouldAudioRecordingOptionAppear(false);
    }
    if (!Instabug.shouldAudioRecordingOptionAppear()) {
      paramLayoutInflater.findViewById(R.id.instabug_btn_add_audio).setVisibility(8);
    }
    if ((getArguments() != null) && (getArguments().getBoolean("hide_audio", true))) {
      paramLayoutInflater.findViewById(R.id.instabug_btn_add_audio).setVisibility(8);
    }
    return paramLayoutInflater;
  }
}


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