package com.google.android.m4b.maps;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.os.RemoteException;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import com.google.android.m4b.maps.d.c;
import com.google.android.m4b.maps.g.l;
import com.google.android.m4b.maps.j.a;
import com.google.android.m4b.maps.j.d;
import com.google.android.m4b.maps.j.e;
import com.google.android.m4b.maps.model.RuntimeRemoteException;
import com.google.android.m4b.maps.r.ad.a;
import com.google.android.m4b.maps.r.ag;
import com.google.android.m4b.maps.r.ai;
import com.google.android.m4b.maps.r.am;
import com.google.android.m4b.maps.r.aq;
import com.google.android.m4b.maps.r.f;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class StreetViewPanoramaView extends FrameLayout
{
  private final b a;
  private StreetViewPanorama b;

  public StreetViewPanoramaView(Context paramContext)
  {
    super(paramContext);
    this.a = new b(this, paramContext, null);
  }

  public StreetViewPanoramaView(Context paramContext, AttributeSet paramAttributeSet)
  {
    super(paramContext, paramAttributeSet);
    this.a = new b(this, paramContext, null);
  }

  public StreetViewPanoramaView(Context paramContext, AttributeSet paramAttributeSet, int paramInt)
  {
    super(paramContext, paramAttributeSet, paramInt);
    this.a = new b(this, paramContext, null);
  }

  public StreetViewPanoramaView(Context paramContext, StreetViewPanoramaOptions paramStreetViewPanoramaOptions)
  {
    super(paramContext);
    this.a = new b(this, paramContext, paramStreetViewPanoramaOptions);
  }

  @Deprecated
  public final StreetViewPanorama getStreetViewPanorama()
  {
    if (this.b != null)
      return this.b;
    this.a.g();
    if (this.a.a() == null)
      return null;
    try
    {
      this.b = new StreetViewPanorama(((a)this.a.a()).f().a());
      return this.b;
    }
    catch (RemoteException localRemoteException)
    {
      throw new RuntimeRemoteException(localRemoteException);
    }
  }

  public void getStreetViewPanoramaAsync(OnStreetViewPanoramaReadyCallback paramOnStreetViewPanoramaReadyCallback)
  {
    l.b("getStreetViewPanoramaAsync() must be called on the main thread");
    this.a.a(paramOnStreetViewPanoramaReadyCallback);
  }

  public final void onCreate(Bundle paramBundle)
  {
    this.a.a(paramBundle);
    if (this.a.a() == null)
      a.a(this);
  }

  public final void onDestroy()
  {
    this.a.e();
  }

  public final void onLowMemory()
  {
    this.a.f();
  }

  public final void onPause()
  {
    this.a.c();
  }

  public final void onResume()
  {
    this.a.b();
  }

  public final void onSaveInstanceState(Bundle paramBundle)
  {
    this.a.b(paramBundle);
  }

  static final class a
    implements aq
  {
    private final ViewGroup a;
    private final ai b;
    private View c;

    public a(ViewGroup paramViewGroup, ai paramai)
    {
      this.b = ((ai)l.a(paramai));
      this.a = ((ViewGroup)l.a(paramViewGroup));
    }

    public final View a(LayoutInflater paramLayoutInflater, ViewGroup paramViewGroup, Bundle paramBundle)
    {
      throw new UnsupportedOperationException("onCreateView not allowed on StreetViewPanoramaViewDelegate");
    }

    public final void a()
    {
      try
      {
        this.b.b();
        return;
      }
      catch (RemoteException localRemoteException)
      {
        throw new RuntimeRemoteException(localRemoteException);
      }
    }

    public final void a(Activity paramActivity, Bundle paramBundle1, Bundle paramBundle2)
    {
      throw new UnsupportedOperationException("onInflate not allowed on StreetViewPanoramaViewDelegate");
    }

    public final void a(Bundle paramBundle)
    {
      try
      {
        this.b.a(paramBundle);
        this.c = ((View)d.a(this.b.f()));
        this.a.removeAllViews();
        this.a.addView(this.c);
        return;
      }
      catch (RemoteException localRemoteException)
      {
        throw new RuntimeRemoteException(localRemoteException);
      }
    }

    public final void a(final OnStreetViewPanoramaReadyCallback paramOnStreetViewPanoramaReadyCallback)
    {
      try
      {
        this.b.a(new ad.a()
        {
          public final void a(ag paramAnonymousag)
          {
            paramOnStreetViewPanoramaReadyCallback.onStreetViewPanoramaReady(new StreetViewPanorama(paramAnonymousag));
          }
        });
        return;
      }
      catch (RemoteException localRemoteException)
      {
        throw new RuntimeRemoteException(localRemoteException);
      }
    }

    public final void b()
    {
      try
      {
        this.b.c();
        return;
      }
      catch (RemoteException localRemoteException)
      {
        throw new RuntimeRemoteException(localRemoteException);
      }
    }

    public final void b(Bundle paramBundle)
    {
      try
      {
        this.b.b(paramBundle);
        return;
      }
      catch (RemoteException localRemoteException)
      {
        throw new RuntimeRemoteException(localRemoteException);
      }
    }

    public final void c()
    {
      throw new UnsupportedOperationException("onDestroyView not allowed on StreetViewPanoramaViewDelegate");
    }

    public final void d()
    {
      try
      {
        this.b.d();
        return;
      }
      catch (RemoteException localRemoteException)
      {
        throw new RuntimeRemoteException(localRemoteException);
      }
    }

    public final void e()
    {
      try
      {
        this.b.e();
        return;
      }
      catch (RemoteException localRemoteException)
      {
        throw new RuntimeRemoteException(localRemoteException);
      }
    }

    public final ai f()
    {
      return this.b;
    }
  }

  static final class b extends a<StreetViewPanoramaView.a>
  {
    private final ViewGroup a;
    private final Context b;
    private e<StreetViewPanoramaView.a> c;
    private final StreetViewPanoramaOptions d;
    private final List<OnStreetViewPanoramaReadyCallback> e = new ArrayList();

    b(ViewGroup paramViewGroup, Context paramContext, StreetViewPanoramaOptions paramStreetViewPanoramaOptions)
    {
      this.a = paramViewGroup;
      this.b = paramContext;
      this.d = paramStreetViewPanoramaOptions;
    }

    public final void a(OnStreetViewPanoramaReadyCallback paramOnStreetViewPanoramaReadyCallback)
    {
      if (a() != null)
      {
        ((StreetViewPanoramaView.a)a()).a(paramOnStreetViewPanoramaReadyCallback);
        return;
      }
      this.e.add(paramOnStreetViewPanoramaReadyCallback);
    }

    protected final void a(e<StreetViewPanoramaView.a> parame)
    {
      this.c = parame;
      g();
    }

    public final void g()
    {
      if ((this.c != null) && (a() == null));
      try
      {
        ai localai = am.a(this.b).a(d.a(this.b), this.d);
        this.c.a(new StreetViewPanoramaView.a(this.a, localai));
        Iterator localIterator = this.e.iterator();
        while (localIterator.hasNext())
        {
          OnStreetViewPanoramaReadyCallback localOnStreetViewPanoramaReadyCallback = (OnStreetViewPanoramaReadyCallback)localIterator.next();
          ((StreetViewPanoramaView.a)a()).a(localOnStreetViewPanoramaReadyCallback);
        }
      }
      catch (RemoteException localRemoteException)
      {
        throw new RuntimeRemoteException(localRemoteException);
        this.e.clear();
        return;
      }
      catch (c localc)
      {
      }
    }
  }
}

/* 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.StreetViewPanoramaView
 * JD-Core Version:    0.6.2
 */