package com.google.android.m4b.maps.bj;

import android.content.Context;
import android.content.res.Resources;
import android.os.Handler;
import android.os.Message;
import android.os.RemoteException;
import android.os.SystemClock;
import android.support.v4.view.ViewCompat;
import android.util.DisplayMetrics;
import android.util.FloatMath;
import android.view.GestureDetector.OnDoubleTapListener;
import android.view.GestureDetector.OnGestureListener;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.SurfaceView;
import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Interpolator;
import android.widget.Toast;
import com.google.android.m4b.maps.R.string;
import com.google.android.m4b.maps.ao.f;
import com.google.android.m4b.maps.bu.bn;
import com.google.android.m4b.maps.bu.bn.a;
import com.google.android.m4b.maps.bu.bn.b;
import com.google.android.m4b.maps.bu.bp;
import com.google.android.m4b.maps.bu.br.a;
import com.google.android.m4b.maps.bu.bt;
import com.google.android.m4b.maps.bu.bw;
import com.google.android.m4b.maps.bu.n;
import com.google.android.m4b.maps.model.LatLng;
import com.google.android.m4b.maps.model.RuntimeRemoteException;
import com.google.android.m4b.maps.model.StreetViewPanoramaCamera;
import com.google.android.m4b.maps.model.StreetViewPanoramaLocation;
import com.google.android.m4b.maps.model.StreetViewPanoramaOrientation;
import com.google.android.m4b.maps.r.aa;
import com.google.android.m4b.maps.r.ab;
import java.io.File;
import java.util.List;

