Material Fancy Button

Source link:

Material Fancy Button

README in Bahasa Indonesia :

Beautiful Fancy Button on endorphins.

Icons, Borders, Radius ... for Android buttons. With selectable 21 Icon Fonts precompiled!

No need to manually using  for icon font character anymore!


Demo Application : Download APK



compile 'com.rilixtech:materialfancybuttons:1.8.7'

Add maven to your build.gradle:

maven {

 url ""

Choose your desired icon fonts from a precompiled font list, add the font that you want to use from below list:

compile 'com.rilixtech:community-material-typeface:' compile 'com.rilixtech:devicon-typeface:' compile 'com.rilixtech:dripicons-typeface:2.0.0' compile 'com.rilixtech:entypo-typeface:' compile 'com.rilixtech:fontawesome-typeface:' compile 'com.rilixtech:foundation-icons-typeface:' compile 'com.rilixtech:glyphicons-halflings-typeface:1.0.0' compile 'com.rilixtech:google-material-typeface:' compile 'com.rilixtech:mfglabs-iconset-typeface:1.0' compile 'com.rilixtech:material-design-iconic-typeface:' compile 'com.rilixtech:meteocons-typeface:' compile 'com.rilixtech:mobirise-icons-typeface:1.0.0' compile 'com.rilixtech:ionicons-typeface:' compile 'com.rilixtech:octicons-typeface:' compile 'com.rilixtech:open-iconic-typeface:1.1.1' compile 'com.rilixtech:picol-typeface:1.0.0' compile 'com.rilixtech:pixeden-7-stroke-typeface:' compile 'com.rilixtech:themify-icons-typeface:0.1.2' compile 'com.rilixtech:typicons-typeface:' compile 'com.rilixtech:vaadin-icons-typeface:4.1.0' compile 'com.rilixtech:weather-icons-typeface:'

Icon Font List:

The following list is within this format:

  • Font Icon link
    • "Prefix", this is prefix for each icon in the font
    • compile 'com.rilixtech:...', this is the dependency to use the icon font.

Icon List:

  • Community Material

    • "cmdi"
    • compile 'com.rilixtech:community-material-typeface:'
  • Devicon

    • "devi"
    • compile 'com.rilixtech:devicon-typeface:'
  • Dripicons

    • "drpi"
    • compile 'com.rilixtech:dripicons-typeface:2.0.0'
  • Entypo

    • "enti"
    • compile 'com.rilixtech:entypo-typeface:'
  • Fontawesome

    • "fawi"
    • compile 'com.rilixtech:fontawesome-typeface:'
  • Foundation Icons

    • "foui"
    • compile 'com.rilixtech:foundation-icons-typeface:'
  • Glyphicons Halflings

    • "glyi"
    • compile 'com.rilixtech:glyphicons-halflings-typeface:1.0.0'
  • Google Material Design Icons

    • "gmdi"
    • compile 'com.rilixtech:google-material-typeface:'
  • Ionicons

    • "ioni"
    • compile 'com.rilixtech:ionicons-typeface:'
  • Material Design Iconic Font

    • "gmii"
    • Google Material Iconic
    • compile 'com.rilixtech:material-design-iconic-typeface:'
  • MFGLabs Iconset

    • "mfgi"
    • compile 'com.rilixtech:mfglabs-iconset-typeface:1.0'
  • Meteocons

    • "meti"
    • compile 'com.rilixtech:meteocons-typeface:'
  • Mobirise Icons

    • "mbri"
    • compile 'com.rilixtech:mobirise-icons-typeface:1.0.0'
  • Octicons

    • "octi"
    • compile 'com.rilixtech:octicons-typeface:'
  • Open Iconic

    • "opic"
    • compile 'com.rilixtech:open-iconic-typeface:1.1.1'

    • "pici"
    • compile 'com.rilixtech:picol-typeface:1.0.0'
  • Pixden7Stroke

    • "pe7i"
    • compile 'com.rilixtech:pixeden-7-stroke-typeface:'
  • Themify Icons

    • "thei"
    • compile 'com.rilixtech:themify-icons-typeface:0.1.2'
  • Typeicons

    • "typi"
    • compile 'com.rilixtech:typicons-typeface:'
  • Vaadin Icons

    • "vaai"
    • compile 'com.rilixtech:vaadin-icons-typeface:4.1.0'
  • Weather Icons

    • "wici"
    • compile 'com.rilixtech:weather-icons-typeface:'

Licenses for all included fonts are linked inside the class or can be found on the corresponding repositories.

Basic Usage Example

1 - Add MaterialFancyButton to your dependencies:

compile 'com.rilixtech:materialfancybuttons:1.8.7'

2 - Include MaterialFancyButton namespace to the root element:


3 - Add the MaterialFancyButton View:


4 - Select the font that you desire, for example FontAwesome. Add it as dependencies:

compile 'com.rilixtech:fontawesome-typeface:'

All icon font characters will be included in String Resource.

5 - Add the attribute for icon font character that you want, for example star icon. It should be in prefix_icon_name format. Because we use FontAwesome the prefix is fawi and the icon character is fawi_star. Use fancy:mfb_icon attribute:


So it become:


This is the recommended way, so you don't need to manually copy the font and remembering all the characters of the font, which is very tedious and error prone.

Custom Font

If you want to use custom Font, follow this easy steps:

1 - Paste your font inside assets/fonts/ folder for Text fonts or inside assets/iconfonts/ for icon fonts eg : fontawesome

2 - Then add the following attribute:

For text:

fancy:mfb_textFont="robotothin.ttf" fancy:mfb_text="your text" 

so it will be look like this:

  fancy:mfb_text="your text"/> 

For icon:

fancy:mfb_iconFont="fontawesome.ttf" fancy:mfb_fontIconResource="&#xf087;" 

so it will be look like this:


Please be noted that when using fancy:mfb_icon you don't need to use fancy:mfb_iconFont and fancy:mfb_fontIconResource. If both value is present, they will be override and ignored.

Supported Attributes

XML Attribute Java Method Description
fancy:mfb_text setText(String) Text of the button
fancy:mfb_textColor setTextColor(int) Text Color of the button
fancy:mfb_textSize setTextSize(int) Size of the text
fancy:mfb_textFont setCustomTextFont(String) FontFamily of the text
fancy:mfb_textGravity setTextGravity(Int) Gravity of the text
fancy:mfb_icon setIcon(String), setIcon(char) Set icon from icon font list. Need the font library (fontawesome_typeface_library, etc) to works. This will override fancy:mfb_fontIconResource and fancy:mfb_iconFont
fancy:mfb_iconResource setIconResource(Drawable) Drawable icon of the button
fancy:mfb_iconPosition setsetIconPosition(int) Position of the icon : Left, Right, Top, Bottom
fancy:mfb_fontIconResource setIconResource(String) font icon of the button
fancy:mfb_fontIconSize setFontIconSize(int) Size of the icon
fancy:mfb_iconFont setCustomIconFont(String) FontFamily of the icon
fancy:mfb_borderWidth setBorderWidth(int) Width of the border
fancy:mfb_borderColor setBorderColor(int) Color of the border
fancy:mfb_defaultColor setBackgroundColor(int) Background color of the button
fancy:mfb_focusColor setFocusBackgroundColor(int) Focus Color of button background
fancy:mfb_disabledColor setDisableBackgroundColor(int) Disabled Color of button background
fancy:mfb_disabledTextColor setDisableTextColor(int) Disabled Color of button text
fancy:mfb_disabledBorderColor setDisableBorderColor(int) Disabled Color of button border
fancy:mfb_radius setRadius(int) Radius of the button
fancy:mfb_radiusTopLeft setRadiusTopLeft(int) Radius top left of the button
fancy:mfb_radiusTopRight setRadiusTopRight(int) Radius top right of the button
fancy:mfb_radiusBottomLeft setRadiusBottomLeft(int) Radius bottom left of the button
fancy:mfb_radiusBottomRight setRadiusBottomRight(int) Radius bottom right of the button
fancy:mfb_iconPaddingLeft setIconPadding(int,int,int,int) Icon Padding
fancy:mfb_iconPaddingRight setIconPadding(int,int,int,int) Icon Padding
fancy:mfb_iconPaddingTop setIconPadding(int,int,int,int) Icon Padding
fancy:mfb_iconPaddingBottom setIconPadding(int,int,int,int) Icon Padding
fancy:mfb_ghost setGhost(boolean) Ghost (Hollow)

For setting the radius of the button, you can also use setRadius(int radiusTopLeft, int radiusTopRight, int radiusBottomLeft, int radiusBottomRight)

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.

Supported default Attributes

XML Attribute

Supported Getters

Method Description
getText() Returns Text Value of the button
getTextViewObject() Returns TextView Object
getIconFontObject() Returns icon defined by fb_fontIconResource
getIconImageObject() Returns icon defined by fb_iconResource


1 - Spotify Button

<com.rilixtech.materialfancybutton.MaterialFancyButton  android:id="@+id/btn_spotify"  android:layout_width="wrap_content"  android:layout_height="wrap_content"  android:paddingBottom="10dp"  android:paddingLeft="20dp"  android:paddingRight="20dp"  android:paddingTop="10dp"  fancy:mfb_borderColor="#FFFFFF"  fancy:mfb_borderWidth="1dp"  fancy:mfb_defaultColor="#7ab800"  fancy:mfb_focusColor="#9bd823"  fancy:mfb_iconFont="fontawesome.ttf"  fancy:mfb_fontIconResource="&#xf04b;"  fancy:mfb_iconPosition="left"  fancy:mfb_radius="30dp"  fancy:mfb_text="SHUFFLE PLAY"  fancy:mfb_textColor="#FFFFFF" /> 

2 - Facebook Button

MaterialFancyButton facebookLoginBtn = new MaterialFancyButton(this);
 facebookLoginBtn.setText("Login with Facebook");

See the example project for more samples


How to add new fonts ? Just Paste your font inside assets/fonts/ folder for Text fonts or inside assets/iconfonts/ for icon fonts eg : entypo


MaterialFancyButtons needs you to build the missing features:

  • Supporting Circular buttons
  • Add elevation (Material Design)


Developed By


Copyright 2017 Joielechong  Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License. You may obtain a copy of the License at  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 


Modification of ZXING Barcode Scanner project for easy Android QR-Code detection in portrait mode and AR purposes.

This project implements an Android view which show camera and notify when there's a QR code inside the preview.

LoadingView is easy to implement loading indicators for your views or layouts.

An in-memory data store backed by shared preferences, for Android.

Easy to use inline @Keep annotation to keep class.

A UI widget that allows for headers and footers on lists backed by RecyclerView.

This is an extension for the mosby library. It contains a few default activities and fragments which are often used in android development (e.g. Activity with Toolbar, Activity with Tabs, Fragment with RecyclerView, ...)


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes