BehaviourPreferenceFragment.java 5.45 KB
package com.bitstrips.imoji.behaviour;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceManager;
import android.preference.PreferenceScreen;
import android.support.v4.preference.PreferenceFragment;
import android.widget.Toast;
import com.bitstrips.imoji.ImojiApplication;
import com.bitstrips.imoji.abv3.AvatarBuilderActivityMode;
import com.bitstrips.imoji.abv3.AvatarBuilderActivityV3;
import com.bitstrips.imoji.api.BitmojiApi;
import com.bitstrips.imoji.identity.AvatarManager;
import com.bitstrips.imoji.manager.StickerPacksManager;
import com.bitstrips.imoji.receivers.GboardAppIndexingUpdateReceiver;
import com.bitstrips.imoji.receivers.GboardDevAppIndexingUpdateReceiver;
import com.bitstrips.imoji.util.PreferenceUtils;
import javax.inject.Inject;
import retrofit.RetrofitError;

public class BehaviourPreferenceFragment
  extends PreferenceFragment
{
  @Inject
  PreferenceUtils a;
  @Inject
  StickerPacksManager b;
  @Inject
  BitmojiApi c;
  @Inject
  AvatarManager d;
  
  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    ((ImojiApplication)getContext().getApplicationContext()).inject(this);
    getPreferenceManager().setSharedPreferencesName(getString(2131231182));
    getPreferenceManager().setSharedPreferencesMode(0);
    addPreferencesFromResource(2131099650);
    addPreferencesFromResource(2131099649);
    addPreferencesFromResource(2131099651);
    addPreferencesFromResource(2131099654);
    addPreferencesFromResource(2131099658);
    getPreferenceScreen().findPreference(getString(2131231268)).setOnPreferenceClickListener(new Preference.OnPreferenceClickListener()
    {
      public final boolean onPreferenceClick(Preference paramAnonymousPreference)
      {
        boolean bool = false;
        if (!BehaviourPreferenceFragment.a(BehaviourPreferenceFragment.this))
        {
          Toast.makeText(BehaviourPreferenceFragment.this.getContext(), "Need to be logged in.", 0).show();
          bool = true;
        }
        return bool;
      }
    });
    getPreferenceScreen().findPreference(getString(2131231158)).setOnPreferenceClickListener(new Preference.OnPreferenceClickListener()
    {
      public final boolean onPreferenceClick(Preference paramAnonymousPreference)
      {
        paramAnonymousPreference = new Intent(BehaviourPreferenceFragment.this.getContext(), AvatarBuilderActivityV3.class);
        paramAnonymousPreference.putExtra("EXTRA_TEST_MODE", true);
        paramAnonymousPreference.putExtra("EXTRA_AVATAR_BUILDER_MODE", AvatarBuilderActivityMode.CREATE);
        BehaviourPreferenceFragment.this.startActivity(paramAnonymousPreference);
        return true;
      }
    });
    paramBundle = getPreferenceScreen().findPreference(getString(2131231174));
    if (this.d.getLegacyAvatarId() != null) {
      paramBundle.setTitle("AvatarId: " + this.d.getLegacyAvatarId());
    }
    for (;;)
    {
      getPreferenceScreen().findPreference(getString(2131231220)).setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()
      {
        public final boolean onPreferenceChange(Preference paramAnonymousPreference, Object paramAnonymousObject)
        {
          BehaviourPreferenceFragment.this.b.clear();
          return true;
        }
      });
      getPreferenceScreen().findPreference(getString(2131231341)).setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()
      {
        public final boolean onPreferenceChange(Preference paramAnonymousPreference, Object paramAnonymousObject)
        {
          BehaviourPreferenceFragment.this.b.clear();
          return true;
        }
      });
      getPreferenceScreen().findPreference(getString(2131231228)).setOnPreferenceClickListener(new Preference.OnPreferenceClickListener()
      {
        public final boolean onPreferenceClick(Preference paramAnonymousPreference)
        {
          new GboardAppIndexingUpdateReceiver().onReceive(BehaviourPreferenceFragment.this.getContext(), new Intent());
          return true;
        }
      });
      getPreferenceScreen().findPreference(getString(2131231227)).setOnPreferenceClickListener(new Preference.OnPreferenceClickListener()
      {
        public final boolean onPreferenceClick(Preference paramAnonymousPreference)
        {
          new GboardDevAppIndexingUpdateReceiver().onReceive(BehaviourPreferenceFragment.this.getContext(), new Intent());
          return true;
        }
      });
      getPreferenceScreen().findPreference(getString(2131231335)).setOnPreferenceClickListener(new Preference.OnPreferenceClickListener()
      {
        public final boolean onPreferenceClick(Preference paramAnonymousPreference)
        {
          new Thread(new Runnable()
          {
            public final void run()
            {
              try
              {
                BehaviourPreferenceFragment.this.c.getUser401();
                return;
              }
              catch (RetrofitError localRetrofitError) {}
            }
          }).start();
          return true;
        }
      });
      return;
      paramBundle.setTitle("No Avatar Id Found");
    }
  }
}


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