Code Monkey home page Code Monkey logo

material-bottomnavigation's Introduction

Material Bottom Navigation Library

Android Arsenal Build Status
Maven Central

Lightweight Bottom Navigation library component inspired by the Google Material Design Guidelines at https://www.google.com/design/spec/components/bottom-navigation.html

This project is also inspired by https://github.com/roughike/BottomBar


Table of contents

Installation

In your project's build.gradle file add the following line to the dependencies group:

compile 'it.sephiroth.android.library.bottomnavigation:bottom-navigation:3.0.0'

Usage

Usage of the BottomNavigation widget is very easy. Just place it in your layout.xml like this:

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout android:id="@+id/CoordinatorLayout01"
	xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
	android:layout_height="match_parent"
    android:fitsSystemWindows="true">

	...your content...

    <it.sephiroth.android.library.bottomnavigation.BottomNavigation
	    android:id="@+id/BottomNavigation"
        android:layout_width="match_parent"
	    android:layout_height="wrap_content"
        android:layout_gravity="bottom"
	    app:bbn_entries="@menu/bottombar_menu_4items"
        app:bbn_scrollEnabled="true"
        app:bbn_badgeProvider="@string/bbn_badgeProvider"
	    app:layout_behavior="@string/bbn_phone_view_behavior" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

All the menu main configurations are defined within the xml menu resource itself. Here's an example of a menu with 4 items:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
	xmlns:app="http://schemas.android.com/apk/res-auto"
    android:background="@android:color/black"
    app:bbn_badgeColor="#FFFF0000"
	app:bbn_rippleColor="#33ffffff">
    <item
	    android:id="@+id/bbn_item1"
    	android:color="@color/colorPrimary"
        android:icon="@drawable/ic_cloud_off_white_24dp"
	    android:title="Cloud Sync" />
    <item
	    android:id="@+id/bbn_item2"
        android:color="@android:color/holo_green_dark"
	    android:icon="@drawable/ic_cast_connected_white_24dp"
        android:title="Chromecast" />
	<item
        android:id="@+id/bbn_item3"
	    android:color="@android:color/holo_orange_dark"
        android:icon="@drawable/ic_mail_white_24dp"
	    android:title="Mail" />
    <item
	    android:id="@+id/action4"
    	android:color="#FF5252"
        android:icon="@drawable/ic_format_list_numbered_white_24dp"
	    android:title="List" />
</menu>

Examples

4 shifting items menu 3 fixed items menu
Video 1 Video 2
4 items no background Tablet mode
4 items without changing background.
Menu show/hide feature is also disabled
Menu can be easily setup for (left or right) tablet support.
Video 3 Tablet Mode

Sizing

Dimensions and paddings follow the Google giudelines
Sizing

Tablets

The View supports tablet mode too (Left or Right). In order to enable tablet mode this is the configuration that should be used:

<it.sephiroth.android.library.bottomnavigation.BottomNavigation
    android:id="@+id/BottomNavigation"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="start"
    app:bbn_entries="@menu/bottombar_menu_3items"
    app:bbn_badgeProvider="@string/bbn_badgeProvider"
    app:layout_behavior="@string/bbn_tablet_view_behavior" />

Styling

The xml menu supports the following attributes in the <menu> tag:

<declare-styleable name="BottomNavigationMenu">
    <!-- menu default background color -->
    <attr name="android:background" />
    
    <!-- default badge color -->
    <attr name="bbn_badgeColor" format="color" />

    <!-- animation duration for the menu items -->
    <attr name="bbn_itemAnimationDuration" format="integer" />

    <!-- ripple selector color -->
    <attr name="bbn_rippleColor" format="color" />

    <!-- menu item active color -->
    <attr name="bbn_itemColorActive" format="color" />

    <!-- menu item inactive color -->
    <attr name="bbn_itemColorInactive" format="color" />

    <!-- menu item disabled color -->
    <attr name="bbn_itemColorDisabled" format="color" />

    <!-- force fixed behavior and always display item labels -->
    <!-- default implementation is false and the labels are -->
    <!-- shown only if there are less than 4 items in the menu -->
    <attr name="bbn_alwaysShowLabels" format="boolean" />
