Skip to content

Commit

Permalink
new version 1.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
medyo committed Oct 23, 2016
1 parent 9903ece commit 8a11896
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 11 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
### Changelog

- 1.8.2
- Added ability to set disabled state color
- Added ability to disable button
- Added ability to use system font

- 1.8.1
- Fix Bug related to loading custom fonts
Expand All @@ -50,7 +51,7 @@

### Installation

compile 'com.github.medyo:fancybuttons:1.8.1'
compile 'com.github.medyo:fancybuttons:1.8.2'

### Usage

Expand Down Expand Up @@ -82,14 +83,17 @@
| fancy:fb_borderWidth | setBorderWidth(int) | Width of the border|
| fancy:fb_borderColor | setBorderColor(int) | Color of the border|
| fancy:fb_defaultColor | setBackgroundColor(int) | Background color of the button|
| fancy:fb_focusColor | setFocusBackgroundColor(int) | Focus Color of border background|
| fancy:fb_disabledColor | setDisableBackgroundColor(int) | Disable Color of border background|
| fancy:fb_focusColor | setFocusBackgroundColor(int) | Focus Color of button background|
| fancy:fb_disabledColor | setDisableBackgroundColor(int) | Disabled Color of button background|
| fancy:fb_disabledTextColor | setDisableTextColor(int) | Disabled Color of button text|
| fancy:fb_disabledBorderColor | setDisableBorderColor(int) | Disabled Color of button border|
| fancy:fb_radius | setRadius(int) | Radius of the button|
| fancy:fb_iconPaddingLeft | setIconPadding(int,int,int,int) | Icon Padding|
| fancy:fb_iconPaddingRight | setIconPadding(int,int,int,int) | Icon Padding|
| fancy:fb_iconPaddingTop | setIconPadding(int,int,int,int) | Icon Padding|
| fancy:fb_iconPaddingBottom | setIconPadding(int,int,int,int) | Icon Padding|
| fancy:fb_ghost | setGhost(boolean) | Ghost (Hollow)|
| fancy:fb_useSystemFont | setUsingSystemFont(boolean) | If enabled, the button title will ignore its custom font and use the default system font |

Also you can use Attributes with default prefix (android:) which makes migrating of your project more fast.
Default Attributes have more priority than Attributes with prefix fancy.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,33 @@ public void setDisableBackgroundColor(int color) {

}

/**
* Set Disabled state color of the button text
*
* @param color : use Color.parse('#code')
*/
public void setDisableTextColor(int color) {
this.mDisabledTextColor = color;
if(mTextView == null)
initializeFancyButton();
else if (!isEnabled())
mTextView.setTextColor(color);

}

/**
* Set Disabled state color of the button border
*
* @param color : use Color.parse('#code')
*/
public void setDisableBorderColor(int color) {
this.mDisabledBorderColor = color;
if(mIconView!=null || mFontIconView!=null || mTextView!=null){
this.setupBackground();
}

}

/**
* Set the size of Text in sp
* @param textSize : Text Size
Expand Down Expand Up @@ -630,7 +657,7 @@ public void setIconResource(Drawable drawable){
public void setIconResource(String icon){
this.mFontIcon = icon;
if(mFontIconView == null) {
mIconView=null;
mIconView = null;
initializeFancyButton();
}
else
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION_CODE=22
VERSION_CODE=23
ANDROID_BUILD_MIN_SDK_VERSION=8
ANDROID_BUILD_TARGET_SDK_VERSION=23
ANDROID_BUILD_TOOLS_VERSION=23.0.1
ANDROID_BUILD_SDK_VERSION=23
VERSION_NAME=1.8.1
VERSION_NAME=1.8.2
9 changes: 5 additions & 4 deletions samples/src/main/res/layout/activity_xml_buttons.xml
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@
android:layout_height="wrap_content" >

<mehdi.sakout.fancybuttons.FancyButton
android:id="@+id/btn_twitter"
android:id="@+id/btn_send"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
Expand All @@ -403,7 +403,7 @@
</mehdi.sakout.fancybuttons.FancyButton>

<mehdi.sakout.fancybuttons.FancyButton
android:id="@+id/btn_twitter_disabled"
android:id="@+id/btn_send_disabled"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
Expand All @@ -413,11 +413,10 @@
fancy:fb_borderWidth="2dp"
fancy:fb_defaultColor="#40a75a"
fancy:fb_focusColor="#8cc9f8"
fancy:fb_disabledColor="#c8b7b7b7"
fancy:fb_fontIconResource="@string/icon_user"
fancy:fb_fontIconSize="30sp"
fancy:fb_iconPosition="left"
fancy:fb_text="Send disabled"
fancy:fb_text="Send Disabled"
fancy:fb_radius="10dp"
fancy:fb_textColor="#FFFFFF">
</mehdi.sakout.fancybuttons.FancyButton>
Expand Down Expand Up @@ -537,6 +536,8 @@
fancy:fb_borderColor="#7ed862"
fancy:fb_text="Contact"
fancy:fb_textColor="#ffa8f192" />


</LinearLayout>

</LinearLayout>
Expand Down

0 comments on commit 8a11896

Please sign in to comment.