FontFull is a demonstration library created as a self-teaching project, packed with excellent font formatting features in just 4 lines of code
Download Sample APK ---> Click on "download raw"
-
FontStyle BottomSheet :
You can integrate some of the widely used typefaces in your app without having to download each separately yourself has the liberty to add your own typefaces as well.
-
Font Size Slider :
The font size selector slider is available in the bottom sheet and can be directly used to set the text size.
-
Font Color Picker Menu:
Integrated into the bottom sheet, the color picker menu offers a clean UI and functions well to set the color of the text.
Installation of FontFull is really very simple, follow the below steps to get started!
Step 1 : Use this in settings.gradle
pluginManagement {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2 : Use this in build.gradle (module:app)
dependencies {
implementation 'com.github.mohitsingh35:FontFullLibrary:1.0'
}
//FontStyle Usage
//this is a sample button change it in your code
FontStylebutton.setOnClickListener {
val fontStyleSelectedListener = object : FontFull.FontStyleBottomSheetDialog.OnFontStyleSelectedListener {
override fun onFontStyleSelected(typeface: Typeface) {
textView.typeface=typeface // don't forget to change your textview here
}
}
FontFull.FontStyleBottomSheetDialog.showFontStyleBottomSheet(this, fontStyleSelectedListener)
}
//FontSize Usage
val fontSizeBottomSheetDialog = FontFull.FontSizeBottomSheetDialog(this)
fontSizeBottomSheetDialog.setSizeChangeListener { selectedValue ->
textView.textSize = selectedValue // don't forget to change your textview here
}
FontSizebutton.setOnClickListener { // open the bottom sheet
fontSizeBottomSheetDialog.show()
}
//FontColor Usage
//this is a sample button change it in your code
FontColorbutton.setOnClickListener {
val colorPickerBottomSheet = FontFull.ColorPickerBottomSheet()
colorPickerBottomSheet.setOnColorSelectedListener { color ->
textView.setTextColor(color) // don't forget to change your textview here
}
colorPickerBottomSheet.show(supportFragmentManager, "colorPicker")
}
New FontStyles can be added by the desired .ttf file of font in res/font and then adding this in FontFull class inside fontstylelist as R.font.your_font
Peace out 🤞