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

Fix for #30 #31

Merged
merged 2 commits into from
Mar 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>