package com.ikea.kompis.fragments;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils;
import com.ikea.kompis.IkeaApplication;
import com.ikea.kompis.ShoppingCartActivity;
import com.ikea.kompis.util.C.Anim;
import com.squareup.otto.Bus;
import java.lang.reflect.Field;

public class BaseFragment extends Fragment
{
  private static final String GETTING_KILLED_BY_SYSTEM = "GETTING_KILLED_BY_SYSTEM";
  private final Animation.AnimationListener mAnimatorListener = new Animation.AnimationListener()
  {
    public void onAnimationEnd(Animation paramAnonymousAnimation)
    {
      BaseFragment.this.fragmentAnimationEnd();
    }

    public void onAnimationRepeat(Animation paramAnonymousAnimation)
    {
    }

    public void onAnimationStart(Animation paramAnonymousAnimation)
    {
      BaseFragment.this.fragmentAnimationStarted();
    }
  };
  protected final Bus mBus = IkeaApplication.mBus;
  protected final Handler mHandler = new Handler();
  protected ShoppingCartActivity mParent;
  protected boolean mWasIRestoredAfterBeingKilledBySystem = false;

  protected void fragmentAnimationEnd()
  {
  }

  protected void fragmentAnimationStarted()
  {
  }

  public void onActivityCreated(@Nullable Bundle paramBundle)
  {
    super.onActivityCreated(paramBundle);
    if (paramBundle != null)
      this.mWasIRestoredAfterBeingKilledBySystem = paramBundle.getBoolean("GETTING_KILLED_BY_SYSTEM", false);
  }

  public void onAttach(Activity paramActivity)
  {
    super.onAttach(paramActivity);
    this.mParent = ((ShoppingCartActivity)paramActivity);
  }

  public Animation onCreateAnimation(int paramInt1, boolean paramBoolean, int paramInt2)
  {
    if (paramInt2 == 0)
      return null;
    Animation localAnimation = AnimationUtils.loadAnimation(getActivity(), paramInt2);
    localAnimation.setInterpolator(C.Anim.EASE_OUT_QUART_INTERPOLATOR);
    localAnimation.setAnimationListener(this.mAnimatorListener);
    return localAnimation;
  }

  public void onDetach()
  {
    super.onDetach();
    try
    {
      Field localField = Fragment.class.getDeclaredField("mChildFragmentManager");
      localField.setAccessible(true);
      localField.set(this, null);
      return;
    }
    catch (NoSuchFieldException localNoSuchFieldException)
    {
      throw new RuntimeException(localNoSuchFieldException);
    }
    catch (IllegalAccessException localIllegalAccessException)
    {
      throw new RuntimeException(localIllegalAccessException);
    }
  }

  public void onSaveInstanceState(Bundle paramBundle)
  {
    paramBundle.putBoolean("GETTING_KILLED_BY_SYSTEM", true);
    super.onSaveInstanceState(paramBundle);
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.ikea.kompis.fragments.BaseFragment
 * JD-Core Version:    0.6.2
 */