// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package uk.co.chrisjenx.calligraphy; import android.text.TextUtils; import android.widget.AutoCompleteTextView; import android.widget.Button; import android.widget.CheckBox; import android.widget.EditText; import android.widget.MultiAutoCompleteTextView; import android.widget.RadioButton; import android.widget.TextView; import android.widget.ToggleButton; import java.util.Collections; import java.util.HashMap; import java.util.Map; public class CalligraphyConfig { public static class Builder { public static final int INVALID_ATTR_ID = -1; private int attrId; private boolean customViewCreation; private String fontAssetPath; private boolean isFontSet; private Map mStyleClassMap; private boolean reflection; public Builder addCustomStyle(Class class1, int i) { if (class1 == null || i == 0) { return this; } else { mStyleClassMap.put(class1, Integer.valueOf(i)); return this; } } public CalligraphyConfig build() { boolean flag; if (!TextUtils.isEmpty(fontAssetPath)) { flag = true; } else { flag = false; } isFontSet = flag; return new CalligraphyConfig(this); } public Builder disableCustomViewInflation() { customViewCreation = false; return this; } public Builder disablePrivateFactoryInjection() { reflection = false; return this; } public Builder setDefaultFontPath(String s) { boolean flag; if (!TextUtils.isEmpty(s)) { flag = true; } else { flag = false; } isFontSet = flag; fontAssetPath = s; return this; } public Builder setFontAttrId(int i) { if (i == -1) { i = -1; } attrId = i; return this; } public Builder() { boolean flag; if (android.os.Build.VERSION.SDK_INT >= 11) { flag = true; } else { flag = false; } reflection = flag; customViewCreation = true; attrId = R.attr.fontPath; isFontSet = false; fontAssetPath = null; mStyleClassMap = new HashMap(); } } private static final Map DEFAULT_STYLES; private static CalligraphyConfig sInstance; private final int mAttrId; private final Map mClassStyleAttributeMap; private final boolean mCustomViewCreation; private final String mFontPath; private final boolean mIsFontSet; private final boolean mReflection; protected CalligraphyConfig(Builder builder) { mIsFontSet = builder.isFontSet; mFontPath = builder.fontAssetPath; mAttrId = builder.attrId; mReflection = builder.reflection; mCustomViewCreation = builder.customViewCreation; HashMap hashmap = new HashMap(DEFAULT_STYLES); hashmap.putAll(builder.mStyleClassMap); mClassStyleAttributeMap = Collections.unmodifiableMap(hashmap); } public static CalligraphyConfig get() { if (sInstance == null) { sInstance = new CalligraphyConfig(new Builder()); } return sInstance; } public static void initDefault(CalligraphyConfig calligraphyconfig) { sInstance = calligraphyconfig; } public int getAttrId() { return mAttrId; } Map getClassStyles() { return mClassStyleAttributeMap; } public String getFontPath() { return mFontPath; } public boolean isCustomViewCreation() { return mCustomViewCreation; } boolean isFontSet() { return mIsFontSet; } public boolean isReflection() { return mReflection; } static { DEFAULT_STYLES = new HashMap(); DEFAULT_STYLES.put(android/widget/TextView, Integer.valueOf(0x1010084)); DEFAULT_STYLES.put(android/widget/Button, Integer.valueOf(0x1010048)); DEFAULT_STYLES.put(android/widget/EditText, Integer.valueOf(0x101006e)); DEFAULT_STYLES.put(android/widget/AutoCompleteTextView, Integer.valueOf(0x101006b)); DEFAULT_STYLES.put(android/widget/MultiAutoCompleteTextView, Integer.valueOf(0x101006b)); DEFAULT_STYLES.put(android/widget/CheckBox, Integer.valueOf(0x101006c)); DEFAULT_STYLES.put(android/widget/RadioButton, Integer.valueOf(0x101007e)); DEFAULT_STYLES.put(android/widget/ToggleButton, Integer.valueOf(0x101004b)); } }