package com.ikea.kompis.extendedcontent;

import android.app.Dialog;
import android.app.DialogFragment;
import android.app.FragmentManager;
import android.content.DialogInterface;
import android.content.DialogInterface.OnKeyListener;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager.LayoutParams;
import android.widget.Button;
import android.widget.TextView;
import com.ikea.kompis.util.UiUtil;

public class WrongCountryMessageDialog extends DialogFragment
{
  private CharSequence charSequence;
  private boolean isFromWelcome;
  private View.OnClickListener listener;
  private TextView messageText;

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setRetainInstance(true);
    setCancelable(false);
  }

  public View onCreateView(LayoutInflater paramLayoutInflater, ViewGroup paramViewGroup, Bundle paramBundle)
  {
    View localView = paramLayoutInflater.inflate(2130903171, paramViewGroup, false);
    getDialog().getWindow().requestFeature(1);
    String str1 = getArguments().getString("title");
    String str2 = getArguments().getString("message");
    String str3 = getArguments().getString("primarybtn");
    String str4 = getArguments().getString("secondrybtn");
    TextView localTextView = (TextView)localView.findViewById(2131624056);
    this.messageText = ((TextView)localView.findViewById(2131624057));
    Button localButton1 = (Button)localView.findViewById(2131624078);
    Button localButton2 = (Button)localView.findViewById(2131624079);
    if ((str3 != null) && (str3.length() > 0))
    {
      localButton1.setText(str3);
      if ((str4 == null) || (str4.length() <= 0))
        break label237;
      localButton2.setText(str4);
      label156: if ((str1 == null) || (str1.length() <= 0))
        break label247;
      localTextView.setText(str1);
      label176: if ((str2 == null) || (str2.length() <= 0))
        break label257;
      this.messageText.setText(str2);
    }
    while (true)
    {
      localButton1.setOnClickListener(new View.OnClickListener()
      {
        public void onClick(View paramAnonymousView)
        {
          if (WrongCountryMessageDialog.this.listener != null)
            WrongCountryMessageDialog.this.listener.onClick(paramAnonymousView);
          WrongCountryMessageDialog.this.getDialog().dismiss();
        }
      });
      localButton2.setOnClickListener(new View.OnClickListener()
      {
        public void onClick(View paramAnonymousView)
        {
          WrongCountryMessageDialog.this.dismiss();
        }
      });
      return localView;
      localButton1.setVisibility(8);
      break;
      label237: localButton2.setVisibility(8);
      break label156;
      label247: localTextView.setVisibility(8);
      break label176;
      label257: if (this.charSequence != null)
        this.messageText.setText(this.charSequence);
      else
        this.messageText.setVisibility(8);
    }
  }

  public void onDestroyView()
  {
    if ((getDialog() != null) && (getRetainInstance()))
      getDialog().setDismissMessage(null);
    super.onDestroyView();
  }

  public void onResume()
  {
    super.onResume();
    getDialog().setOnKeyListener(new DialogInterface.OnKeyListener()
    {
      public boolean onKey(DialogInterface paramAnonymousDialogInterface, int paramAnonymousInt, KeyEvent paramAnonymousKeyEvent)
      {
        if (paramAnonymousInt == 4)
        {
          if ((!WrongCountryMessageDialog.this.isFromWelcome) && (WrongCountryMessageDialog.this.listener != null))
            WrongCountryMessageDialog.this.listener.onClick(WrongCountryMessageDialog.this.getView());
          WrongCountryMessageDialog.this.dismiss();
          return true;
        }
        return false;
      }
    });
  }

  public void onStart()
  {
    WindowManager.LayoutParams localLayoutParams = new WindowManager.LayoutParams();
    localLayoutParams.copyFrom(getDialog().getWindow().getAttributes());
    if (UiUtil.isTablet(getActivity()))
      localLayoutParams.width = ((int)getResources().getDimension(2131362059));
    for (localLayoutParams.height = -2; ; localLayoutParams.height = -2)
    {
      getDialog().getWindow().setAttributes(localLayoutParams);
      super.onStart();
      return;
      localLayoutParams.width = -1;
    }
  }

  public void setTitle(CharSequence paramCharSequence)
  {
    this.charSequence = paramCharSequence;
  }

  public void show(FragmentManager paramFragmentManager, String paramString, boolean paramBoolean, View.OnClickListener paramOnClickListener)
  {
    super.show(paramFragmentManager, paramString);
    this.listener = paramOnClickListener;
    this.isFromWelcome = paramBoolean;
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.ikea.kompis.extendedcontent.WrongCountryMessageDialog
 * JD-Core Version:    0.6.2
 */