Skip to content
This repository has been archived by the owner on Jul 10, 2020. It is now read-only.

Commit

Permalink
Fix for #30 (#31)
Browse files Browse the repository at this point in the history
* Fix for #30: Attribute fabSize ignored

* Fix gradlew permission
  • Loading branch information
leinardi authored and jahirfiquitiva committed Mar 31, 2018
1 parent adc2c5d commit 82dde5d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Empty file modified gradlew
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public TitleFAB(Context context, AttributeSet attrs, int defStyle) {
}

void init(Context context, AttributeSet attributeSet) {
int fabSize = TitleFAB.SIZE_MINI;
TypedArray attr =
context.obtainStyledAttributes(attributeSet, R.styleable.TitleFAB, 0, 0);
try {
Expand All @@ -97,13 +98,14 @@ void init(Context context, AttributeSet attributeSet) {
titleTextPadding =
attr.getDimensionPixelSize(R.styleable.TitleFAB_fab_title_textPadding,
(int) DimensionUtils.convertDpToPixel(8, context));
fabSize = attr.getInt(R.styleable.TitleFAB_fabSize, fabSize);
} catch (Exception e) {
Log.w(TAG, "Failure reading attributes", e);
} finally {
attr.recycle();
}
setOnClickListener(null);
setSize(FloatingActionButton.SIZE_MINI);
setSize(fabSize);
}

@Override
Expand Down
8 changes: 7 additions & 1 deletion library/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
<attr name="fab_title_textPadding" format="dimension"/>
<attr name="fab_title_cornerRadius" format="dimension"/>
<attr name="fab_enableTitleClick" format="boolean"/>
<attr name="fabSize" format="enum">
<enum name="auto" value="-1"/>
<enum name="normal" value="0"/>
<enum name="mini" value="1"/>
</attr>

</declare-styleable>

<declare-styleable name="FABsMenu">
Expand Down Expand Up @@ -59,4 +65,4 @@
<enum name="right" value="3"/>
</attr>
</declare-styleable>
</resources>
</resources>

0 comments on commit 82dde5d

Please sign in to comment.