package com.google.android.m4b.maps.bj;

import android.content.Context;
import android.util.FloatMath;
import android.view.MotionEvent;

public final class aa
{
  private final a a;
  private float b;
  private float c;
  private float d;
  private float e;
  private float f;
  private float g;
  private float h;
  private boolean i;

  public aa(Context paramContext, a parama)
  {
    this.a = parama;
  }

  public final float a()
  {
    return this.b;
  }

  public final boolean a(MotionEvent paramMotionEvent)
  {
    int j = paramMotionEvent.getActionMasked();
    if ((j == 1) || (j == 3));
    for (int k = 1; (j == 0) || (k != 0); k = 0)
    {
      if (this.i)
      {
        this.a.c(this);
        this.i = false;
        this.f = 0.0F;
      }
      if (k == 0)
        break;
      return true;
    }
    int m;
    int n;
    if ((j == 6) || (j == 5))
    {
      m = 1;
      if (j != 6)
        break label160;
      n = 1;
      label86: if (n == 0)
        break label166;
    }
    int i2;
    float f1;
    float f2;
    label160: label166: for (int i1 = paramMotionEvent.getActionIndex(); ; i1 = -1)
    {
      i2 = paramMotionEvent.getPointerCount();
      f1 = 0.0F;
      f2 = 0.0F;
      for (int i3 = 0; i3 < i2; i3++)
        if (i1 != i3)
        {
          f2 += paramMotionEvent.getX(i3);
          f1 += paramMotionEvent.getY(i3);
        }
      m = 0;
      break;
      n = 0;
      break label86;
    }
    if (n != 0);
    float f3;
    float f4;
    float f5;
    float f6;
    for (int i4 = i2 - 1; ; i4 = i2)
    {
      f3 = f2 / i4;
      f4 = f1 / i4;
      f5 = 0.0F;
      f6 = 0.0F;
      for (int i5 = 0; i5 < i2; i5++)
        if (i1 != i5)
        {
          f6 += Math.abs(paramMotionEvent.getX(i5) - f3);
          f5 += Math.abs(paramMotionEvent.getY(i5) - f4);
        }
    }
    float f7 = f6 / i4;
    float f8 = f5 / i4;
    float f9 = f7 * 2.0F;
    float f10 = f8 * 2.0F;
    float f11 = FloatMath.sqrt(f9 * f9 + f10 * f10);
    boolean bool1 = this.i;
    this.b = f3;
    this.c = f4;
    if ((this.i) && ((f11 == 0.0F) || (m != 0)))
    {
      this.a.c(this);
      this.i = false;
      this.f = f11;
    }
    if (m != 0)
    {
      this.g = f9;
      this.h = f10;
      this.d = f11;
      this.e = f11;
      this.f = f11;
    }
    if ((!this.i) && (f11 != 0.0F) && ((bool1) || (Math.abs(f11 - this.f) > -1.0F)))
    {
      this.g = f9;
      this.h = f10;
      this.d = f11;
      this.e = f11;
      this.i = this.a.b(this);
    }
    if (j == 2)
    {
      this.g = f9;
      this.h = f10;
      this.d = f11;
      boolean bool2 = true;
      if (this.i)
        bool2 = this.a.a(this);
      if (bool2)
        this.e = this.d;
    }
    return true;
  }

  public final float b()
  {
    return this.c;
  }

  public final float c()
  {
    return this.d;
  }

  public final float d()
  {
    return this.e;
  }

  public static abstract interface a
  {
    public abstract boolean a(aa paramaa);

    public abstract boolean b(aa paramaa);

    public abstract void c(aa paramaa);
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.google.android.m4b.maps.bj.aa
 * JD-Core Version:    0.6.2
 */