BaseOnboardingFragment.java 3.58 KB
package com.bitstrips.imoji.onboarding.gboard;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import com.bitstrips.imoji.ImojiApplication;
import com.bitstrips.imoji.analytics.Action;
import com.bitstrips.imoji.analytics.Category;
import com.bitstrips.imoji.analytics.LegacyAnalyticsService;
import com.bitstrips.imoji.analytics.performance.AnalyticsLabelKey;
import com.bitstrips.imoji.util.PreferenceUtils;
import com.crashlytics.android.Crashlytics;
import java.util.HashMap;
import javax.inject.Inject;

public class BaseOnboardingFragment
  extends Fragment
{
  @Inject
  PreferenceUtils a;
  @Inject
  LegacyAnalyticsService b;
  private boolean c = false;
  private boolean d = false;
  
  protected static Bundle createArguments(GboardOnboardingSource paramGboardOnboardingSource)
  {
    Bundle localBundle = new Bundle();
    localBundle.putSerializable("source", paramGboardOnboardingSource);
    return localBundle;
  }
  
  protected boolean didSaveInstanceState()
  {
    return this.d;
  }
  
  protected void dismiss()
  {
    if (this.d)
    {
      Crashlytics.logException(new IllegalStateException("Performing action after onSaveInstanceState!"));
      return;
    }
    this.c = true;
    getFragmentManager().popBackStack(null, 1);
  }
  
  protected void finish()
  {
    GboardOnboardingSource localGboardOnboardingSource = getSource();
    HashMap localHashMap = new HashMap(1);
    localHashMap.put(AnalyticsLabelKey.GBOARD_ONBOARDING_SOURCE, localGboardOnboardingSource.toString());
    this.b.sendEvent(Category.GBOARD_ONBOARDING, Action.GBOARD_ONBOARDING_FINISH, localHashMap);
    this.a.putBoolean(2131231240, true);
  }
  
  protected GboardOnboardingSource getSource()
  {
    return (GboardOnboardingSource)getArguments().getSerializable("source");
  }
  
  public void onCreate(@Nullable Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    ((ImojiApplication)getContext().getApplicationContext()).inject(this);
  }
  
  public Animation onCreateAnimation(int paramInt1, boolean paramBoolean, int paramInt2)
  {
    if (this.c) {
      return AnimationUtils.loadAnimation(getContext(), 2130968611);
    }
    return super.onCreateAnimation(paramInt1, paramBoolean, paramInt2);
  }
  
  public void onResume()
  {
    super.onResume();
    this.d = false;
  }
  
  public void onSaveInstanceState(Bundle paramBundle)
  {
    super.onSaveInstanceState(paramBundle);
    this.d = true;
  }
  
  protected void sendLowStorageEvent()
  {
    HashMap localHashMap = new HashMap(1);
    localHashMap.put(AnalyticsLabelKey.GBOARD_ONBOARDING_SOURCE, getSource().toString());
    this.b.sendEvent(Category.GBOARD_ONBOARDING, Action.GBOARD_ONBOARDING_LOW_STORAGE, localHashMap);
  }
  
  protected void skip(String paramString)
  {
    GboardOnboardingSource localGboardOnboardingSource = getSource();
    HashMap localHashMap = new HashMap(2);
    localHashMap.put(AnalyticsLabelKey.GBOARD_ONBOARDING_SKIP_STEP, paramString);
    localHashMap.put(AnalyticsLabelKey.GBOARD_ONBOARDING_SOURCE, localGboardOnboardingSource.toString());
    this.b.sendEvent(Category.GBOARD_ONBOARDING, Action.GBOARD_ONBOARDING_SKIP, localHashMap);
    this.a.putBoolean(2131231240, true);
    dismiss();
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/com/bitstrips/imoji/onboarding/gboard/BaseOnboardingFragment.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */