package com.google.android.m4b.maps.ao;

import android.content.res.Resources;
import android.os.Handler;
import android.os.RemoteException;
import android.util.DisplayMetrics;
import com.google.android.m4b.maps.bc.af;
import com.google.android.m4b.maps.bl.ad;
import com.google.android.m4b.maps.bl.ap;
import com.google.android.m4b.maps.bl.ap.e;
import com.google.android.m4b.maps.bl.g;
import com.google.android.m4b.maps.bn.c;
import com.google.android.m4b.maps.bu.cb;
import com.google.android.m4b.maps.bu.j;
import com.google.android.m4b.maps.bu.j.a;
import com.google.android.m4b.maps.model.CameraPosition;
import com.google.android.m4b.maps.model.LatLng;
import com.google.android.m4b.maps.model.LatLngBounds;
import com.google.android.m4b.maps.model.RuntimeRemoteException;
import com.google.android.m4b.maps.r.e;
import com.google.android.m4b.maps.r.n;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import java.util.Collection;

public class a
  implements ad, ap.e, g, j
{
  private static final double b;
  private final v c;
  private final w d;
  private final Handler e;
  private e f;
  private n g;
  private Collection<n> h;
  private int i;

  static
  {
    if (!a.class.desiredAssertionStatus());
    for (boolean bool = true; ; bool = false)
    {
      j = bool;
      b = 1.0D / Math.log(2.0D);
      return;
    }
  }

  public a(w paramw, v paramv, Handler paramHandler)
  {
    this.d = paramw;
    this.c = paramv;
    this.e = paramHandler;
    this.c.a(this);
    this.c.a(this);
    this.c.a(this);
  }

  @VisibleForTesting
  private static int a(int paramInt)
  {
    if (paramInt == -1)
      return 330;
    return Math.max(0, paramInt);
  }

  private static c a(LatLngBounds paramLatLngBounds, double paramDouble1, double paramDouble2, double paramDouble3)
  {
    double d1 = 256.0D * paramDouble3;
    af localaf1 = b.b(paramLatLngBounds.northeast);
    af localaf2 = b.b(paramLatLngBounds.southwest);
    if (localaf1.f() < localaf2.f());
    for (int k = 1073741824 - localaf2.f() + localaf1.f(); ; k = localaf1.f() - localaf2.f())
    {
      int m = localaf1.g() - localaf2.g();
      double d2 = 30.0D - Math.log(Math.max(d1 * k / paramDouble1, d1 * m / paramDouble2)) * b;
      return new c(new af((localaf2.f() + k / 2) % 1073741824, localaf2.g() + m / 2), (float)d2, 0.0F, 0.0F, 0.0F);
    }
  }

  @VisibleForTesting
  private static int b(int paramInt)
  {
    if (paramInt == -1)
      return -1;
    return Math.max(0, paramInt);
  }

  private e e()
  {
    e locale = this.f;
    this.f = null;
    return locale;
  }

  public final float a(LatLng paramLatLng)
  {
    return this.c.a(b.b(paramLatLng));
  }

  public final CameraPosition a(LatLngBounds paramLatLngBounds)
  {
    return b.a(a(paramLatLngBounds, this.d.getWidth() - this.c.a(), this.d.getHeight() - this.c.b(), this.d.getResources().getDisplayMetrics().density));
  }

  public final void a()
  {
    if (this.i == 0);
    for (boolean bool = true; ; bool = false)
    {
      Preconditions.checkState(bool, "Camera stopped during a cancellation");
      this.c.a(0.0F, 0.0F);
      return;
    }
  }

  public final void a(float paramFloat1, float paramFloat2, int paramInt)
  {
    c localc = ap.a(this.c.c(), this.d.t(), paramFloat1, paramFloat2);
    int k = b(paramInt);
    this.c.a(localc, k, k);
  }

  public final void a(float paramFloat, int paramInt)
  {
    this.c.a(paramFloat, a(paramInt));
  }

  public final void a(float paramFloat, int paramInt1, int paramInt2, int paramInt3)
  {
    this.c.a(paramFloat, paramInt1, paramInt2, a(paramInt3));
  }

  public final void a(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    this.c.a(paramInt1, paramInt2, paramInt3, paramInt4);
  }

  public final void a(final c paramc)
  {
    this.e.post(new Runnable()
    {
      public final void run()
      {
        a.a(a.this, b.a(a.a(a.this).a(paramc, -1.0F)));
      }
    });
  }

  public final void a(j.a parama, int paramInt, e parame, cb paramcb)
  {
    boolean bool1 = true;
    boolean bool2;
    if ((paramInt != 0) || (parame == null))
    {
      bool2 = bool1;
      Preconditions.checkArgument(bool2, "Callback supplied with instantaneous camera movement");
      if (this.i != 0)
        break label75;
    }
    while (true)
    {
      Preconditions.checkState(bool1, "Camera moved during a cancellation");
      parama.a(this, paramInt, paramcb);
      if ((j) || (this.i == 0))
        break label81;
      throw new AssertionError();
      bool2 = false;
      break;
      label75: bool1 = false;
    }
    label81: this.f = parame;
  }

  public final void a(CameraPosition paramCameraPosition, int paramInt)
  {
    int k = b(paramInt);
    this.c.a(new c(b.a(paramCameraPosition.target), paramCameraPosition.zoom, paramCameraPosition.tilt, paramCameraPosition.bearing, 0.0F), k, k);
  }

  public final void a(LatLng paramLatLng, float paramFloat, int paramInt)
  {
    c localc1 = this.c.c();
    c localc2 = new c(b.a(paramLatLng), paramFloat, localc1.d(), localc1.e(), localc1.f());
    int k = b(paramInt);
    this.c.a(localc2, k, k);
  }

  public final void a(LatLng paramLatLng, int paramInt)
  {
    c localc1 = this.c.c();
    c localc2 = new c(b.a(paramLatLng), localc1.a(), localc1.d(), localc1.e(), localc1.f());
    int k = b(paramInt);
    this.c.a(localc2, k, k);
  }

  public final void a(LatLngBounds paramLatLngBounds, int paramInt1, int paramInt2)
  {
    int k = this.d.getWidth();
    int m = this.d.getHeight();
    if ((k != 0) && (m != 0));
    for (boolean bool = true; ; bool = false)
    {
      Preconditions.checkState(bool, "Error using newLatLngBounds(LatLngBounds, int): Map size can't be 0. Most likely, layout has not yet occured for the map view.  Either wait until layout has occurred or use newLatLngBounds(LatLngBounds, int, int, int) which allows you to specify the map's dimensions.");
      a(paramLatLngBounds, k, m, paramInt1, paramInt2);
      return;
    }
  }

  public final void a(LatLngBounds paramLatLngBounds, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    double d1 = paramInt1;
    double d2 = paramInt2;
    double d3 = d1 - paramInt3 * 2;
    double d4 = d2 - paramInt3 * 2;
    if ((d3 > 0.0D) && (d4 > 0.0D));
    for (boolean bool = true; ; bool = false)
    {
      Preconditions.checkState(bool, "View size is too small after padding");
      c localc = a(paramLatLngBounds, d3 - this.c.a(), d4 - this.c.b(), this.d.getResources().getDisplayMetrics().density);
      int k = b(paramInt4);
      this.c.a(localc, k, k);
      return;
    }
  }

  public final void a(n paramn)
  {
    this.g = paramn;
  }

  public final void b()
  {
    if (this.f != null)
      this.i = (1 + this.i);
    try
    {
      e().b();
      return;
    }
    catch (RemoteException localRemoteException)
    {
      throw new RuntimeRemoteException(localRemoteException);
    }
    finally
    {
      this.i = (-1 + this.i);
    }
  }

  public final void b(float paramFloat, int paramInt)
  {
    float f1 = paramFloat + Math.min(a(c().target), Math.max(this.c.d(), this.c.e()));
    this.c.b(f1, a(-1));
  }

  public final void b(final c paramc)
  {
    this.e.post(new Runnable()
    {
      public final void run()
      {
        a.b(a.this, b.a(a.a(a.this).a(paramc, -1.0F)));
      }
    });
  }

  public final void b(n paramn)
  {
    if (this.h == null)
      this.h = Lists.newArrayList();
    this.h.add(paramn);
  }

  public final CameraPosition c()
  {
    return b.a(this.c.c());
  }

  public final void c(float paramFloat, int paramInt)
  {
    this.c.b(paramFloat, a(paramInt));
  }

  public final void c(n paramn)
  {
    this.h.remove(paramn);
    if (this.h.isEmpty())
      this.h = null;
  }

  public final float d()
  {
    return this.c.d();
  }
}

/* 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.ao.a
 * JD-Core Version:    0.6.2
 */