</declare-styleable>

Note: By default when there are 4 or 5 elements, only the selected item will display the label. In order to force all the items to always show their label, use bbn_alwaysShowLabels in the menu xml.

Badges

Badges

There's a basic support for badges using the default implementation. In order to display a badge in the current BottomNavigation view, all you have to do is:

    final BadgeProvider provider = bottomNavigationView.getBadgeProvider();
    provider.show(R.id.bbn_item3);

This code will show a little circle badge on the menu item with the id "bbn_item3".
You can define the default badge color inside the menu xml itself:

<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    app:bbn_badgeColor="#FFFF0000">
    
    <item
        android:id="@+id/bbn_item1"
        android:color="@color/colorPrimary"
        android:icon="@drawable/ic_cloud_off_white_24dp"
        android:title="Cloud Sync" />
        
    ...
</menu>

Then you can hide the badge using:

    bottomNavigation.getBadgeProvider().remove(R.id.bbn_item3);

Badges Customization

You can use your own Drawable by extending the BadgeProvider class. Once you've setup your new class you can tell the BottomNavigation view to use your class by specifying it in the "bbn_badgeProvider" attribute of your xml file.
For instance:

<it.sephiroth.android.library.bottomnavigation.BottomNavigation
    android:id="@id/BottomNavigation"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="bottom"
    app:bbn_badgeProvider="my.custom.BadgeProviderCustom"
    app:bbn_entries="@menu/bottombar_menu_4items"
    app:layout_behavior="@string/bbn_phone_view_behavior" />

This will make your my.custom.BadgeProviderCustom the default BadgeProvider.

License

The MIT License (MIT)

Copyright (c) 2016 Alessandro Crugnola

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 sell 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.

material-bottomnavigation's People

Contributors

kamgurgul avatar kibao avatar sephiroth74 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

material-bottomnavigation's Issues

Menu with 4 icons dispayed in black color

Your component is a lifesaver for me.
I found the following behavior in my application.
I use it in two different (MainActivity) AppCompatActivity, only one is shown during the user session since it depends on the user profile. I use a menu of three options in the first one and one more option in the second, four options total, all icons are white.

But in the case of the second activity when this is displayed icons appear in black.

I test the same layout deleting the fourth item from the menu and then the icons are displayed in white.
This behavior is only when the fourth menu option is present.

Change Activity between fragments.

How can i change Activities between fragments...e.g when i select a Menu i see different fragments not the same fragments all along;

how do i achieve this? otherwise thanks very much.

How to implement onitemclick listener?

How can I set my own fragment to be listened to when a specific item on the navigation bar is clicked?
I would appreciate help from any person.

Thanks very much.

The second icon is active

The second icon is activated initially. After selecting it and selecting another item it backs to normal. Check attached screenshots
screenshot_20160810-164611
screenshot_20160810-164620
screenshot_20160810-164624

Vector drawable icon is not supported

Hi,

Thanks for the great lib!

I've faced an issue when tried to set up BottomNavigation with menu containing items with vector drawables. Note: the same drawable works with native BottomNavigationView.
Here's the stacktrace:

