From 82dde5d2b4d840b13b935a973204ec9586637224 Mon Sep 17 00:00:00 2001 From: Roberto Leinardi Date: Sat, 31 Mar 2018 02:40:50 +0200 Subject: [PATCH] Fix for #30 (#31) * Fix for #30: Attribute fabSize ignored * Fix gradlew permission --- gradlew | 0 .../main/java/jahirfiquitiva/libs/fabsmenu/TitleFAB.java | 4 +++- library/src/main/res/values/attrs.xml | 8 +++++++- 3 files changed, 10 insertions(+), 2 deletions(-) mode change 100644 => 100755 gradlew 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 @@ + + + + + + @@ -59,4 +65,4 @@ - \ No newline at end of file +