A Tiny Font Utility Library used to apply custom to

  • Toolbar
  • NavigationView
  • Menu
  • Submenu
  • Other Views like EditText, TextView, etc.

Supported

Readme for Xamarin.Android can be found here https://github.com/Xamarin-Gists/XAFontUtilsLibrary.

How to download

Add this line in your level gradle file (build.gradle)

implementation 'com.ajts.androidmads.fontutils:fontutils:1.0.0'

How to use

Java

// Applying Custom Font
Typeface typeface = Typeface.createFromAsset(getAssets(), "custom_font.ttf");
// Init Library
FontUtils fontUtils = new FontUtils(getApplicationContext());
// Apply font to Toolbar
fontUtils.applyFontToToolbar(toolbar, typeface);
// Apply font to NavigationView
fontUtils.applyFontToNavigationView(navigationView, typeface);
// Apply font to Menu
fontUtils.applyFontToMenu(menu, typeface);
// Apply font to Other Views like TextView...
fontUtils.applyFontToView(textview, typeface);
fontUtils.applyFontToView(editText, typeface);
fontUtils.applyFontToView(radioButton, typeface);
fontUtils.applyFontToView(checkBox, typeface);

Kotlin

// Applying Custom Font
val typeface = Typeface.createFromAsset(assets, lato_bold)
// Init Library
val fontUtils = FontUtils(applicationContext)
// Apply font to Toolbar
fontUtils.applyFontToToolbar(toolbar, typeface)
// Apply font to NavigationView
fontUtils.applyFontToNavigationView(navigationView, typeface)
// Apply font to Menu
fontUtils.applyFontToMenu(menu, typeface)
// Apply font to Other Views like TextView...
fontUtils.applyFontToView(textview, typeface)
fontUtils.applyFontToView(editText, typeface)
fontUtils.applyFontToView(radioButton, typeface)
fontUtils.applyFontToView(checkBox, typeface)

License

MIT License

Copyright (c) 2018 AndroidMad / Mushtaq M A

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or 
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



Source link
thanks you RSS link
( https://android-.com/details/1/6859)

LEAVE A REPLY

Please enter your comment!
Please enter your name here