FATAL EXCEPTION: main
android.content.res.Resources$NotFoundException: File res/drawable/ic_dashboard.xml from drawable resource ID #0x7f020060. If the resource you are trying to use is a vector resource, you may be referencing it in an unsupported way. See AppCompatDelegate.setCompatVectorFromResourcesEnabled() for more info.
at android.content.res.Resources.loadDrawable(Resources.java:1923)
at android.content.res.Resources.getDrawable(Resources.java:659)
at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:374)
at it.sephiroth.android.library.bottomnavigation.BottomNavigationItem.getIcon(BottomNavigationItem.java:25)
at it.sephiroth.android.library.bottomnavigation.BottomNavigationFixedItemView.onLayout(BottomNavigationFixedItemView.java:135)
at android.view.View.layout(View.java:13754)
at it.sephiroth.android.library.bottomnavigation.FixedLayout.setChildFrame(FixedLayout.java:86)
at it.sephiroth.android.library.bottomnavigation.FixedLayout.onLayout(FixedLayout.java:69)
at android.view.View.layout(View.java:13754)
at android.view.ViewGroup.layout(ViewGroup.java:4364)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:13754)
at android.view.ViewGroup.layout(ViewGroup.java:4364)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:948)
at android.view.View.layout(View.java:13754)
at android.view.ViewGroup.layout(ViewGroup.java:4364)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:13754)
at android.view.ViewGroup.layout(ViewGroup.java:4364)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1649)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1507)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1420)
at android.view.View.layout(View.java:13754)
at android.view.ViewGroup.layout(ViewGroup.java:4364)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:13754)
at android.view.ViewGroup.layout(ViewGroup.java:4364)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1649)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1507)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1420)
at android.view.View.layout(View.java:13754)
at android.view.ViewGroup.layout(ViewGroup.java:4364)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:13754)
at android.view.ViewGroup.layout(ViewGroup.java:4364)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1868)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1689)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4214)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
at android.view.Choreographer.doCallbacks(Choreographer.java:555)
at android.view.Choreographer.doFrame(Choreographer.java:525)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #1: invalid drawable tag vector
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:877)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:818)
at android.content.res.Resources.loadDrawable(Resources.java:1920)
at android.content.res.Resources.getDrawable(Resources.java:659) 
at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:374) 
at it.sephiroth.android.library.bottomnavigation.BottomNavigationItem.getIcon(BottomNavigationItem.java:25) 
at it.sephiroth.android.library.bottomnavigation.BottomNavigationFixedItemView.onLayout(BottomNavigationFixedItemView.java:135) 
at android.view.View.layout(View.java:13754) 
at it.sephiroth.android.library.bottomnavigation.FixedLayout.setChildFrame(FixedLayout.java:86) 
at it.sephiroth.android.library.bottomnavigation.FixedLayout.onLayout(FixedLayout.java:69) 
at android.view.View.layout(View.java:13754) 
at android.view.ViewGroup.layout(ViewGroup.java:4364) 
at android.widget.FrameLayout.onLayout(FrameLayout.java:448) 
at android.view.View.layout(View.java:13754) 
at android.view.ViewGroup.layout(ViewGroup.java:4364) 
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:948) 
at android.view.View.layout(View.java:13754) 
at android.view.ViewGroup.layout(ViewGroup.java:4364) 
at android.widget.FrameLayout.onLayout(FrameLayout.java:448) 
at android.view.View.layout(View.java:13754) 
at android.view.ViewGroup.layout(ViewGroup.java:4364) 
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1649) 
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1507) 
at android.widget.LinearLayout.onLayout(LinearLayout.java:1420) 
at android.view.View.layout(View.java:13754) 
at android.view.ViewGroup.layout(ViewGroup.java:4364) 
at android.widget.FrameLayout.onLayout(FrameLayout.java:448) 
at android.view.View.layout(View.java:13754) 
at android.view.ViewGroup.layout(ViewGroup.java:4364) 
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1649) 
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1507) 
at android.widget.LinearLayout.onLayout(LinearLayout.java:1420) 
at android.view.View.layout(View.java:13754) 
at android.view.ViewGroup.layout(ViewGroup.java:4364) 
at android.widget.FrameLayout.onLayout(FrameLayout.java:448) 
at android.view.View.layout(View.java:13754) 
at android.view.ViewGroup.layout(ViewGroup.java:4364) 
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1868) 
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1689) 
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000) 
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4214) 
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725) 
at android.view.Choreographer.doCallbacks(Choreographer.java:555) 
at android.view.Choreographer.doFrame(Choreographer.java:525) 
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711) 
at android.os.Handler.handleCallback(Handler.java:615) 
at android.os.Handler.dispatchMessage(Handler.java:92) 
at android.os.Looper.loop(Looper.java:137) 
at android.app.ActivityThread.main(ActivityThread.java:4745) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:511) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 
at dalvik.system.NativeStart.main(Native Method) 

