@bpi
 public void onColorPickedEvent(bcc parambcc)
 {
   SnapCaptionView localSnapCaptionView = b.getCaptionView();
   if ((!(localSnapCaptionView instanceof FatCaptionView)) || (!localSnapCaptionView.g()))
   {
     g.setColor(mColor);
     j.a().setBackgroundColor(g.getColor());
   }
 }
 @bpi
 public void onEditCaptionEvent(bch parambch)
 {
   E.a(8);
   akr.N();
   i.setVisibility(0);
   p.a(4);
   F.a(8);
   SnapCaptionView localSnapCaptionView = b.getCaptionView();
   m.setBackgroundResource(2130838147);
   Button localButton = m;
   if (k) {}
   for (int i1 = 8;; i1 = 0)
   {
     localButton.setVisibility(i1);
     s.setBackgroundResource(2130837604);
     if (!mIsEditing) {
       break;
     }
     if ((localSnapCaptionView instanceof FatCaptionView))
     {
       s.setBackgroundResource(2130837537);
       g.setDrawingEnabled(false);
       o.a(4);
       i.setVisibility(4);
       q.a(8);
       C.a(8);
       p.a(0);
       m.setBackgroundResource(2130837660);
     }
     return;
   }
   u();
 }
 private void a(boolean paramBoolean)
 {
   Object localObject = o;
   if (paramBoolean)
   {
     i1 = 0;
     ((bhr)localObject).a(i1);
     localObject = i;
     if (!paramBoolean) {
       break label137;
     }
     i1 = 8;
     label28:
     ((ImageButton)localObject).setVisibility(i1);
     localObject = m;
     if (!paramBoolean) {
       break label142;
     }
   }
   label137:
   label142:
   for (int i1 = 8;; i1 = 0)
   {
     ((Button)localObject).setVisibility(i1);
     if (paramBoolean)
     {
       j.a().setBackgroundColor(g.getColor());
       C.a().setBackgroundColor(g.getLastColor());
       o.a(0);
       p.a(4);
       if (g.getNumberOfStrokes() <= 0) {
         break label147;
       }
       q.a(0);
       C.a(0);
     }
     return;
     i1 = 8;
     break;
     i1 = 0;
     break label28;
   }
   label147:
   C.a(8);
   q.a(8);
 }
 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));
 }
 @bpi
 public void onDrawingEvent(DrawingEvent paramDrawingEvent)
 {
   if (ad != null)
   {
     ad.a = true;
     ad = null;
   }
   if (mDrawingEventType == DrawingEvent.DrawingEventType.STARTED_STROKE)
   {
     ad = new a((byte)0);
     ac.postDelayed(ad, 250L);
   }
   while (mDrawingEventType != DrawingEvent.DrawingEventType.COMPLETED_STROKE) {
     return;
   }
   if (ae != -1L)
   {
     float f2 = 1.0E12F * (float)(System.nanoTime() - ae) / 400.0F;
     ae = -1L;
     float f1 = f2;
     if (f2 > 1.0F) {
       f1 = 1.0F;
     }
     paramDrawingEvent = new AlphaAnimation(f1 * 0.0F, 1.0F);
     paramDrawingEvent.setDuration(400L);
     o.a().startAnimation(paramDrawingEvent);
     r.startAnimation(paramDrawingEvent);
     s.startAnimation(paramDrawingEvent);
     if (M.c()) {
       ((SendToBottomPanelView)M.a()).startAnimation(paramDrawingEvent);
     }
   }
   q.a(0);
   C.a(0);
   C.a().setBackgroundColor(g.getLastColor());
 }
 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;
 }
 private void x()
 {
   Z.a(new bfk(TitleBarManager.Visibility.HIDDEN));
   int i1;
   label299:
   boolean bool;
   label316:
   label336:
   of localof;
   EasyMetric localEasyMetric;
   if (avr.a(a))
   {
     y.setVisibility(4);
     h.setVisibility(8);
     D.setVisibility(0);
     if (getUserVisibleHint()) {
       Z.a(new bbx(1));
     }
     s.setOnClickListener(new View.OnClickListener()
     {
       public final void onClick(View paramAnonymousView)
       {
         ((InputMethodManager)SnapPreviewFragment.a(SnapPreviewFragment.this, "input_method")).hideSoftInputFromWindow(SnapPreviewFragment.b(SnapPreviewFragment.this).getApplicationWindowToken(), 0);
         getActivity().onBackPressed();
       }
     });
     m.setOnClickListener(new View.OnClickListener()
     {
       public final void onClick(View paramAnonymousView)
       {
         if ((SnapPreviewFragment.c(SnapPreviewFragment.this).getCaptionView().i()) && (!SnapPreviewFragment.c(SnapPreviewFragment.this).getCaptionView().g()))
         {
           SnapPreviewFragment.c(SnapPreviewFragment.this).getCaptionView().f();
           return;
         }
         SnapPreviewFragment.c(SnapPreviewFragment.this).a(true);
       }
     });
     o.a(new bhr.a()
     {
       public final void a(View paramAnonymousView)
       {
         ((ImageButton)SnapPreviewFragment.e(SnapPreviewFragment.this).a()).setOnClickListener(new View.OnClickListener()
         {
           public final void onClick(View paramAnonymous2View)
           {
             SnapPreviewFragment.d(SnapPreviewFragment.this);
           }
         });
         ((ImageButton)SnapPreviewFragment.g(SnapPreviewFragment.this).a()).setOnClickListener(new View.OnClickListener()
         {
           public final void onClick(View paramAnonymous2View)
           {
             SnapPreviewFragment.f(SnapPreviewFragment.this);
           }
         });
       }
     });
     i.setOnClickListener(new View.OnClickListener()
     {
       public final void onClick(View paramAnonymousView)
       {
         AnalyticsEvents.i();
         SnapPreviewFragment.d(SnapPreviewFragment.this);
       }
     });
     t.setOnClickListener(new View.OnClickListener()
     {
       public final void onClick(View paramAnonymousView)
       {
         SnapPreviewFragment.h(SnapPreviewFragment.this);
         imMediaMailingMetadata.mSavedInGallery = true;
       }
     });
     z.a(new bhr.a()
     {
       public final void a(View paramAnonymousView)
       {
         SnapPreviewFragment.j(SnapPreviewFragment.this);
       }
     });
     y.setOnClickListener(new View.OnClickListener()
     {
       public final void onClick(View paramAnonymousView)
       {
         if (!SnapPreviewFragment.k(SnapPreviewFragment.this).c())
         {
           if (SnapPreviewFragment.l(SnapPreviewFragment.this)) {
             SnapPreviewFragment.d(SnapPreviewFragment.this);
           }
           SnapPreviewFragment.m(SnapPreviewFragment.this);
         }
       }
     });
     L.a(new bhr.a()
     {
       public final void a(View paramAnonymousView)
       {
         ((ListView)paramAnonymousView.findViewById(2131362726)).setAdapter(c);
       }
     });
     A.setOnClickListener(new View.OnClickListener()
     {
       public final void onClick(View paramAnonymousView)
       {
         if (akr.J())
         {
           SnapPreviewFragment.n(SnapPreviewFragment.this).show();
           return;
         }
         if (akk.a().d().size() > 1)
         {
           SnapPreviewFragment.o(SnapPreviewFragment.this);
           return;
         }
         SnapPreviewFragment.p(SnapPreviewFragment.this);
       }
     });
     v();
     i1 = D();
     B = i1;
     h.setText(String.valueOf(i1));
     I.setOnClickListener(new View.OnClickListener()
     {
       public final void onClick(View paramAnonymousView)
       {
         if (!SnapPreviewFragment.q(SnapPreviewFragment.this))
         {
           rmPrepareSnapMetric = EasyMetric.EasyMetricFactory.b("PREPARE_SNAP").b();
           SnapPreviewFragment.s(SnapPreviewFragment.this);
         }
         SnapPreviewFragment.t(SnapPreviewFragment.this);
       }
     });
     D.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener()
     {
       public final void onCheckedChanged(CompoundButton paramAnonymousCompoundButton, boolean paramAnonymousBoolean)
       {
         paramAnonymousCompoundButton = SnapPreviewFragment.c(SnapPreviewFragment.this);
         if (!paramAnonymousBoolean) {}
         for (paramAnonymousBoolean = true;; paramAnonymousBoolean = false)
         {
           paramAnonymousCompoundButton.setAudible(paramAnonymousBoolean);
           return;
         }
       }
     });
     b.getCaptionView().setIsVideoSnap(avr.a(a));
     if (R != null) {
       break label541;
     }
     b.setMediabryo(a);
     localObject = b;
     if (D.isChecked()) {
       break label560;
     }
     bool = true;
     ((SnapEditorView)localObject).setAudible(bool);
     localObject = m;
     if (!k) {
       break label565;
     }
     i1 = 8;
     ((Button)localObject).setVisibility(i1);
     if (b.getSwipeFilterType() == FilterPageType.TURN_ON_FILTERS_PAGE)
     {
       if (ad != null)
       {
         ad.a = true;
         ad = null;
       }
       i.setVisibility(8);
       r.setVisibility(8);
       s.setVisibility(8);
     }
     g.a(v);
     v = awf.d(getActivity());
     localof = U;
     bool = awf.b(v);
     if (mSnapCaptureMetric != null)
     {
       localEasyMetric = mSnapCaptureMetric;
       if (!bool) {
         break label570;
       }
     }
   }
   label541:
   label560:
   label565:
   label570:
   for (Object localObject = "portrait";; localObject = "landscape")
   {
     localEasyMetric.a("orientation", localObject).b(false);
     mSnapCaptureMetric = null;
     localof.b();
     O.a = a.h();
     return;
     if ((getUserVisibleHint()) && (a.mSnapType != Mediabryo.SnapType.DISCOVER)) {
       Z.a(new bbx(-1));
     }
     t();
     break;
     b.a(R);
     R = null;
     break label299;
     bool = false;
     break label316;
     i1 = 0;
     break label336;
   }
 }
 public void onActivityCreated(Bundle paramBundle)
 {
   super.onActivityCreated(paramBundle);
   if (mFragmentLayout == null) {
     return;
   }
   paramBundle = getActivity();
   if (paramBundle != null) {
     w = PreferenceManager.getDefaultSharedPreferences(paramBundle);
   }
   s = ((ImageButton)c(2131362271));
   m = ((Button)c(2131362273));
   i = ((ImageButton)c(2131362272));
   t = ((ImageButton)c(2131362708));
   p = new bhr(mFragmentLayout, 2131362712, 2131362721);
   h = ((TextView)c(2131362714));
   y = c(2131362713);
   A = c(2131362715);
   E = new bhr(mFragmentLayout, 2131362716, 2131362724);
   F = new bhr(mFragmentLayout, 2131362717, 2131362727);
   D = ((CheckBox)c(2131362275));
   I = ((ImageButton)c(2131362276));
   L = new bhr(mFragmentLayout, 2131362718, 2131362725);
   M = new bhr(mFragmentLayout, 2131362719, 2131362614);
   o = new bhr(mFragmentLayout, 2131362711, 2131362702);
   j = new bhr(mFragmentLayout, 2131362711, 2131362703);
   C = new bhr(mFragmentLayout, 2131362711, 2131362705);
   n = new bhr(mFragmentLayout, 2131362711, 2131362704);
   q = new bhr(mFragmentLayout, 2131362711, 2131362706);
   s.setOnTouchListener(new atu(s));
   i.setOnTouchListener(new atu(i));
   y.setOnTouchListener(new atu(y));
   u = new atu(t);
   t.setOnTouchListener(u);
   A.setOnTouchListener(new atu(A));
   D.setOnTouchListener(new atu(D));
   I.setOnTouchListener(new atu(I));
   if ((akr.d() == 0) && (!akr.M())) {
     E.a(0);
   }
   for (;;)
   {
     z = new bhr(mFragmentLayout, 2131362720, 2131362729);
     x = new bhr(mFragmentLayout, 2131362720, 2131362730);
     r = c(2131362274);
     b = ((SnapEditorView)c(2131362701));
     b.a(paramBundle);
     b.setSnapPreviewRotationListener(this);
     b.setInterface(this);
     b.setSwipeImageViewAnalytics(O);
     b.setSwipeImageViewOnScrollListener(this);
     g = b.getCanvasView();
     x();
     g.setColor(g.getColor());
     c = new aoe(getActivity(), akk.a().d(), this);
     return;
     if (!akr.O()) {
       y();
     }
   }
 }
 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;
   }
 }