All Projects → timrijckaert → BetterBottomBar

timrijckaert / BetterBottomBar

Licence: MIT license
Fork of the BottomNavigationView from the design lib to allow for view state, accessibility and colorful animations

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to BetterBottomBar

IRBottomNavigationView
Floating Bottom Navigation/Tab System
Stars: ✭ 48 (+45.45%)
Mutual labels:  bottombar, bottomnavigationview
BottomNavygation
Bottom Navigation based on Bottom Navigation View from Android
Stars: ✭ 62 (+87.88%)
Mutual labels:  bottombar, bottomnavigationview
BottomNavigationBar
A light bottom navigation bar in Android supporting Tint mode.
Stars: ✭ 48 (+45.45%)
Mutual labels:  bottomnavigationview
AACustomFont
[UNMAINTAINED] AACustomFont is a lightweight custom font binder in XML directly in TextView, Button, EditText, RadioButton, CheckBox tags. The library is aimed to avoid custom views for custom fonts in XML and to minimize the JAVA code for setting the TypeFaces for each view.
Stars: ✭ 76 (+130.3%)
Mutual labels:  customview
Motion-Tab-Bar
A beautiful animated flutter widget package library. The tab bar will attempt to use your current theme out of the box, however you may want to theme it.
Stars: ✭ 237 (+618.18%)
Mutual labels:  bottomnavigationview
BottomNavigationViewDemo
BottomNavigationView + Fragment 学习Demo
Stars: ✭ 22 (-33.33%)
Mutual labels:  bottomnavigationview
Frames
Retrieves desired frames from video.
Stars: ✭ 51 (+54.55%)
Mutual labels:  customview
TriangularCustomView
No description or website provided.
Stars: ✭ 29 (-12.12%)
Mutual labels:  customview
BeautyClock
A simple project draw clock view by using Canvas and Kotlin
Stars: ✭ 14 (-57.58%)
Mutual labels:  customview
sora-editor
A cool code editor library on Android with syntax-highlighting and auto-completion. (aka CodeEditor)
Stars: ✭ 580 (+1657.58%)
Mutual labels:  customview
FooterNavigationView
FooterNavigationView helps to show a footer inside the NavigationView
Stars: ✭ 30 (-9.09%)
Mutual labels:  customview
CustomTitleBar
💥【通用标题栏】通用Android标题栏控件 A Common Titlebar For Android
Stars: ✭ 106 (+221.21%)
Mutual labels:  customview
SuperShapeView
A smart custom view support shapes for ImageView, TextView ,EditView ,instead of shape.xml.(自定义形状控件,支持TextView,EditText)
Stars: ✭ 60 (+81.82%)
Mutual labels:  customview
PaymentCardView
Custom Credit/Debit card view
Stars: ✭ 62 (+87.88%)
Mutual labels:  customview
react-native-bottom-bar
Fully customizable BottomBar with unique design shape for React Native.
Stars: ✭ 74 (+124.24%)
Mutual labels:  bottombar
BottomNavArchDemo
The demo project for Bottom Navigation with Navigation Architecture Components article
Stars: ✭ 53 (+60.61%)
Mutual labels:  bottomnavigationview
HenCoderPractice-Kotlin
HenCoder 练习项目- Kotlin 版
Stars: ✭ 26 (-21.21%)
Mutual labels:  customview
WechatPopupWindow
高仿微信聊天界面长按弹框样式
Stars: ✭ 71 (+115.15%)
Mutual labels:  customview
flutter-bottomAppBar
Watch the tutorial video on Youtube ->
Stars: ✭ 15 (-54.55%)
Mutual labels:  bottomnavigationview
iMoney
iMoney 金融项目
Stars: ✭ 55 (+66.67%)
Mutual labels:  customview

Better BottomNavigationView

Trying to fix the biggest let down view in the Android design lib.
Everything wrong with BottomNavigationView.
This contains fixes for missing save state, accessibility and the colorful transition on tab change.

Basic usage

The view is written in Kotlin, but you can safely use it in your trusty old Java project if you are willing to import the Kotlin Standard library. See the example.

Basic Sample Usage.
Just like your regular BottomNavigationView you can inflate your custom menu.

<be.rijckaert.tim.library.BetterBottomBar
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/colorAccent"
        android:layout_alignParentBottom="true"
        android:layout_gravity="bottom"
        app:itemIconTint="@color/white"
        app:itemTextColor="@color/white"
        app:menu="@menu/bottom_navigation_main"/>

Text Colors And Icon Drawable

You can alter the text colors for each tab with the help of the app:XXXXTabTextColors.
For example for the first tab you should use app:firstTabTextColors.
just provide your custom ColorStateList

See the sample if you need more explanation

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:color="@color/textColorPrimary"
        android:state_checked="true"/>
    <item
        android:color="@color/textColorPrimaryUnselected"
        android:state_checked="false"/>
</selector>

Same for the icon drawable just use the app:XXXTabIconColors

Tab Change Listener

In order to receive tab change events you should attach a betterBottomBarClickListener.

betterBottomBar.betterBottomBarClickListener = { betterBottomBar, menuItem ->
    //get state
}

Save State

On rotation all the correct color are still applied to your view. You can also access the selectedTab index via code.

final BetterBottomBar betterBottomBar = (BetterBottomBar) findViewById(R.id.bottom_navigation);
betterBottomBar.getSelectedTab();

Color Animation

You can change the default colors with the app:colors attribute.
Make sure to reference an IntArray of colors

When no color array has been added, no animation will happen.

<be.rijckaert.tim.library.BetterBottomBar
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/colorAccent"
        android:layout_alignParentBottom="true"
        android:layout_gravity="bottom"
        app:itemIconTint="@color/white"
        app:itemTextColor="@color/white"
        app:colors="@array/bottom_bar_colors"
        app:menu="@menu/bottom_navigation_main"/>

@array/bottom_bar_colors

<array name="bottom_bar_colors">
    <item>@color/colorPrimary</item>
    <item>@color/someReddishColor</item>
    <item>@color/blackAsYourHeart</item>
</array>

###Accessibility Support

You can add accessibility to your BottomNavigationView by adding the app:contentDescriptionTitles attribute whichs refs to a StringArray.
If you forget to do this. The view will use reflection to look for your titles.
Don't be a dick just provide them.

<be.rijckaert.tim.library.BetterBottomBar
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/colorAccent"
        android:layout_alignParentBottom="true"
        android:layout_gravity="bottom"
        app:itemIconTint="@color/white"
        app:itemTextColor="@color/white"
        app:contentDescriptionTitles="@array/better_bottom_bar_accessibility_title"
        app:menu="@menu/bottom_navigation_main"/>

string.xml

<array name="better_bottom_bar_accessibility_title">
    <item>@string/news_title</item>
    <item>@string/video_title</item>
    <item>@string/discover_title</item>
</array>

At the moment it only supports:

  • English
  • Dutch

Feel free to submit PR for more language support

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].