medyo / Fancybuttons

Icons, Borders, Radius ... for Android buttons
1.77k stars 397 forks source link

Method ‘setFontIconSize’ can‘t work when I put my iconresource in drawable and import it by using R.drawable.xxx #133

Open xiaoxiaoci opened 4 years ago

xiaoxiaoci commented 4 years ago

but it works in settings below FancyButton foursquareBtn = new FancyButton(this); foursquareBtn.setText("Check in"); foursquareBtn.setBackgroundColor(Color.parseColor("#0072b1")); foursquareBtn.setFocusBackgroundColor(Color.parseColor("#228fcb")); foursquareBtn.setTextSize(17); foursquareBtn.setRadius(5); foursquareBtn.setIconResource("\uf180"); foursquareBtn.setIconPosition(FancyButton.POSITION_TOP); foursquareBtn.setFontIconSize(60); how can I import myself iconresource in a way like "\uf180"

Ad9an commented 3 years ago

//It's too late but it's for those people who still using fancybutton in 2021.

Typeface face = Typeface.createFromAsset(context.getAssets(), "font/BLKCHCRY.TTF"); //geting font from "assets/font" folder fancybutton.getTextViewObject().setTypeface(face);