AvatarBuilderConfig.java 11.7 KB
package com.bitstrips.imoji.abv3;

import android.support.annotation.NonNull;
import android.util.Log;
import com.bitstrips.imoji.abv3.bottombar.AvatarBottomBarItem;
import com.bitstrips.imoji.abv3.bottombar.AvatarBottomBarSubCategory;
import com.bitstrips.imoji.abv3.category.AvatarCategoryDetails;
import com.bitstrips.imoji.abv3.model.AvatarAssets;
import com.bitstrips.imoji.abv3.model.AvatarBrand;
import com.bitstrips.imoji.abv3.model.AvatarCategory;
import com.bitstrips.imoji.abv3.model.AvatarMetadata;
import com.bitstrips.imoji.abv3.model.AvatarOutfit;
import com.bitstrips.imoji.abv3.model.AvatarOutfits;
import com.bitstrips.imoji.abv3.model.AvatarOutfitsData;
import com.bitstrips.imoji.abv3.model.AvatarStyleData;
import com.bitstrips.imoji.abv3.model.AvatarStyles;
import com.bitstrips.imoji.abv3.model.AvatarTraits;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class AvatarBuilderConfig
{
  public static final String CATEGORY_BEARD = "beard";
  public static final String CATEGORY_BEARD_TONE = "beard_tone";
  public static final String CATEGORY_BLUSH = "blush_tone";
  public static final String CATEGORY_BODY = "body";
  public static final String CATEGORY_BREAST = "breast";
  public static final String CATEGORY_BROW = "brow";
  public static final String CATEGORY_BROW_TONE = "brow_tone";
  public static final String CATEGORY_EYE = "eye";
  public static final String CATEGORY_EYESHADOW = "eyeshadow_tone";
  public static final String CATEGORY_FACE_PROPORTION = "face_proportion";
  public static final String CATEGORY_HAIR = "hair";
  public static final String CATEGORY_HAIR_ACCESSORY = "hair_accessory";
  public static final String CATEGORY_HAIR_TONE = "hair_tone";
  public static final String CATEGORY_HAIR_TREATMENT_TONE = "hair_treatment_tone";
  public static final String CATEGORY_HAT = "hat";
  public static final String CATEGORY_JAW = "jaw";
  public static final String CATEGORY_LIKENESS = "likeness";
  public static final String CATEGORY_LIPSTICK = "lipstick_tone";
  public static final String CATEGORY_MOUTH = "mouth";
  public static final String CATEGORY_OUTFIT = "outfit";
  public static final String CATEGORY_SAVE = "save";
  public static final String CATEGORY_SKIN_TONE = "skin_tone";
  public static final String DISPLAY_TYPE_BODY = "body";
  public static final String DISPLAY_TYPE_BODY_FIXED = "body-fixed";
  public static final String DISPLAY_TYPE_COLOR = "color";
  public static final String DISPLAY_TYPE_EYE_COLOR = "eye-color";
  public static final String DISPLAY_TYPE_HEAD = "head";
  public static final String DISPLAY_TYPE_MAKEUP = "makeup";
  public static final String DISPLAY_TYPE_THUMBNAIL = "thumbnail";
  public static final String PARAM_GENDER = "gender";
  public static final String PARAM_STYLE = "style";
  public static final int ROTATION_CENTER = 0;
  public static final int ROTATION_LEFT = 7;
  public static final int ROTATION_RIGHT = 1;
  private static final Set<String> a;
  private final AvatarBuilderGender b;
  private final AvatarBuilderStyle c;
  private final boolean d;
  private final boolean e;
  private final AvatarAssets f;
  private final AvatarTraits g;
  private AvatarOutfits h;
  private final AvatarBuilderFlow i;
  private final AvatarBuilderFlow j;
  private final AvatarBuilderFlow k;
  private final Map<String, Integer> l;
  private List<AvatarBrand> m;
  private Map<String, AvatarCategory> n;
  private String o;
  
  static
  {
    HashSet localHashSet = new HashSet();
    a = localHashSet;
    localHashSet.add("save");
    a.add("likeness");
    a.add("outfit");
  }
  
  public AvatarBuilderConfig(@NonNull AvatarBuilderGender paramAvatarBuilderGender, @NonNull AvatarBuilderStyle paramAvatarBuilderStyle, boolean paramBoolean1, boolean paramBoolean2, String paramString, @NonNull AvatarBuilderFlow paramAvatarBuilderFlow1, AvatarBuilderFlow paramAvatarBuilderFlow2, AvatarBuilderFlow paramAvatarBuilderFlow3, @NonNull AvatarAssets paramAvatarAssets, @NonNull Map<String, Integer> paramMap)
  {
    this.b = paramAvatarBuilderGender;
    this.c = paramAvatarBuilderStyle;
    this.d = paramBoolean1;
    this.e = paramBoolean2;
    this.o = paramString;
    this.f = paramAvatarAssets;
    this.l = paramMap;
    this.g = this.f.mTraits;
    this.h = this.f.mOutfits;
    paramAvatarBuilderGender = this.g.mMale;
    paramAvatarBuilderStyle = this.h.mMaleOutfitsData;
    if (this.b == AvatarBuilderGender.GENDER_FEMALE)
    {
      paramAvatarBuilderGender = this.g.mFemale;
      paramAvatarBuilderStyle = this.h.mFemaleOutfitsData;
    }
    for (;;)
    {
      paramString = paramAvatarBuilderGender.mBitmoji;
      if (this.c == AvatarBuilderStyle.STYLE_BITSTRIPS) {
        paramAvatarBuilderGender = paramAvatarBuilderGender.mBitstrips;
      }
      for (;;)
      {
        this.n = new HashMap();
        paramAvatarBuilderGender = paramAvatarBuilderGender.mCategories.iterator();
        for (;;)
        {
          if (paramAvatarBuilderGender.hasNext())
          {
            paramString = (AvatarCategory)paramAvatarBuilderGender.next();
            this.n.put(paramString.getCategoryKey(), paramString);
            continue;
            if (this.c != AvatarBuilderStyle.STYLE_CM) {
              break label259;
            }
            paramAvatarBuilderGender = paramAvatarBuilderGender.mCM;
            break;
          }
        }
        this.m = paramAvatarBuilderStyle.mBrands;
        a();
        this.i = a(paramAvatarBuilderFlow1, this.n);
        this.j = a(paramAvatarBuilderFlow2, this.n);
        this.k = a(paramAvatarBuilderFlow3, this.n);
        return;
        label259:
        paramAvatarBuilderGender = paramString;
      }
    }
  }
  
  private static AvatarBuilderFlow a(AvatarBuilderFlow paramAvatarBuilderFlow, Map<String, AvatarCategory> paramMap)
  {
    if (paramAvatarBuilderFlow == null) {
      return null;
    }
    ArrayList localArrayList1 = new ArrayList();
    ArrayList localArrayList2 = new ArrayList();
    Iterator localIterator1 = paramAvatarBuilderFlow.getBottomBarItems().iterator();
    while (localIterator1.hasNext())
    {
      AvatarBottomBarItem localAvatarBottomBarItem = (AvatarBottomBarItem)localIterator1.next();
      ArrayList localArrayList3 = new ArrayList();
      Iterator localIterator2 = localAvatarBottomBarItem.getSubCategories().iterator();
      while (localIterator2.hasNext())
      {
        Object localObject = (AvatarBottomBarSubCategory)localIterator2.next();
        String str = ((AvatarBottomBarSubCategory)localObject).getCategoryKey();
        if ((a.contains(str)) || (paramMap.get(str) != null))
        {
          localArrayList3.add(localObject);
          localObject = paramAvatarBuilderFlow.getCategoryDetailsList().iterator();
          while (((Iterator)localObject).hasNext())
          {
            AvatarCategoryDetails localAvatarCategoryDetails = (AvatarCategoryDetails)((Iterator)localObject).next();
            if (localAvatarCategoryDetails.getCategoryKey().equals(str)) {
              localArrayList1.add(localAvatarCategoryDetails);
            }
          }
        }
      }
      if (!localArrayList3.isEmpty()) {
        localArrayList2.add(new AvatarBottomBarItem(localAvatarBottomBarItem.getIconResource(), localArrayList3));
      }
    }
    return new AvatarBuilderFlow(localArrayList1, localArrayList2);
  }
  
  private void a()
  {
    Iterator localIterator1 = this.m.iterator();
    while (localIterator1.hasNext())
    {
      AvatarBrand localAvatarBrand = (AvatarBrand)localIterator1.next();
      Iterator localIterator2 = localAvatarBrand.getOutfitList().iterator();
      while (localIterator2.hasNext()) {
        ((AvatarOutfit)localIterator2.next()).setBrand(localAvatarBrand);
      }
    }
  }
  
  public AvatarCategory getAvatarCategory(@NonNull String paramString)
  {
    return (AvatarCategory)this.n.get(paramString);
  }
  
  public List<AvatarBottomBarItem> getBodyBottomBarItems()
  {
    if (this.k.getBottomBarItems() == null) {
      return null;
    }
    return Collections.unmodifiableList(this.k.getBottomBarItems());
  }
  
  public List<AvatarCategoryDetails> getBodyCategoryDetails()
  {
    if (this.k.getCategoryDetailsList() == null) {
      return null;
    }
    return Collections.unmodifiableList(this.k.getCategoryDetailsList());
  }
  
  @NonNull
  public List<AvatarBottomBarItem> getBottomBarItems()
  {
    return this.i.getBottomBarItems();
  }
  
  public ArrayList<String> getCategoriesForSpinner()
  {
    Log.e("AvatarBuilderConfig", "This method is not available in Avatar Builder V3");
    return null;
  }
  
  public AvatarCategoryDetails getCategoryDetails(@NonNull String paramString)
  {
    Iterator localIterator = this.i.getCategoryDetailsList().iterator();
    while (localIterator.hasNext())
    {
      AvatarCategoryDetails localAvatarCategoryDetails = (AvatarCategoryDetails)localIterator.next();
      if (localAvatarCategoryDetails.getCategoryKey().equals(paramString)) {
        return localAvatarCategoryDetails;
      }
    }
    return null;
  }
  
  @NonNull
  public List<AvatarCategoryDetails> getCategoryDetails()
  {
    return Collections.unmodifiableList(this.i.getCategoryDetailsList());
  }
  
  public List<AvatarCategoryDetails> getCategoryDetailsFull()
  {
    Log.e("AvatarBuilderConfig", "This method is not available in Avatar Builder V3");
    return null;
  }
  
  @NonNull
  public AvatarBuilderGender getGender()
  {
    return this.b;
  }
  
  public Map<String, Integer> getInitialUserAvatarData()
  {
    return Collections.unmodifiableMap(this.l);
  }
  
  public List<AvatarBrand> getOutfits()
  {
    return Collections.unmodifiableList(this.m);
  }
  
  public String getStartCategory()
  {
    return this.o;
  }
  
  @NonNull
  public AvatarBuilderStyle getStyle()
  {
    return this.c;
  }
  
  public List<AvatarBottomBarItem> getTweakBottomBarItems()
  {
    if (this.j.getBottomBarItems() == null) {
      return null;
    }
    return Collections.unmodifiableList(this.j.getBottomBarItems());
  }
  
  public List<AvatarCategoryDetails> getTweakCategoryDetails()
  {
    if (this.j.getCategoryDetailsList() == null) {
      return null;
    }
    return Collections.unmodifiableList(this.j.getCategoryDetailsList());
  }
  
  public Integer getUserOption(String paramString)
  {
    return (Integer)this.l.get(paramString);
  }
  
  public boolean isColourlessBeard(Integer paramInteger)
  {
    if ((this.g.mMetadata == null) || (this.g.mMetadata.mColourlessBeards == null)) {}
    while ((!this.g.mMetadata.mColourlessBeards.contains(paramInteger)) && (paramInteger != null)) {
      return false;
    }
    return true;
  }
  
  public boolean isColourlessHair(Integer paramInteger)
  {
    if ((this.g.mMetadata == null) || (this.g.mMetadata.mColourlessHair == null)) {
      return false;
    }
    return this.g.mMetadata.mColourlessHair.contains(paramInteger);
  }
  
  public boolean isHairTreatmentHair(Integer paramInteger)
  {
    if ((this.g.mMetadata == null) || (this.g.mMetadata.mHairTreatmentMap == null)) {
      return false;
    }
    return this.g.mMetadata.mHairTreatmentMap.containsKey(String.valueOf(paramInteger));
  }
  
  public boolean isLiplessMouth(Integer paramInteger)
  {
    if ((this.g.mMetadata == null) || (this.g.mMetadata.mLiplessMouths == null)) {
      return false;
    }
    return this.g.mMetadata.mLiplessMouths.contains(paramInteger);
  }
  
  public boolean showTopSaveButton()
  {
    return this.d;
  }
  
  public boolean showTopSaveButtonDialog()
  {
    return this.e;
  }
}


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