package com.tealium.library;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Handler;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
import android.view.animation.ScaleAnimation;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Set;

final class FULL_AutoTracker
  implements h, j, l, n, q
{
  private final List<ab> a;
  private final List<ab> b;
  private final Set<Class<? extends Activity>> c;
  private final V d;
  private final y e;
  private final T f;
  private G.g g;
  private H h;

  public FULL_AutoTracker(Tealium.Config paramConfig, V paramV)
  {
    if ((paramConfig == null) || (paramV == null))
      throw new IllegalArgumentException("Unable to construct AutoTracker, Tealium.Builder was null.");
    this.d = paramV;
    this.c = paramConfig.e();
    this.a = Collections.synchronizedList(new LinkedList());
    this.b = Collections.synchronizedList(new LinkedList());
    this.f = new T(paramV);
    this.e = new y(this.d, paramConfig);
    d.a(this.f);
    d.a(this.e);
  }

  private G b()
  {
    if ((this.h != null) && (this.h.getChildCount() > 0))
      return (G)this.h.getChildAt(0);
    return null;
  }

  private void c()
  {
    if (this.h == null)
      return;
    G localG1 = b();
    G localG3;
    if (localG1 == null)
    {
      G localG2 = new G(this.a, this.b, this.h, this.d);
      d.a(localG2);
      this.h.addView(localG2);
      localG3 = localG2;
    }
    for (int i = 1; ; i = 0)
    {
      if (this.g == null)
      {
        localG3.d();
        if (i != 0)
        {
          ScaleAnimation localScaleAnimation = new ScaleAnimation(0.0F, 1.0F, 0.0F, 1.0F, 1, 0.5F, 1, 0.5F);
          localScaleAnimation.setDuration(500L);
          localG3.startAnimation(localScaleAnimation);
        }
      }
      while (true)
      {
        d.a().postDelayed(new Runnable()
        {
          public final void run()
          {
            G localG = FULL_AutoTracker.a(FULL_AutoTracker.this);
            if (localG != null)
              localG.c().a();
          }
        }
        , 250L);
        return;
        localG3.a(this.g);
        this.g = null;
      }
      localG3 = localG1;
    }
  }

  public final void a()
  {
    if (!ad.a())
      d.a().post(new Runnable()
      {
        public final void run()
        {
          FULL_AutoTracker.this.a();
        }
      });
    while (!this.d.f())
      return;
    c();
  }

  public final void a(final Activity paramActivity)
  {
    if (!ad.a())
      d.a().post(new Runnable()
      {
        public final void run()
        {
          FULL_AutoTracker.this.a(paramActivity);
        }
      });
    while (this.h == null)
      return;
    G localG = b();
    if (localG != null);
    for (this.g = localG.a(); ; this.g = null)
    {
      this.h = null;
      return;
    }
  }

  public final void a(ab paramab)
  {
    if (this.b.size() == z.a)
      this.b.remove(0);
    this.b.add(paramab);
    d.h();
  }

  @SuppressLint({"NewApi"})
  public final void b(final Activity paramActivity)
  {
    if (!ad.a())
      d.a().post(new Runnable()
      {
        public final void run()
        {
          FULL_AutoTracker.this.b(paramActivity);
        }
      });
    while ((paramActivity == null) || (!this.d.a()))
      return;
    if ((this.c != null) && (this.c.contains(paramActivity.getClass())))
    {
      Locale localLocale2 = Locale.ROOT;
      Object[] arrayOfObject2 = new Object[1];
      arrayOfObject2[0] = paramActivity.getClass().getName();
      X.b(String.format(localLocale2, "\"%s\" has been excluded from ui-autotracking, no events inside this activity will be autotracked.", arrayOfObject2));
      return;
    }
    final View localView1 = paramActivity.findViewById(16908290);
    if ((localView1 == null) || (!(localView1 instanceof ViewGroup)))
    {
      Locale localLocale1 = Locale.ROOT;
      Object[] arrayOfObject1 = new Object[1];
      arrayOfObject1[0] = paramActivity.getClass().getName();
      X.d(String.format(localLocale1, "Tealium is unable to scan Activity \"%s\", there is no ViewGroup with the id \"android.R.id.content\".", arrayOfObject1));
      return;
    }
    label170: ViewGroup localViewGroup;
    if (localView1.getWidth() == 0)
    {
      localView1.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener()
      {
        public final void onGlobalLayout()
        {
          Tealium.track(paramActivity, Tealium.map(new String[] { "autotracked", "true" }), "view");
          S.a(localView1.getViewTreeObserver(), this);
        }
      });
      localViewGroup = (ViewGroup)localView1;
      this.h = null;
    }
    for (int i = -1 + localViewGroup.getChildCount(); ; i--)
      if (i >= 0)
      {
        View localView2 = localViewGroup.getChildAt(i);
        if ((localView2 instanceof H))
          this.h = ((H)localView2);
      }
      else
      {
        if (this.h == null)
        {
          this.h = new H(paramActivity, this.e.c(), localViewGroup);
          d.a(this.h);
          localViewGroup.addView(this.h);
        }
        localViewGroup.bringChildToFront(this.h);
        if (this.g != null)
          break label334;
        if (this.h.getChildCount() <= 0)
          break;
        this.h.removeAllViews();
        return;
        Tealium.track(paramActivity, Tealium.map(new String[] { "autotracked", "true" }), "view");
        break label170;
      }
    label334: c();
  }

  public final void b(ab paramab)
  {
    if (this.a.size() == z.a)
      this.a.remove(0);
    this.a.add(paramab);
    d.h();
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.tealium.library.FULL_AutoTracker
 * JD-Core Version:    0.6.2
 */