I have created a bottom bar navigation in my android page. But now I want to apply the custom font-family in bottom navigation texts.
This is the bottom navigation c
For Kotlin Lover
Create an extension class for custom asset font
/**
* Method for Bottom Navigation Font Family
*@param view
*
* */
private fun navigationTextFont(view: View) {
if (view is ViewGroup) {
for (i in 0 until view.childCount) {
val child = view.getChildAt(i)
navigationTextFont(child)
}
} else if (view is TextView) {
view.typeface = Typeface.createFromAsset(this.assets, "fonts/roboto_bold.ttf")
}
}
Now call this extension
navigationTextFont(yourNavigationViewId)
Good Luck