Skip to content

Commit

Permalink
Remove unused local var. Make a code a little bit cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
esafirm committed Feb 11, 2018
1 parent 58cc739 commit 305dd0e
Showing 1 changed file with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,8 @@ private void initAttributesArray(TypedArray attrsArray) {
String iconFontFamily = attrsArray.getString(R.styleable.FancyButtonsAttrs_fb_iconFont);
String textFontFamily = attrsArray.getString(R.styleable.FancyButtonsAttrs_fb_textFont);

Drawable icon = null;
try {
mIconResource = attrsArray.getDrawable(R.styleable.FancyButtonsAttrs_fb_iconResource);

} catch (Exception e) {
mIconResource = null;
}
Expand All @@ -355,17 +353,13 @@ private void initAttributesArray(TypedArray attrsArray) {
mText = mTextAllCaps ? text.toUpperCase() : text;

if (!isInEditMode()) {
if (iconFontFamily != null) {
mIconTypeFace = Utils.findFont(mContext, iconFontFamily, mDefaultIconFont);
} else {
mIconTypeFace = Utils.findFont(mContext, mDefaultIconFont, null);
}
mIconTypeFace = iconFontFamily != null
? Utils.findFont(mContext, iconFontFamily, mDefaultIconFont)
: Utils.findFont(mContext, mDefaultIconFont, null);

if (textFontFamily != null) {
mTextTypeFace = Utils.findFont(mContext, textFontFamily, mDefaultTextFont);
} else {
mTextTypeFace = Utils.findFont(mContext, mDefaultTextFont, null);
}
mTextTypeFace = textFontFamily != null
? Utils.findFont(mContext, textFontFamily, mDefaultTextFont)
: Utils.findFont(mContext, mDefaultTextFont, null);
}
}

Expand Down

0 comments on commit 305dd0e

Please sign in to comment.