public final class ad extends SurfaceView
  implements GestureDetector.OnDoubleTapListener, GestureDetector.OnGestureListener, u.b, x.g, z, bt
{
  private Integer A;
  private int B;
  private float C;
  private float D;
  private float E;
  private String F;
  private Toast G;
  private boolean H = true;
  private boolean I = true;
  private boolean J = true;
  private final Handler K = new Handler();
  private Runnable L;
  private final Handler M = new Handler()
  {
    public final void handleMessage(Message paramAnonymousMessage)
    {
      switch (paramAnonymousMessage.what)
      {
      default:
        throw new IllegalArgumentException("Unknown message id " + paramAnonymousMessage.what);
      case 0:
        ad localad = ad.this;
        if (paramAnonymousMessage.arg1 != 0);
        for (boolean bool = true; ; bool = false)
        {
          ad.a(localad, bool, (q)paramAnonymousMessage.obj);
          return;
        }
      case 1:
        return;
      case 2:
        ad.this.c(paramAnonymousMessage.arg1);
        return;
      case 3:
      }
      ad.this.b();
    }
  };
  private final Object N = new Object();
  private a O = null;
  private float P;
  private float Q;
  private float R;
  private float S;
  private boolean T;
  private float a;
  private final af b = null;
  private x c;
  private u d;
  private String e;
  private m f;
  private t g;
  private boolean h;
  private q i;
  private r j;
  private bw k;
  private LatLng l;
  private bw m;
  private float n;
  private float o;
  private ac p;
  private ab q;
  private br.a r;
  private aa s;
  private com.google.android.m4b.maps.r.ac t;
  private boolean u = true;
  private int v = 0;
  private boolean w = false;
  private g x;
  private b y;
  private int z;

  private ad(Context paramContext)
  {
    super(paramContext);
    DisplayMetrics localDisplayMetrics = getContext().getResources().getDisplayMetrics();
    this.a = localDisplayMetrics.density;
    new StringBuilder("SV ScreenDensity: ").append(this.a).append(", DPI: ").append(localDisplayMetrics.densityDpi);
    this.m = new bw();
    this.j = new r(50);
    this.y = new b();
    this.p = new ac(paramContext, this, this, this);
    this.p.a(false);
    this.x = new g();
  }

  public static ad a(Context paramContext, n paramn)
  {
    f.a(paramContext, paramn);
    ad localad = new ad(paramContext);
    localad.d = new u(new h(3, paramContext.getCacheDir().getAbsolutePath(), 100));
    localad.T = false;
    localad.setFocusable(true);
    localad.setFocusableInTouchMode(true);
    localad.setClickable(true);
    if (localad.c != null)
      throw new IllegalArgumentException("mRenderer already exists");
    u localu = localad.d;
    localad.c = new x(localu);
    localad.c.a(localad.getContext(), localad.getHolder(), localad, localad);
    localad.x.a(localad.c);
    ViewCompat.setAccessibilityDelegate(localad, localad.c.e());
    localad.requestFocus();
    localad.w = true;
    return localad;
  }

  private void a(float paramFloat)
  {
    try
    {
      b(paramFloat, 0.0F);
      l();
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  private void a(MotionEvent paramMotionEvent)
  {
    int i1 = this.x.c(paramMotionEvent.getX(), paramMotionEvent.getY());
    t localt;
    if ((i1 != -1) && (i1 != -2))
    {
      this.v = 0;
      localt = this.c.d(i1);
      if (localt != null)
      {
        if ((localt.c != null) && (localt.c.length() != 0))
          break label77;
        Toast.makeText(getContext(), R.string.panorama_disabled, 0).show();
      }
    }
    return;
    label77: this.h = false;
    this.e = null;
    this.f = null;
    this.g = localt;
    new StringBuilder("SV step to panorama ").append(this.g.c);
    this.F = null;
    this.c.a(-1.0F, -1.0F);
    this.i.y.a();
    b.b localb = this.i.y.a(localt.c);
    if (localb != null)
    {
      x.i locali = new x.i(localb.a, localb.b, this.m, 1000);
      locali.a(this.i.y);
      this.c.a(locali);
    }
    while (true)
    {
      a(localt.c, null, null, this.m);
      return;
      this.w = true;
    }
  }

  private void a(q paramq)
  {
    if ((paramq != null) && (this.w))
    {
      String str = paramq.h;
      if ((this.i != null) && (this.i.y != null) && (!this.i.h.equals(str)))
      {
        this.w = false;
        this.i.y.a();
        b.b localb = this.i.y.a(str);
        if ((localb != null) && (this.c != null))
        {
          x.i locali = new x.i(localb.a, localb.b, m(), 1000);
          locali.a(this.i.y);
          this.c.a(locali);
        }
      }
    }
    this.i = paramq;
    if ((this.i != null) && (this.i.y != null))
      this.i.y.a();
    if (this.c != null)
      this.c.a(this.i);
    if (this.i != null)
    {
      this.j.a(paramq);
      n();
      this.g = null;
      this.e = null;
      this.f = null;
    }
  }

  private void b(float paramFloat)
  {
    try
    {
      f(paramFloat);
      l();
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  private void b(float paramFloat1, float paramFloat2)
  {
    if (!this.I)
      return;
    this.m.a(bp.a(this.m.b() + paramFloat1 * this.m.f()));
    f(paramFloat2);
  }

  private final void b(int paramInt1, int paramInt2)
  {
    this.M.sendMessage(Message.obtain(this.M, paramInt1, paramInt2, 0));
  }

  private void b(String paramString, LatLng paramLatLng, Integer paramInteger, bw parambw)
  {
    this.h = false;
    this.g = null;
    this.e = paramString;
    if (paramLatLng != null);
    for (m localm = new m(paramLatLng.latitude, paramLatLng.longitude); ; localm = null)
    {
      this.f = localm;
      this.A = paramInteger;
      this.l = null;
      this.k = parambw;
      invalidate();
      return;
    }
  }

  private void c(float paramFloat)
  {
    d(paramFloat);
    l();
  }

  private void d(float paramFloat)
  {
    if (this.H)
      this.m.a(paramFloat, -1 + this.B);
  }

  private static float e(float paramFloat)
  {
    return 0.5F - 0.005555556F * paramFloat;
  }

  private void f(float paramFloat)
  {
    if (!this.I)
      return;
    float f1 = 0.125F * this.m.f();
    float f2 = f1 + e(this.i.w);
    float f3 = e(this.i.v) - f1;
    if (f2 > f3)
    {
      f3 = 0.5F * (f3 + f2);
      f2 = f3;
    }
    float f4 = this.m.c() + f1 * paramFloat;
    this.m.b(bp.a(f4, f2, f3));
  }

  private void l()
  {
    if (this.c != null)
    {
      this.c.a(new bw(this.m));
      this.M.sendMessage(Message.obtain(this.M, 3));
    }
  }

  private bw m()
  {
    if (this.m == null)
      return this.k;
    return this.m;
  }

  private void n()
  {
    if (this.k != null)
    {
      this.m = this.k;
      this.k = null;
      f2 = getWidth();
      f3 = getHeight();
      this.C = (f2 / f3);
      this.D = x.a(this.C);
      this.E = x.b(this.C);
      f4 = bp.d(0.005555556F * (this.i.e / f3 * this.D));
      this.B = Math.min(this.i.j, 2 + Math.max(0, (int)f4));
      if (this.c != null)
        this.c.a(this.B);
      this.u = false;
      b(0.0F, 0.0F);
      c(0.0F);
    }
    while (this.w)
    {
      float f2;
      float f3;
      float f4;
      return;
    }
    float f5;
    int i2;
    float f7;
    label203: float f9;
    float f10;
    if (this.g != null)
    {
      f5 = (1.0F / 1.0F);
      float f6 = this.g.a;
      if (this.i != null)
      {
        t[] arrayOft = this.i.x;
        if (arrayOft != null)
        {
          int i1 = arrayOft.length;
          i2 = 0;
          f7 = 0.0F;
          if (i2 >= i1)
            break label294;
          float f8 = 180.0F + (arrayOft[i2].a - f6);
          f9 = f8 - 360.0F * FloatMath.floor(0.002777778F * f8) - 180.0F;
          f10 = Math.abs(f9);
          if ((f10 > 25.0F) || (f10 > f5))
            break label353;
        }
      }
    }
    for (float f11 = f10; ; f11 = f5)
    {
      i2++;
      f5 = f11;
      f7 = f9;
      break label203;
      f7 = 0.0F;
      label294: float f1 = f7 + this.m.b();
      while (true)
      {
        this.m = new bw(f1, 0.5F, this.m.e());
        break;
        if (this.i != null)
          f1 = this.i.s;
        else
          f1 = 0.0F;
      }
      label353: f9 = f7;
    }
  }

  private CharSequence o()
  {
    String str2;
    if (this.i == null)
      str2 = "";
    String str1;
    do
    {
      return str2;
      if (this.i.a)
        return null;
      if (this.i.b())
        return null;
      str1 = this.i.m;
      str2 = this.i.l;
      if (str1 != null)
        break;
    }
    while (str2 != null);
    return "";
    if (str2 == null)
      return str1;
    return String.format(getContext().getString(R.string.street_range_name_format), new Object[] { str1, str2 });
  }

  private boolean p()
  {
    return (this.i != null) && (this.c != null);
  }

  public final StreetViewPanoramaOrientation a(int paramInt1, int paramInt2)
  {
    if (this.i == null);
    float[] arrayOfFloat;
    do
    {
      return null;
      arrayOfFloat = this.c.a(paramInt1, paramInt2, false);
    }
    while (arrayOfFloat == null);
    return new StreetViewPanoramaOrientation(bp.m(arrayOfFloat[1]) - 90.0F, bp.m(arrayOfFloat[0]));
  }

  // ERROR //
  public final void a()
  {
    // Byte code:
    //   0: iconst_0
    //   1: istore_1
    //   2: iload_1
    //   3: iconst_5
    //   4: if_icmpge +36 -> 40
    //   7: aload_0
    //   8: ldc_w 590
    //   11: invokespecial 511	com/google/android/m4b/maps/bj/ad:c	(F)V
    //   14: aload_0
    //   15: monitorenter
    //   16: aload_0
    //   17: ldc2_w 591
    //   20: invokevirtual 596	java/lang/Object:wait	(J)V
    //   23: aload_0
    //   24: monitorexit
    //   25: iinc 1 1
    //   28: goto -26 -> 2
    //   31: astore_3
    //   32: aload_0
    //   33: monitorexit
    //   34: aload_3
    //   35: athrow
    //   36: astore_2
    //   37: goto -14 -> 23
    //   40: return
    //
    // Exception table:
    //   from	to	target	type
    //   16	23	31	finally
    //   23	25	31	finally
    //   16	23	36	java/lang/InterruptedException
  }

  public final void a(float paramFloat1, float paramFloat2)
  {
    try
    {
      b(paramFloat1, paramFloat2);
      l();
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public final void a(int paramInt)
  {
    b(1, (int)(2000.0D + 0.8D * paramInt));
  }

  public final void a(br.a parama)
  {
    this.r = parama;
  }

  public final void a(bw parambw)
  {
    if (this.m != null)
      if (this.m.equals(parambw))
        break label35;
    label35: for (boolean bool = true; ; bool = false)
    {
      this.u = bool;
      this.m = parambw;
      l();
      return;
    }
  }

  public final void a(LatLng paramLatLng)
  {
    this.w = true;
    b(null, paramLatLng, null, m());
  }

  public final void a(LatLng paramLatLng, int paramInt)
  {
    this.w = true;
    b(null, paramLatLng, Integer.valueOf(paramInt), m());
  }

  public final void a(StreetViewPanoramaCamera paramStreetViewPanoramaCamera, final long paramLong)
  {
    bw localbw1 = com.google.android.m4b.maps.ao.b.a(paramStreetViewPanoramaCamera);
    if (this.L != null)
      this.K.removeCallbacks(this.L);
    localbw1.c(bp.a(localbw1.e(), 0.0F, this.B));
    if (paramLong == 0L)
    {
      a(localbw1);
      return;
    }
    final bw localbw2 = m();
    final float f1 = bp.b(localbw1.b(), localbw2.b());
    float f2 = localbw1.c() - localbw2.c();
    final float f3 = localbw1.e() - localbw2.e();
    this.L = new Runnable()
    {
      public final void run()
      {
        long l = SystemClock.uptimeMillis() - this.a;
        float f1 = paramLong.getInterpolation((float)l / (float)localbw2);
        float f2 = bp.c(f1.c() + f1 * f3);
        bw localbw = new bw(bp.a(f1.b() + f1 * this.f), f2, f1.e() + f1 * this.g);
        ad.this.a(localbw);
        if (l < localbw2)
        {
          ad.c(ad.this).postDelayed(this, 16L);
          return;
        }
        ad.c(ad.this).removeCallbacks(ad.d(ad.this));
        ad.a(ad.this, null);
      }
    };
    this.K.post(this.L);
  }

  public final void a(StreetViewPanoramaCamera paramStreetViewPanoramaCamera, String paramString)
  {
    if (!paramString.equals(""))
    {
      a(paramString, null, null, com.google.android.m4b.maps.ao.b.a(paramStreetViewPanoramaCamera));
      return;
    }
    a(com.google.android.m4b.maps.ao.b.a(paramStreetViewPanoramaCamera));
  }

  public final void a(aa paramaa)
  {
    this.s = paramaa;
  }

  public final void a(ab paramab)
  {
    this.q = paramab;
  }

  public final void a(com.google.android.m4b.maps.r.ac paramac)
  {
    this.t = paramac;
  }

  public final void a(String paramString)
  {
    this.w = true;
    b(paramString, null, null, m());
  }

  public final void a(String paramString, LatLng paramLatLng, Integer paramInteger, bw parambw)
  {
    b(paramString, paramLatLng, paramInteger, parambw);
  }

  public final void a(boolean paramBoolean)
  {
    this.H = paramBoolean;
  }

  public final void a(boolean paramBoolean, q paramq)
  {
    if (paramBoolean);
    for (int i1 = 1; ; i1 = 0)
    {
      this.M.sendMessage(Message.obtain(this.M, 0, i1, 0, paramq));
      if ((paramq == null) && (this.w))
        b(2, -2);
      return;
    }
  }

  public final boolean a(y paramy)
  {
    if (this.H)
    {
      float[] arrayOfFloat = this.c.a(paramy.a(), paramy.b(), false);
      if (arrayOfFloat == null)
        return false;
      float f1 = arrayOfFloat[0];
      float f2 = arrayOfFloat[1];
      float f3 = bp.l(this.m.b());
      float f4 = this.m.c() / 2.0F;
      float f5 = this.m.f();
      this.R = f1;
      this.S = f2;
      this.P = (bp.f(bp.c(f3, f1)) / bp.f(f5 * bp.l(this.E / 2.0F)));
      this.Q = (bp.f(bp.c(f4, f2)) / bp.f(f5 * bp.l(this.D / 2.0F)));
      d((paramy.c() - paramy.d()) / 180.0F / this.a);
      float f6 = this.m.f();
      float f7 = this.R + bp.g(this.P * bp.f(f6 * bp.l(this.E / 2.0F)));
      float f8 = this.S + bp.g(this.Q * bp.f(f6 * bp.l(this.D / 2.0F)));
      this.m.a(bp.m(f7));
      this.m.b(f8 * 2.0F);
      l();
    }
    return true;
  }

  final void b()
  {
    if ((this.s != null) && (this.u));
    try
    {
      this.s.a(com.google.android.m4b.maps.ao.b.a(this.m));
      this.u = true;
      return;
    }
    catch (RemoteException localRemoteException)
    {
      throw new RuntimeRemoteException(localRemoteException);
    }
  }

  public final void b(int paramInt)
  {
    b(2, -2);
  }

  public final void b(boolean paramBoolean)
  {
    this.I = paramBoolean;
  }

  public final void c()
  {
    if (this.c != null)
      this.c.a();
  }

  final void c(int paramInt)
  {
    if (paramInt == -2)
      while (true)
      {
        try
        {
          if (com.google.android.m4b.maps.bu.b.a(getContext()))
          {
            if ((this.i == null) || (this.i.i == null))
              setContentDescription(getContext().getResources().getString(R.string.YOUR_LOCATION) + ": invalid point");
          }
          else
          {
            if (this.r != null)
            {
              if (this.i == null)
                break label184;
              str = this.i.k;
              this.r.a(str, e());
            }
            if (this.q != null)
              this.q.a(e());
            this.w = false;
            return;
          }
          bn localbn = new bn(this.i.i, 21.0F);
          localbn.a(new bn.a()
          {
            public final void a(bn paramAnonymousbn)
            {
              if (paramAnonymousbn.j() > 0)
              {
                bn.b localb = paramAnonymousbn.a(0);
                String str = ad.this.getContext().getResources().getString(R.string.YOUR_LOCATION) + ": " + localb.a();
                ad.this.setContentDescription(str);
              }
            }
          });
          com.google.android.m4b.maps.ak.h.a().c(localbn);
          continue;
        }
        catch (RemoteException localRemoteException)
        {
          throw new RuntimeRemoteException(localRemoteException);
        }
        label184: String str = "";
      }
  }

  public final void c(boolean paramBoolean)
  {
    this.J = paramBoolean;
    if (this.c != null)
    {
      this.c.b(paramBoolean);
      this.c.b();
    }
  }

  public final void d()
  {
    if (this.c != null)
      this.c.c();
  }

  public final void d(boolean paramBoolean)
  {
    if (this.c != null)
    {
      this.c.a(paramBoolean);
      this.c.b();
    }
  }

  public final boolean dispatchHoverEvent(MotionEvent paramMotionEvent)
  {
    if (this.c.e().dispatchHoverEvent(paramMotionEvent))
      return true;
    return super.dispatchHoverEvent(paramMotionEvent);
  }

  public final StreetViewPanoramaLocation e()
  {
    if (this.i == null)
      return null;
    q localq = this.i;
    return new StreetViewPanoramaLocation(com.google.android.m4b.maps.ao.b.a(localq.x), localq.i, localq.h);
  }

  public final StreetViewPanoramaCamera f()
  {
    return com.google.android.m4b.maps.ao.b.a(m());
  }

  public final boolean g()
  {
    return this.H;
  }

  public final boolean h()
  {
    return this.I;
  }

  public final boolean i()
  {
    return this.J;
  }

  public final void invalidate()
  {
    super.invalidate();
    String str;
    label104: b localb2;
    label177: label183: int i1;
    if (this.c != null)
    {
      if (this.G != null)
      {
        this.G.cancel();
        this.G = null;
      }
      int i3;
      u localu2;
      x localx;
      s locals;
      if (this.g != null)
      {
        str = this.g.c;
        if ((str == null) && (this.f == null))
          break label503;
        q localq = this.j.a(str);
        if (localq == null)
          break label322;
        localq.o = true;
        this.d.a(localq.h);
        a(localq);
        int i2 = localq.r.size();
        i3 = 0;
        if (i3 >= i2)
          break label183;
        localu2 = this.d;
        localx = this.c;
        locals = (s)localq.r.get(i3);
        if (i3 != i2 - 1)
          break label177;
      }
      for (boolean bool3 = true; ; bool3 = false)
      {
        localu2.a(localx, locals, bool3);
        i3++;
        break label104;
        str = this.e;
        break;
      }
      o();
      b localb1 = this.y;
      localb1.a = true;
      localb1.b = false;
      localb1.c = this.h;
      localb1.d = false;
      localb1.e = false;
      if ((this.i != null) && (this.g == null))
      {
        localb1.b = true;
        localb1.d = this.i.c();
        localb1.e = this.i.a;
      }
      localb2 = this.y;
      if ((!localb2.c) && (!localb2.d) && (!localb2.e))
        break label539;
      i1 = 10000;
    }
    while (true)
    {
      if (i1 != this.z)
        this.z = i1;
      return;
      label322: u localu1 = this.d;
      m localm = this.f;
      Integer localInteger = this.A;
      if (str == null);
      for (boolean bool1 = true; ; bool1 = false)
      {
        localu1.a(this, str, localm, localInteger, bool1, this.w);
        if (str != null)
        {
          this.d.a(this.c, str, 0, 0, 0, 1, false);
          this.d.a(this.c, str, 0, 0, 0, 2, false);
          this.d.a(this.c, str, 0, 0, 0, 3, false);
          this.d.a(this.c, str, 0, 0, 0, 4, false);
          this.d.a(this.c, str, 0, 0, 0, 5, false);
          this.d.a(this.c, str, 0, 0, 0, 6, false);
          this.d.a(this.c, str, 0, 0, 0, -1, true);
        }
        break;
      }
      label503: if (this.i != null)
      {
        o();
        break;
      }
      if (this.h)
        break;
      break;
      label539: boolean bool2 = localb2.a;
      i1 = 0;
      if (bool2)
        if (!localb2.b)
          i1 = 1000;
        else
          i1 = 2000;
    }
  }

  public final boolean j()
  {
    if (this.c == null)
      return false;
    return this.c.d();
  }

  public final View k()
  {
    return this;
  }

  protected final void onDetachedFromWindow()
  {
  }

  public final boolean onDoubleTap(MotionEvent paramMotionEvent)
  {
    float f1;
    float f2;
    if ((this.i.y != null) && (this.J))
    {
      f1 = paramMotionEvent.getX();
      f2 = paramMotionEvent.getY();
      if (this.i.y != null)
        break label39;
    }
    label39: float[] arrayOfFloat1;
    float[] arrayOfFloat2;
    String str;
    do
    {
      return true;
      arrayOfFloat1 = this.c.a(f1, f2, false);
      this.i.a(arrayOfFloat1[0], arrayOfFloat1[1], arrayOfFloat1);
      arrayOfFloat2 = new float[2];
      this.i.y.a();
      str = this.i.y.b(arrayOfFloat1[0], arrayOfFloat1[1], arrayOfFloat2);
    }
    while ((str == null) || (str.equals(this.i.h)));
    q localq = this.i;
    float f3 = arrayOfFloat2[0];
    float f4 = arrayOfFloat2[1];
    arrayOfFloat2[0] = (0.5F + (f3 + bp.l(localq.s)));
    arrayOfFloat2[1] = (f4 + FloatMath.cos(bp.k(arrayOfFloat2[0]) - bp.o(localq.t)) * bp.j(localq.z));
    if (!this.i.y.a(arrayOfFloat1[0], arrayOfFloat1[1]).a())
    {
      this.m.a(bp.m(bp.b(arrayOfFloat2[0])));
      this.m.b(2.0F * bp.b(arrayOfFloat2[1]));
    }
    b.b localb = this.i.y.b(arrayOfFloat1[0], arrayOfFloat1[1]);
    x.i locali = new x.i(localb.a, localb.b, this.m, 1000);
    locali.a(this.i.y);
    this.c.a(locali);
    a(str, null, null, this.m);
    return true;
  }

  public final boolean onDoubleTapEvent(MotionEvent paramMotionEvent)
  {
    return false;
  }

  public final boolean onDown(MotionEvent paramMotionEvent)
  {
    synchronized (this.N)
    {
      if (this.O != null)
        this.O.a();
      this.x.a(paramMotionEvent.getX(), paramMotionEvent.getY());
      return true;
    }
  }

  public final boolean onFling(MotionEvent paramMotionEvent1, MotionEvent paramMotionEvent2, float paramFloat1, float paramFloat2)
  {
    if (this.x.a())
      return false;
    float f3;
    float f4;
    if (this.I)
    {
      float f1 = bp.a(this.n, -2.5F, 2.5F);
      float f2 = bp.a(this.o, -2.5F, 2.5F);
      f3 = f1 * 0.8F;
      f4 = f2 * 0.5F;
    }
    synchronized (this.N)
    {
      if (this.O != null)
        this.O.a();
      this.O = new a(f3, f4);
      new Thread(this.O, "Flinger").start();
      return true;
    }
  }

  public final boolean onKeyDown(int paramInt, KeyEvent paramKeyEvent)
  {
    float f1 = 1.0F;
    boolean bool1 = true;
    boolean bool2 = p();
    boolean bool3;
    switch (paramInt)
    {
    default:
      bool1 = false;
      bool3 = false;
    case 4:
    case 19:
    case 20:
    case 21:
    case 22:
    case 23:
    case 48:
    case 35:
    case 62:
    case 45:
    }
    while (true)
      if (bool3)
      {
        if ((bool1) && (this.c != null))
          this.c.c(0);
        return bool3;
        bool3 = false;
        bool1 = false;
        continue;
        if ((bool2) && (this.I))
        {
          b(f1);
          bool3 = bool1;
          continue;
          if ((bool2) && (this.I))
          {
            b(-1.0F);
            bool3 = bool1;
            continue;
            if ((bool2) && (this.I))
            {
              a(-1.0F);
              bool3 = bool1;
              continue;
              if ((bool2) && (this.I))
              {
                a(f1);
                bool3 = bool1;
                continue;
                if ((bool2) && (this.H))
                {
                  float f2 = this.m.e();
                  if (f2 < -1 + this.B);
                  while (true)
                  {
                    c(f1);
                    bool3 = bool1;
                    bool1 = false;
                    break;
                    f1 = -f2;
                  }
                  if ((bool2) && (this.H))
                  {
                    c(-1.0F);
                    b(0.0F);
                    bool3 = bool1;
                    bool1 = false;
                    continue;
                    if (bool2)
                    {
                      n();
                      bool3 = bool1;
                      bool1 = false;
                    }
                  }
                }
              }
            }
          }
        }
      }
      else
      {
        return super.onKeyDown(paramInt, paramKeyEvent);
        bool3 = bool1;
        bool1 = false;
      }
  }

  public final void onLongPress(MotionEvent paramMotionEvent)
  {
  }

  public final boolean onScroll(MotionEvent paramMotionEvent1, MotionEvent paramMotionEvent2, float paramFloat1, float paramFloat2)
  {
    if (!p());
    while ((this.x.b(paramMotionEvent2.getX(), paramMotionEvent2.getY())) || (!this.I))
      return true;
    this.n = (0.02F * paramFloat1);
    this.o = (-0.01F * paramFloat2);
    a(paramFloat1 * this.E / getWidth(), paramFloat2 * this.D / (-22.5F * getHeight()));
    return true;
  }

  public final void onShowPress(MotionEvent paramMotionEvent)
  {
  }

  public final boolean onSingleTapConfirmed(MotionEvent paramMotionEvent)
  {
    this.v = (1 + this.v);
    if ((this.t != null) && (this.v == 3));
    try
    {
      this.t.a(a((int)paramMotionEvent.getX(), (int)paramMotionEvent.getY()));
      this.v = 0;
      return false;
    }
    catch (RemoteException localRemoteException)
    {
      throw new RuntimeRemoteException(localRemoteException);
    }
  }

  public final boolean onSingleTapUp(MotionEvent paramMotionEvent)
  {
    a(paramMotionEvent);
    return true;
  }

  protected final void onSizeChanged(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    super.onSizeChanged(paramInt1, paramInt2, paramInt3, paramInt4);
  }

  public final boolean onTouchEvent(MotionEvent paramMotionEvent)
  {
    this.v = 0;
    if (p())
    {
      if (this.L != null)
        this.K.removeCallbacks(this.L);
      this.c.c(1);
      if ((this.p.a(paramMotionEvent)) && (paramMotionEvent.getAction() == 1))
      {
        this.v = (1 + this.v);
        a(paramMotionEvent);
      }
    }
    return true;
  }

  final class a
    implements Runnable
  {
    private final boolean a;
    private float b;
    private final boolean c;
    private float d;

    a(float paramFloat1, float arg3)
    {
      boolean bool2;
      label35: Object localObject;
      if (paramFloat1 > 0.0F)
      {
        bool2 = bool1;
        this.a = bool2;
        if (!this.a)
          break label71;
        this.b = paramFloat1;
        if (localObject <= 0.0F)
          break label77;
        label46: this.c = bool1;
        if (!this.c)
          break label83;
      }
      while (true)
      {
        this.d = localObject;
        return;
        bool2 = false;
        break;
        label71: paramFloat1 = -paramFloat1;
        break label35;
        label77: bool1 = false;
        break label46;
        label83: float f = -localObject;
      }
    }

    final void a()
    {
      synchronized (ad.a(ad.this))
      {
        this.b = 0.0F;
        this.d = 0.0F;
        ad.a(ad.this).notify();
        return;
      }
    }

    public final void run()
    {
      try
      {
        while (true)
        {
          synchronized (ad.a(ad.this))
          {
            ad.a(ad.this).wait(30L);
            label23: if ((ad.b(ad.this) == null) || ((this.b <= 0.0F) && (this.d <= 0.0F)))
              break;
            ad localad = ad.this;
            if (this.a)
            {
              f1 = this.b;
              float f2 = 10.0F * f1;
              if (!this.c)
                break label153;
              f3 = this.d;
              localad.a(f2, f3);
              this.b = Math.max(0.87F * this.b - 0.005F, 0.0F);
              this.d = Math.max(0.87F * this.d - 0.005F, 0.0F);
            }
          }
          float f1 = -this.b;
          continue;
          label153: float f3 = -this.d;
        }
        return;
      }
      catch (InterruptedException localInterruptedException)
      {
        break label23;
      }
    }
  }

  public static final class b
  {
    public boolean a;
    public boolean b;
    public boolean c;
    public boolean d;
    public boolean e;
  }
}

/* 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.ad
 * JD-Core Version:    0.6.2
 */