package com.google.android.m4b.maps.j;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.FrameLayout.LayoutParams;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.google.android.m4b.maps.d.d;
import java.util.Iterator;
import java.util.LinkedList;

public abstract class a<T extends c>
{
  private T a;
  private Bundle b;
  private LinkedList<a> c;
  private final e<T> d = new e()
  {
    public final void a(T paramAnonymousT)
    {
      a.a(a.this, paramAnonymousT);
      Iterator localIterator = a.a(a.this).iterator();
      while (localIterator.hasNext())
      {
        a.a locala = (a.a)localIterator.next();
        a.b(a.this);
        locala.b();
      }
      a.a(a.this).clear();
      a.a(a.this, null);
    }
  };

  private void a(int paramInt)
  {
    while ((!this.c.isEmpty()) && (((a)this.c.getLast()).a() >= paramInt))
      this.c.removeLast();
  }

  private void a(Bundle paramBundle, a parama)
  {
    if (this.a != null)
    {
      parama.b();
      return;
    }
    if (this.c == null)
      this.c = new LinkedList();
    this.c.add(parama);
    if (paramBundle != null)
    {
      if (this.b != null)
        break label77;
      this.b = ((Bundle)paramBundle.clone());
    }
    while (true)
    {
      a(this.d);
      return;
      label77: this.b.putAll(paramBundle);
    }
  }

  public static void a(FrameLayout paramFrameLayout)
  {
    Context localContext = paramFrameLayout.getContext();
    final int i = d.a(localContext);
    String str1 = d.a(localContext, i);
    String str2 = d.b(localContext, i);
    LinearLayout localLinearLayout = new LinearLayout(paramFrameLayout.getContext());
    localLinearLayout.setOrientation(1);
    localLinearLayout.setLayoutParams(new FrameLayout.LayoutParams(-2, -2));
    paramFrameLayout.addView(localLinearLayout);
    TextView localTextView = new TextView(paramFrameLayout.getContext());
    localTextView.setLayoutParams(new FrameLayout.LayoutParams(-2, -2));
    localTextView.setText(str1);
    localLinearLayout.addView(localTextView);
    if (str2 != null)
    {
      Button localButton = new Button(localContext);
      localButton.setLayoutParams(new FrameLayout.LayoutParams(-2, -2));
      localButton.setText(str2);
      localLinearLayout.addView(localButton);
      localButton.setOnClickListener(new View.OnClickListener()
      {
        public final void onClick(View paramAnonymousView)
        {
          Context localContext = this.a;
          localContext.startActivity(d.a(i));
        }
      });
    }
  }

  public final View a(final LayoutInflater paramLayoutInflater, final ViewGroup paramViewGroup, final Bundle paramBundle)
  {
    final FrameLayout localFrameLayout = new FrameLayout(paramLayoutInflater.getContext());
    a(paramBundle, new a()
    {
      public final int a()
      {
        return 2;
      }

      public final void b()
      {
        localFrameLayout.removeAllViews();
        localFrameLayout.addView(a.b(a.this).a(paramLayoutInflater, paramViewGroup, paramBundle));
      }
    });
    if (this.a == null)
      a(localFrameLayout);
    return localFrameLayout;
  }

  public final T a()
  {
    return this.a;
  }

  public final void a(final Activity paramActivity, final Bundle paramBundle1, final Bundle paramBundle2)
  {
    a(paramBundle2, new a()
    {
      public final int a()
      {
        return 0;
      }

      public final void b()
      {
        a.b(a.this).a(paramActivity, paramBundle1, paramBundle2);
      }
    });
  }

  public final void a(final Bundle paramBundle)
  {
    a(paramBundle, new a()
    {
      public final int a()
      {
        return 1;
      }

      public final void b()
      {
        a.b(a.this).a(paramBundle);
      }
    });
  }

  protected abstract void a(e<T> parame);

  public final void b()
  {
    a(null, new a()
    {
      public final int a()
      {
        return 5;
      }

      public final void b()
      {
        a.b(a.this).a();
      }
    });
  }

  public final void b(Bundle paramBundle)
  {
    if (this.a != null)
      this.a.b(paramBundle);
    while (this.b == null)
      return;
    paramBundle.putAll(this.b);
  }

  public final void c()
  {
    if (this.a != null)
    {
      this.a.b();
      return;
    }
    a(5);
  }

  public final void d()
  {
    if (this.a != null)
    {
      this.a.c();
      return;
    }
    a(2);
  }

  public final void e()
  {
    if (this.a != null)
    {
      this.a.d();
      return;
    }
    a(1);
  }

  public final void f()
  {
    if (this.a != null)
      this.a.e();
  }

  static abstract interface a
  {
    public abstract int a();

    public abstract void b();
  }
}

/* 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.j.a
 * JD-Core Version:    0.6.2
 */