public void onResume()
 {
   super.onResume();
   if (a != null) {
     a.b();
   }
   Z.c(b.getCaptionView());
   g.setDrawingEnabled(k);
   b.b(false);
   a(k);
 }
 public void onDestroyView()
 {
   super.onDestroyView();
   if (!b.getCaptionView().i()) {
     AnalyticsEvents.h();
   }
   if (g.getNumberOfStrokes() > 0) {
     AnalyticsEvents.b(g.getNumberOfStrokes());
   }
   if (O.b + O.c > 0) {
     AnalyticsEvents.a(a);
   }
   og.a();
   og.d(a);
   b.b();
   b = null;
   R = null;
   WindowManager.LayoutParams localLayoutParams = J().getAttributes();
   flags |= 0x200;
   J().setAttributes(localLayoutParams);
   Z.a(new bbx(1));
 }
 public final boolean g()
 {
   if (L.c())
   {
     m();
     return true;
   }
   if (ab)
   {
     p();
     return true;
   }
   if ((l) || (b == null) || (b.getCaptionView() == null) || (g == null)) {
     return false;
   }
   Object localObject = b;
   if ((a.g()) && ((a instanceof FatCaptionView))) {
     a.a(true);
   }
   for (int i1 = 1; i1 != 0; i1 = 0) {
     return true;
   }
   if (g.c())
   {
     new ara(getActivity(), getString(2131492920))
     {
       protected final void a()
       {
         SnapPreviewFragment.a(SnapPreviewFragment.this);
         FragmentActivity localFragmentActivity = getActivity();
         if (localFragmentActivity != null) {
           localFragmentActivity.onBackPressed();
         }
       }
       
       protected final void b() {}
     }.show();
     return true;
   }
   if ((a != null) && (avr.a(a)) && (e == null)) {
     CameraEventAnalytics.a().a(CameraEventAnalytics.CameraContext.CANCEL_PREVIEW);
   }
   if ((a == null) || (e != null)) {}
   for (;;)
   {
     Z.a(new bbq(CameraDisplayState.SHOW));
     if (H == null) {
       break;
     }
     Z.a(new bbt());
     return true;
     if (a.mSnapType == Mediabryo.SnapType.DISCOVER)
     {
       T.b(a);
     }
     else
     {
       localObject = S;
       aji localaji = a;
       b.b(localaji);
       if ((localaji instanceof aku))
       {
         localObject = ((aku)localaji).n();
         if (localObject != null) {
           aya.a((String)localObject);
         }
       }
     }
   }
   return false;
 }
 protected final boolean n()
 {
   boolean bool2 = false;
   if ((a == null) || ((a.h() == 0) && (a.mRawImageBitmap == null))) {
     bool1 = true;
   }
   Object localObject2;
   FragmentShader.Filter localFilter;
   int i1;
   aku localaku;
   Bitmap localBitmap1;
   label280:
   label286:
   do
   {
     do
     {
       do
       {
         return bool1;
         a.c();
         localObject1 = getActivity();
         localObject2 = b.b.getCurrentPage();
         if (localObject2 != null) {
           ((asm)localObject2).i();
         }
         localObject1 = b.b((Context)localObject1);
         if (!avr.a(a)) {
           break;
         }
         b.c();
         bool1 = bool2;
       } while (a.mVideoUri == null);
       bool1 = bool2;
     } while (a.mVideoUri.getPath() == null);
     localFilter = b.getShaderFilter();
     a.a((Bitmap)localObject1);
     if (D.isChecked()) {
       a.i();
     }
     if ((a.mSnapType == Mediabryo.SnapType.SNAP) && (a.mVideoUri != null))
     {
       i1 = (int)(X.a(a.mVideoUri.getPath()) / 1000.0D);
       a.mTimerValueOrDuration = i1;
     }
     if (!(a instanceof aku)) {
       break label640;
     }
     localaku = (aku)a;
     if (a.mSnapType != Mediabryo.SnapType.DISCOVER) {
       break label624;
     }
     localBitmap1 = mFirstFrameBitmap;
     if (localBitmap1 != null) {
       break;
     }
     if (ReleaseManager.f()) {
       throw new IllegalArgumentException("Videobryo has no first frame bitmap.");
     }
     i1 = 0;
     if (i1 != 0) {
       break label624;
     }
     i1 = 0;
     bool1 = bool2;
   } while (i1 == 0);
   label293:
   if (!b.getCaptionView().i()) {
     a.mCaptionText = b.getCaptionView().getText();
   }
   Object localObject1 = a;
   if (g.getNumberOfStrokes() > 0) {}
   for (boolean bool1 = true;; bool1 = false)
   {
     mHasDrawing = bool1;
     a.mSwipeFilterNumSingleSwipes = O.b;
     a.mSwipeFilterNumDoubleSwipes = O.c;
     a.mGeofilterImpressions = O.d;
     a.mCaptionStyleDescription = b.getCaptionStyleDescription();
     a.mCaptionAnalyticData = b.getCaptionAnalyticsDetails();
     a.mBaseFilter = O.e;
     a.mStackedFilter = O.f;
     return true;
     Bitmap localBitmap2 = mCompositeImageBitmap;
     int i2;
     if (localBitmap2 == null) {
       i2 = localBitmap1.getWidth();
     }
     for (i1 = localBitmap1.getHeight();; i1 = localBitmap2.getHeight())
     {
       localObject2 = aa.a(i2, i1, Bitmap.Config.ARGB_8888);
       localObject1 = localObject2;
       if (localObject2 == null) {
         localObject1 = avp.a(i2, i1, Bitmap.Config.ARGB_8888);
       }
       if (localObject1 != null) {
         break label571;
       }
       localObject1 = String.format("Failed to create bitmap for raw image (width=%d, height=%d)", new Object[] { Integer.valueOf(i2), Integer.valueOf(i1) });
       if (!ReleaseManager.f()) {
         break;
       }
       throw new IllegalArgumentException((String)localObject1);
       i2 = localBitmap2.getWidth();
     }
     i1 = 0;
     break label280;
     label571:
     localObject2 = new Canvas((Bitmap)localObject1);
     if (localBitmap1 != null) {
       ((Canvas)localObject2).drawBitmap(localBitmap1, 0.0F, 0.0F, null);
     }
     if (localBitmap2 != null) {
       ((Canvas)localObject2).drawBitmap(localBitmap2, 0.0F, 0.0F, null);
     }
     mRawImageBitmap = ((Bitmap)localObject1);
     i1 = 1;
     break label280;
     label624:
     mShaderFilter = localFilter;
     W.a(localaku);
     label640:
     i1 = 1;
     break label286;
     bool1 = bool2;
     if (localObject1 == null) {
       break;
     }
     if (localObject1 == null) {
       throw new NullPointerException("Image Snap with no image? Ruh-roh");
     }
     a.a((Bitmap)localObject1);
     a.mTimerValueOrDuration = B;
     break label293;
   }
 }