diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/library/src/main/java/jahirfiquitiva/libs/fabsmenu/TitleFAB.java b/library/src/main/java/jahirfiquitiva/libs/fabsmenu/TitleFAB.java index e392280..d96ed1a 100644 --- a/library/src/main/java/jahirfiquitiva/libs/fabsmenu/TitleFAB.java +++ b/library/src/main/java/jahirfiquitiva/libs/fabsmenu/TitleFAB.java @@ -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 { @@ -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 diff --git a/library/src/main/res/values/attrs.xml b/library/src/main/res/values/attrs.xml index 127a59f..604ca8d 100644 --- a/library/src/main/res/values/attrs.xml +++ b/library/src/main/res/values/attrs.xml @@ -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"> @@ -59,4 +65,4 @@ <enum name="right" value="3"/> </attr> </declare-styleable> -</resources> \ No newline at end of file +</resources>