Disable default selected tab

Sometime selecting nothing is needed.
using this way:
mBottomNav.setDefaultSelectedIndex(-1); // Nothing tab is checked 👍
but, when I select one :( NullPointerException, because is invalid position ...

java.lang.NullPointerException: Attempt to invoke virtual method 'void it.sephiroth.android.library.bottomnavigation.BottomNavigationFixedItemView.setExpanded(boolean, int, boolean)' on a null object reference at it.sephiroth.android.library.bottomnavigation.FixedLayout.setSelectedIndex(FixedLayout.java:106)

Is there a way to have a tab not selected when first time running?

i want more tabs

i want 8 tabs and they have to be scrollable. how can i do that ?

how to show text color when item isn't selected?

I would like to show text color and icon both when item isn't selected. For eg, When bbn_itemColorActive = Blue Color and When item isn't bbn_itemColorInactive = Gray. how to show text color when item isn't selected?

BottomNavigation within BaseActtivity

Hello @Sephiroth, Thanks for great library. I want to use this bottom navigation all over the app like TabViewController in iOS. How can i implement with this. Please give some example for explanation.
Thanks for Help.

[feature] possible different item icon?

Sometimes a item of active state and its inactive state might use different icons, in different shape and different color. It would be greate if the icon a menu item could support selector drawable, or it could set active icon along with inactive icon.

FAB is always 0dp above BottomNavigation

if the FAB is anchored to BottomNavigation and the Behavior is set on FAB (the one provided)

the FAB is always above BottomNav, doesn't matter which values are set for marginBottom on FAB or marginTop on BottomNav.

the only visible space between them is just the space the shadow takes.

according to Material Design the FAB should be 16dp above, BottomNav or Bottom

hide BottomNavigation not translate FAB on API 16

Hi,
i got BottomBar with FAB above. When i scroll, the bar closes, but FAB stays at the same position.
On API 23 it works fine, but on API 16 it is not.

support libraries: v7:23.4.0
Tested device fail: Genymotion Samsung Galaxy S2, 4.1.1, API 16
Tested device ok: Motorola X Style, 6.0, API 23

Accessibility

Hello,

Usually Talkback reads the title of menu items, but noticed that isn't happening with the items in the bottom navigation view. Is there anything I should be doing to have the title be the content description or is this a bug/intentional? Visually impaired users won't be able navigate the app so any guidance is appreciated!

Thanks,
Anita

change menu item text color

How to change menu item text color?
for example i want change my menu item text color to black,the default is white
what should i do

How to remove small padding on top

There is a small padding on the top which creates a little gap between the BottomNavigation and the view above. It looks really weird.
How do I remove this?
Image:
screen shot 2016-12-20 at 12 02 11

Add items by code

Is it possible to add items by Java code and not only by XML?
Because I have to use vector drawables as icons and I can only get them programmatically.

[feature] possible blury

that would be a good idea to integrate this feature to the background of the bottomnavigation view x realtimeeffect.

It is best to provide a method simply to allow custom view to substitute the original background view.

Disable ripple effect

Hi all, I just started using this library but I cannot seem to find a way to disable the ripple effect when an item is selected. Am I missing something simple ?

Remove debug logs

The library has lots of log calls which cannot be even turned of with a flag. Those logs should be removed.

Conflict with Snackbar dismiss?

Hello,

When using the BottomBehavior and showing a Snackbar, it generates a bug on dismissal gesture of Snackbar. But using the TabletBehavior, this doesn't happen.

I'm using the sample app to reproduce the problem. Just click on FAB and try to dismiss the SnackBar.

I'll try to investigate, but i have no clue about this problem yet.

Behavior on FloatingActionButton inside fragment doesn't work

I have a main activity which contains container for fragments and a control for bottom navigation:

<android.support.design.widget.CoordinatorLayout>
      <android.support.v7.widget.FitWindowsFrameLayout android:id="@+id/content" ... />
      <it.sephiroth.android.library.bottomnavigation.BottomNavigation ... />
</android.support.design.widget.CoordinatorLayout>

then the fragment view contain FloatingActionButton, but the button is overlaped with bottom navigation, because it is not in the same CoordinatorLayout ... any suggestion how to fix that?

animation lag bug when specifying layout height.

Foreword edit: I just ran a test while writing this issue. Changing the height to wrap_content fixes the issue but I will still post to bring it to attention for others who need more direct height controls

Notice the bottom bar: http://imgur.com/i0bZMJZ

There is a horizontal line slightly above the translucent nav bar. In this picture I was in the green colored index and animated over to the blue colored index. The ripple doesn't expand throughout the entire bar evenly, it just goes across horizontally and the rest changes behind it a bit later. Even with a solid nav bar there is still a 4-5px line lagging behind on the bottom of the nav bar.

Using 2.0.1-rc1
Google Pixel, 7.1.1 if it matters

<it.sephiroth.android.library.bottomnavigation.BottomNavigation android:id="@+id/view_main_nav" android:layout_width="match_parent" android:layout_height="56dp" android:layout_gravity="bottom" app:bbn_entries="@menu/nav_main" app:bbn_scrollEnabled="true" app:bbn_badgeProvider="@string/bbn_badgeProvider" app:layout_behavior="@string/bbn_default_view_behavior" />

Layout not scrolling, OnClickListeners not registering.

Hi,

I just started using your library, and for the most part it works perfectly, however I have found a weird issue. On one Fragment I have a RecyclerView and it works perfectly, scrolls down the list, and the toolbar and bottom navigation both hide and reappear when scrolling.

I added another Fragment just now, and the layout is a simple RelativeLayout. When I move to that tab I do a .replace FragmentTransaction and it all works, however I cannot scroll in the layout, and all my OnClickListeners do not work. I can see the view has inflated, but I can't do anything with it.

Does this library only work with RecyclerViews/Listviews or something? Not quite sure what's going on.

Would appreciate any guidance on the matter. Thanks.

custom badge doesn't work

The CustomBadgeProvider works in your demo application, but doesn't work in my app. It's really weird. What' more weird is you libary cause color #ffffff turns into color_primary in my app, that's really annonying.

I just write a simple CustomBadgeProvider.java.

public class CustomBadgeProvider extends BadgeProvider{
    public CustomBadgeProvider(BottomNavigation navigation) {
        super(navigation);
    }


    Drawable getBadge(@IdRes int itemId) {
        return new BadgeDrawable(Color.BLUE, 192);
    }
}

but the badge doesn't change as i write in getBadge method.

Disable title for inactive items?

Your first shifting example displays the title active only when the menu item is selected, I can't find how to implement this feature from the library though?

Update: I might have found it? Need to test when I get to school.

Could you possibly post a list of the xml attributes available? They do not show up at all for me in Android Studio through autocompletes and was lucky I found one attribute in the source code that isnt documented. Updated and expanded documentation would be greatly apprecieated, it is really limiting in terms of knowing what I can do with the ui xml and menu xml elements

Disable Labels for all items and only show icons

Is there a way, to disable all labels even for an active item? They are not needed and i have 5 items within the bottom bar.

One of the reasons is that on a selected item the cusom badge gets cut off on the top. And the icons are all easy to understand so no labels are needed

Preserve interface param labels on release

    public interface OnMenuItemSelectionListener {
        void onMenuItemSelect(@IdRes int var1, int var2, boolean var3);

        void onMenuItemReselect(@IdRes int var1, int var2, boolean var3);
    }

is kinda hard to use without digging into the source, I'd advise configuring Proguard to ignore them

in fact, I'm not sure what Proguard would be needed on the library package at all considering it's open source

I'm using 'it.sephiroth.android.library.bottomnavigation:bottom-navigation:2.0.1-rc1'

Ability to avoid item getting selected?

Is it possible to do this or add such a feature? I could do it manually if the previousPosition was exposed with a method like getPrevousSelectedPosition(); or similar.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.