Skip to content
This repository was archived by the owner on Jul 10, 2020. It is now read-only.
/ FABsMenu Public archive

Commit 82dde5d

Browse files
leinardijahirfiquitiva
authored andcommitted
Fix for #30 (#31)
* Fix for #30: Attribute fabSize ignored * Fix gradlew permission
1 parent adc2c5d commit 82dde5d

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

gradlew

100644100755
File mode changed.

library/src/main/java/jahirfiquitiva/libs/fabsmenu/TitleFAB.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public TitleFAB(Context context, AttributeSet attrs, int defStyle) {
8282
}
8383

8484
void init(Context context, AttributeSet attributeSet) {
85+
int fabSize = TitleFAB.SIZE_MINI;
8586
TypedArray attr =
8687
context.obtainStyledAttributes(attributeSet, R.styleable.TitleFAB, 0, 0);
8788
try {
@@ -97,13 +98,14 @@ void init(Context context, AttributeSet attributeSet) {
9798
titleTextPadding =
9899
attr.getDimensionPixelSize(R.styleable.TitleFAB_fab_title_textPadding,
99100
(int) DimensionUtils.convertDpToPixel(8, context));
101+
fabSize = attr.getInt(R.styleable.TitleFAB_fabSize, fabSize);
100102
} catch (Exception e) {
101103
Log.w(TAG, "Failure reading attributes", e);
102104
} finally {
103105
attr.recycle();
104106
}
105107
setOnClickListener(null);
106-
setSize(FloatingActionButton.SIZE_MINI);
108+
setSize(fabSize);
107109
}
108110

109111
@Override

library/src/main/res/values/attrs.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
<attr name="fab_title_textPadding" format="dimension"/>
2929
<attr name="fab_title_cornerRadius" format="dimension"/>
3030
<attr name="fab_enableTitleClick" format="boolean"/>
31+
<attr name="fabSize" format="enum">
32+
<enum name="auto" value="-1"/>
33+
<enum name="normal" value="0"/>
34+
<enum name="mini" value="1"/>
35+
</attr>
36+
3137
</declare-styleable>
3238

3339
<declare-styleable name="FABsMenu">
@@ -59,4 +65,4 @@
5965
<enum name="right" value="3"/>
6066
</attr>
6167
</declare-styleable>
62-
</resources>
68+
</resources>

0 commit comments

Comments
 (0)