package com.google.android.m4b.maps.bl;

import android.content.res.Resources;
import com.google.android.m4b.maps.R.color;
import com.google.android.m4b.maps.R.dimen;
import com.google.android.m4b.maps.R.drawable;
import com.google.android.m4b.maps.an.h;
import com.google.android.m4b.maps.ba.f;
import com.google.android.m4b.maps.ba.i;
import com.google.android.m4b.maps.bc.ae;
import com.google.android.m4b.maps.bc.af;
import com.google.android.m4b.maps.bo.e;
import com.google.android.m4b.maps.bp.g;
import com.google.android.m4b.maps.bp.k;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Maps;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.microedition.khronos.opengles.GL10;

public final class ac extends d
  implements b, c
{
  private static final float b = 2.0F;
  private static com.google.android.m4b.maps.bp.a w;
  private final Resources c;
  private final boolean d;
  private int e;
  private volatile aj f;
  private final Map<Integer, com.google.android.m4b.maps.bo.l> g = Maps.newHashMap();
  private List<a> h;
  private h i;
  private a j;
  private final ae k = new ae();
  private final ae l = new ae();
  private final ae m = new ae();
  private boolean n = false;
  private volatile com.google.android.m4b.maps.aj.c o;
  private volatile boolean p = true;
  private float q;
  private float r;
  private float s;
  private final int t;
  private float u;
  private final af v = new af();

  static
  {
    com.google.android.m4b.maps.bp.a locala = new com.google.android.m4b.maps.bp.a(4);
    w = locala;
    locala.b(1931574222, 4);
  }

  public ac(Resources paramResources, o paramo, boolean paramBoolean)
  {
    super(paramo);
    this.c = paramResources;
    this.d = paramBoolean;
    a[] arrayOfa = new a[2];
    arrayOfa[0] = new ac.a.a().a(true).a().a(R.drawable.chevron).a(paramResources.getColor(R.color.accuracy_circle_line_color), paramResources.getColor(R.color.accuracy_circle_fill_color)).c();
    arrayOfa[1] = new ac.a.a().a(false).b().a(R.drawable.blue_dot).a(paramResources.getColor(R.color.accuracy_circle_line_color), paramResources.getColor(R.color.accuracy_circle_fill_color)).c();
    a(arrayOfa);
    this.q = 64.0F;
    this.r = 0.5F;
    this.s = 0.5F;
    this.t = this.c.getDimensionPixelSize(R.dimen.dav_my_location_bubble_y_offset);
    this.i = new h();
  }

  private a a(boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3)
  {
    try
    {
      Iterator localIterator = this.h.iterator();
      a locala;
      boolean bool;
      do
      {
        if (!localIterator.hasNext())
          break;
        locala = (a)localIterator.next();
        bool = locala.a(paramBoolean1, paramBoolean2, paramBoolean3);
      }
      while (!bool);
      while (true)
      {
        return locala;
        locala = null;
      }
    }
    finally
    {
    }
  }

  private com.google.android.m4b.maps.bo.l a(e parame, int paramInt)
  {
    try
    {
      com.google.android.m4b.maps.bo.l locall = (com.google.android.m4b.maps.bo.l)this.g.get(Integer.valueOf(paramInt));
      if (locall == null)
      {
        locall = new com.google.android.m4b.maps.bo.l(parame);
        locall.c(true);
        locall.a(this.c, paramInt);
        this.g.put(Integer.valueOf(paramInt), locall);
      }
      return locall;
    }
    finally
    {
    }
  }

  private void a(a[] paramArrayOfa)
  {
    try
    {
      this.h = ImmutableList.copyOf(paramArrayOfa);
      k();
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  private void b(e parame, com.google.android.m4b.maps.bn.b paramb, j paramj)
  {
    while (true)
    {
      GL10 localGL10;
      a locala1;
      try
      {
        if (this.m.c() > 0)
        {
          if (this.j == null)
          {
            this.j = new a(null, 0, 0, 0, null, "MyLocation");
            this.j.a(2.0F);
          }
          this.j.a(this.m.d(), 2 * this.m.c());
          a locala2 = n();
          this.j.b(locala2.f);
          this.j.c(locala2.g);
          this.j.a(parame, paramb, paramj);
        }
        float f1 = paramb.a(this.m.a(), true);
        float f2 = paramb.a(this.q, f1) * this.u;
        localGL10 = parame.x();
        an.a(parame, paramb, this.m.a(), f2);
        parame.p();
        parame.g.d(parame);
        parame.c.d(parame);
        locala1 = n();
        int i1;
        if (locala1.c != locala1.b)
        {
          i1 = 1;
          localGL10.glBlendFunc(1, 771);
          localGL10.glTexEnvx(8960, 8704, 7681);
          localGL10.glColor4x(65536, 65536, 65536, 65536);
          if (locala1.d != 0)
          {
            localGL10.glTexEnvx(8960, 8704, 8448);
            a(parame, locala1.d).a(localGL10);
            float f3 = 1.0F + 10.0F * this.m.h();
            float f4 = 1.0F - 3.0F * this.m.h();
            float f5 = 4.0F * this.m.h();
            float f6 = -4.0F * this.m.h();
            localGL10.glColor4f(f4, f4, f4, f4);
            localGL10.glTranslatef(f5, f6, 0.0F);
            localGL10.glScalef(f3, f3, f3);
            localGL10.glDrawArrays(5, 0, 4);
            localGL10.glScalef(1.0F / f3, 1.0F / f3, 1.0F / f3);
            localGL10.glTranslatef(-f5, -f6, 0.0F);
            localGL10.glColor4x(65536, 65536, 65536, 65536);
            localGL10.glTexEnvx(8960, 8704, 7681);
          }
          if (this.m.h() != 0.0F)
            localGL10.glTranslatef(0.0F, 0.0F, this.m.h() * (float)this.m.a().e());
          if ((this.m.e()) && (locala1.e != 0))
          {
            localGL10.glRotatef(-this.m.b(), 0.0F, 0.0F, 1.0F);
            localGL10.glScalef(2.0F, 2.0F, 2.0F);
            a(parame, locala1.e).a(localGL10);
            localGL10.glDrawArrays(5, 0, 4);
            localGL10.glScalef(0.5F, 0.5F, 0.5F);
            localGL10.glRotatef(this.m.b(), 0.0F, 0.0F, 1.0F);
          }
          if (n().a)
          {
            localGL10.glRotatef(-this.m.b(), 0.0F, 0.0F, 1.0F);
            if ((i1 == 0) || (this.m.j() != 1.0F))
              break label719;
            a(parame, locala1.c).a(localGL10);
            localGL10.glDrawArrays(5, 0, 4);
          }
        }
        else
        {
          i1 = 0;
          continue;
        }
        localGL10.glRotatef(-paramb.j(), 0.0F, 0.0F, 1.0F);
        localGL10.glRotatef(paramb.k(), 1.0F, 0.0F, 0.0F);
        continue;
      }
      finally
      {
      }
      label719: a(parame, locala1.b).a(localGL10);
    }
  }

  private void k()
  {
    try
    {
      Iterator localIterator = this.g.values().iterator();
      while (localIterator.hasNext())
        ((com.google.android.m4b.maps.bo.l)localIterator.next()).f();
    }
    finally
    {
    }
    this.g.clear();
  }

  private ae l()
  {
    try
    {
      ae localae = this.k;
      return localae;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  private a n()
  {
    try
    {
      ae localae = l();
      boolean bool1 = localae.e();
      boolean bool2 = localae.g();
      boolean bool3 = localae.i();
      return a(bool1, bool3, bool2);
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public final int a(float paramFloat1, float paramFloat2, com.google.android.m4b.maps.bn.b paramb)
  {
    try
    {
      if (!this.k.k())
        return 2147483647;
      int[] arrayOfInt = paramb.b(this.k.a());
      return (int)((paramFloat1 - arrayOfInt[0]) * (paramFloat1 - arrayOfInt[0]) + (paramFloat2 - arrayOfInt[1]) * (paramFloat2 - arrayOfInt[1]));
    }
    finally
    {
    }
  }

  public final int a(com.google.android.m4b.maps.bn.b paramb)
  {
    return this.e;
  }

  public final void a()
  {
  }

  public final void a(float paramFloat, int paramInt1, int paramInt2)
  {
    this.q = (0.5F * paramFloat);
    this.r = (paramInt1 / 100.0F);
    this.s = (paramInt2 / 100.0F);
  }

  public final void a(ae paramae)
  {
    try
    {
      if ((this.k.k() != paramae.k()) || (!Objects.equal(this.k.f(), paramae.f())) || (this.k.g() != paramae.g()))
        this.p = true;
      this.k.a(paramae);
      if (this.k.k())
        this.i.b(this.k);
      while (true)
      {
        if (this.f != null)
          this.f.a(false, false);
        return;
        this.i = new h();
      }
    }
    finally
    {
    }
  }

  public final void a(e parame)
  {
    k();
    this.p = true;
  }

  public final void a(e parame, aj paramaj)
  {
    this.f = paramaj;
  }

  public final void a(e parame, com.google.android.m4b.maps.bn.b paramb, j paramj)
  {
    if ((paramj.b() > 0) || (!this.k.k()))
      return;
    while (true)
    {
      try
      {
        this.e = 0;
        if ((this.e != 0) && (this.i.a(this.l)) && (this.l.k()))
        {
          this.m.a(this.l);
          parame.a(200L + parame.e());
          if (this.m.k())
            break;
          return;
        }
      }
      finally
      {
      }
      this.m.a(this.k);
    }
    GL10 localGL10 = parame.x();
    localGL10.glPushMatrix();
    com.google.android.m4b.maps.aj.c localc = this.o;
    ah localah = null;
    if (localc != null)
    {
      localah = paramj.c().a(this.o.a());
      if (localah != null)
        localah.a(parame, paramb, paramj, this.m.a());
    }
    b(parame, paramb, paramj);
    if (localah != null)
      localah.a(parame, paramj);
    localGL10.glPopMatrix();
  }

  public final void a(List<l> paramList, float paramFloat1, float paramFloat2, af paramaf, com.google.android.m4b.maps.bn.b paramb, int paramInt)
  {
    if (this.d)
    {
      int i1 = a(paramFloat1, paramFloat2, paramb);
      if (i1 < paramInt)
        paramList.add(new l(this, this, i1));
    }
  }

  public final boolean a(com.google.android.m4b.maps.bn.b paramb, e parame)
  {
    float f1 = 0.8F;
    af localaf = c();
    if (localaf != null)
      o.a(paramb, localaf, 0, Math.round(this.t * this.u), this.v);
    float f2 = paramb.l();
    if (f2 >= 14.0F)
      f1 = 1.0F;
    while (true)
    {
      this.u = f1;
      return true;
      if (f2 >= 10.0F)
        f1 += 0.05F * (f2 - 10.0F);
    }
  }

  public final boolean b(com.google.android.m4b.maps.bn.b paramb)
  {
    af localaf = c();
    if (localaf == null)
      return false;
    int[] arrayOfInt = paramb.b(localaf);
    if (n().a);
    for (float f1 = this.s; ; f1 = this.r)
    {
      int i1 = (int)Math.ceil(f1 * (this.q * this.u));
      int i2 = arrayOfInt[0] - i1;
      int i3 = i1 + arrayOfInt[0];
      int i4 = arrayOfInt[1] - i1;
      int i5 = i1 + arrayOfInt[1];
      if ((i2 >= paramb.e()) || (i3 < 0) || (i4 >= paramb.f()) || (i5 < 0))
        break;
      return true;
    }
    return false;
  }

  public final boolean b(List<ag> paramList)
  {
    if (this.p)
    {
      this.p = false;
      this.o = f();
      com.google.android.m4b.maps.aj.c localc = this.o;
      f localf = null;
      if (localc != null)
        localf = i.a().d(this.o.a());
      paramList.clear();
      if ((this.o == null) || (localf == null))
        return super.b(paramList);
      paramList.add(a(ag.a.i, new ah[] { localf }));
      return true;
    }
    return false;
  }

  public final af c()
  {
    try
    {
      af localaf = this.k.a();
      return localaf;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public final r.a d()
  {
    return r.a.p;
  }

  public final com.google.android.m4b.maps.bn.c e()
  {
    return null;
  }

  public final com.google.android.m4b.maps.aj.c f()
  {
    try
    {
      com.google.android.m4b.maps.aj.c localc = l().f();
      return localc;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public final void i_()
  {
  }

  public final af j_()
  {
    return this.v;
  }

  public final boolean k_()
  {
    return this.d;
  }

  public final b m()
  {
    return this;
  }

  public static final class a
  {
    public final boolean a;
    public final int b;
    public final int c;
    public final int d;
    public final int e;
    public final int f;
    public final int g;
    private final Boolean h;
    private final Boolean i;
    private final Boolean j;

    public a(Boolean paramBoolean1, Boolean paramBoolean2, Boolean paramBoolean3, boolean paramBoolean, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6)
    {
      this.h = paramBoolean1;
      this.i = paramBoolean2;
      this.j = paramBoolean3;
      this.a = paramBoolean;
      this.b = paramInt1;
      this.c = paramInt2;
      this.d = paramInt3;
      this.e = paramInt4;
      this.f = paramInt5;
      this.g = paramInt6;
    }

    public final boolean a(boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3)
    {
      if ((this.h != null) && (this.h.booleanValue() != paramBoolean1));
      while (((this.i != null) && (this.i.booleanValue() != paramBoolean2)) || ((this.j != null) && (this.j.booleanValue() != paramBoolean3)))
        return false;
      return true;
    }

    public static final class a
    {
      private Boolean a;
      private Integer b;
      private Integer c;
      private boolean d;
      private int e;
      private int f;

      public final a a()
      {
        this.d = true;
        return this;
      }

      public final a a(int paramInt)
      {
        this.b = Integer.valueOf(paramInt);
        this.c = Integer.valueOf(paramInt);
        return this;
      }

      public final a a(int paramInt1, int paramInt2)
      {
        this.e = paramInt1;
        this.f = paramInt2;
        return this;
      }

      public final a a(boolean paramBoolean)
      {
        this.a = Boolean.valueOf(paramBoolean);
        return this;
      }

      public final a b()
      {
        this.d = false;
        return this;
      }

      public final ac.a c()
      {
        if (this.c != null);
        for (boolean bool = true; ; bool = false)
        {
          Preconditions.checkState(bool, "Texture ID must be specified.");
          return new ac.a(this.a, null, null, this.d, this.b.intValue(), this.c.intValue(), 0, 0, this.e, this.f);
        }
      }
    }
  }
}

/* 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.bl.ac
 * JD-Core Version:    0.6.2
 */