st235 / ExpandableBottomBar

A new way to implement navigation in your app 🏎
MIT License
777 stars 58 forks source link

custom font support for text in bottom bar #57

Closed notjedi closed 3 years ago

notjedi commented 4 years ago

it would be nice to have custom font support for text in bottom nav bar

st235 commented 4 years ago

Hi @jedi2610 👋

Dunno, I am not 100% confident in this. I need to check BottomNavigationView.

notjedi commented 4 years ago

alr cool, i actually don't need that but thought it would be cool to have that feature

st235 commented 3 years ago

Hi @jedi2610 👋

About custom fonts: it's already supported. To provide custom font you need:

  1. Add custom font under res/font folder
  2. Create a custom style with fontFamily property
    <style name="CustomFont">
        <item name="android:fontFamily">@font/ranches</item>
    </style>
  1. Implement android:theme attribute at ExpandableBottomBar
    <github.com.st235.lib_expandablebottombar.ExpandableBottomBar
        android:id="@+id/expandable_bottom_bar"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:theme="@style/CustomFont"
        app:exb_items="@menu/bottom_bar"
        app:exb_itemInactiveColor="#CCCCCC"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

The result should be like that:

Screenshot_1600630321 Screenshot_1600630324

notjedi commented 3 years ago

oh cool thanks