package com.tealium.library;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.graphics.Canvas;
import android.graphics.Point;
import android.os.Handler;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.ViewParent;
import android.view.ViewTreeObserver;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
import android.widget.FrameLayout;
import java.lang.ref.WeakReference;

final class H extends FrameLayout
  implements ViewTreeObserver.OnGlobalLayoutListener, e, f
{
  private final WeakReference<ViewGroup> a;
  private final J b;
  private final P c = new P();
  private final int[] d;
  private final Point e;
  private WeakReference<View> f;
  private int g;

  H(Activity paramActivity, J paramJ, ViewGroup paramViewGroup)
  {
    super(paramActivity);
    this.b = paramJ;
    this.a = new WeakReference(paramViewGroup);
    setLayoutParams(new ViewGroup.LayoutParams(0, 0));
    this.e = new Point();
    this.d = new int[] { 0, 0 };
    getViewTreeObserver().addOnGlobalLayoutListener(this);
    setBackgroundColor(0);
  }

  private void a(View paramView)
  {
    if ((getChildCount() > 0) || (!(paramView instanceof G)))
      throw new UnsupportedOperationException();
  }

  public final void a()
  {
    b();
  }

  public final void addView(View paramView)
  {
    a(paramView);
    super.addView(paramView);
  }

  public final void addView(View paramView, int paramInt)
  {
    a(paramView);
    super.addView(paramView, paramInt);
  }

  public final void addView(View paramView, int paramInt1, int paramInt2)
  {
    a(paramView);
    super.addView(paramView, paramInt1, paramInt2);
  }

  public final void addView(View paramView, int paramInt, ViewGroup.LayoutParams paramLayoutParams)
  {
    a(paramView);
    super.addView(paramView, paramInt, paramLayoutParams);
  }

  public final void addView(View paramView, ViewGroup.LayoutParams paramLayoutParams)
  {
    a(paramView);
    super.addView(paramView, paramLayoutParams);
  }

  public final void b()
  {
    d.a().post(new Runnable()
    {
      public final void run()
      {
        if (H.this.getChildCount() > 0)
          ((G)H.this.getChildAt(0)).c().b();
        ViewParent localViewParent = H.this.getParent();
        if (localViewParent == null);
        while (!(localViewParent instanceof ViewGroup))
          return;
        ((ViewGroup)localViewParent).removeView(H.this);
      }
    });
  }

  protected final void onDraw(Canvas paramCanvas)
  {
    super.onDraw(paramCanvas);
    if (getChildCount() > 0)
      ((G)getChildAt(0)).c().a(paramCanvas);
  }

  public final void onGlobalLayout()
  {
    ViewGroup localViewGroup = (ViewGroup)this.a.get();
    if (localViewGroup == null);
    while ((getWidth() == localViewGroup.getWidth()) && (getHeight() == localViewGroup.getHeight()))
      return;
    ViewGroup.LayoutParams localLayoutParams = getLayoutParams();
    localLayoutParams.width = localViewGroup.getWidth();
    localLayoutParams.height = localViewGroup.getHeight();
    setLayoutParams(localLayoutParams);
  }

  @SuppressLint({"ClickableViewAccessibility"})
  public final boolean onTouchEvent(MotionEvent paramMotionEvent)
  {
    int i = paramMotionEvent.getAction();
    int j = 0xFF & i >> 8;
    switch (i & 0xFF)
    {
    default:
      if (this.f != null)
        break;
    case 0:
    case 2:
    case 3:
    case 1:
    }
    for (View localView1 = null; ; localView1 = (View)this.f.get())
    {
      if ((localView1 != null) && (!localView1.dispatchTouchEvent(paramMotionEvent)))
        this.f = null;
      return true;
      this.e.set((int)paramMotionEvent.getRawX(), (int)paramMotionEvent.getRawY());
      this.g = -1;
      ViewGroup localViewGroup = (ViewGroup)this.a.get();
      if (localViewGroup == null)
        return false;
      for (int k = -1 + localViewGroup.getChildCount(); ; k--)
      {
        if (k >= 0)
        {
          View localView2 = localViewGroup.getChildAt(k);
          if ((localView2 == this) || (!localView2.dispatchTouchEvent(paramMotionEvent)))
            continue;
          this.f = new WeakReference(localView2);
          if (this.c.a(localView2, this.e))
            this.g = paramMotionEvent.getPointerId(j);
        }
        if (this.g == -1)
          this.b.a();
        if (this.f != null)
          break;
        return false;
      }
      if (getChildCount() > 0)
        ((G)getChildAt(0)).c().a(paramMotionEvent, this.e);
      return true;
      if (getChildCount() > 0)
        invalidate();
      if (this.g != paramMotionEvent.getPointerId(j))
        break;
      getLocationOnScreen(this.d);
      this.e.set((int)paramMotionEvent.getX(j) + this.d[0], (int)paramMotionEvent.getY(j) + this.d[1]);
      if (this.c.a(this.e))
        break;
      while (true)
      {
        this.g = -1;
        break;
        this.g = -1;
        this.c.a();
        break;
        if (this.g == paramMotionEvent.getPointerId(j))
        {
          getLocationOnScreen(this.d);
          this.e.set((int)paramMotionEvent.getX(j) + this.d[0], (int)paramMotionEvent.getY(j) + this.d[1]);
          if (getChildCount() > 0)
          {
            if (((G)getChildAt(0)).c().a(paramMotionEvent, this.e, this.c, (View)this.f.get()))
              invalidate();
            else
              this.c.b(this.e);
          }
          else
            this.c.b(this.e);
        }
      }
    }
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.tealium.library.H
 * JD-Core Version:    0.6.2
 */