• Stars
    star
    1,016
  • Rank 43,634 (Top 0.9 %)
  • Language
    Java
  • Created about 8 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

BottomNavigationView Designed according Google guideLine

Material Bottom Navigation

DEPRECATED

Use offical Bottom Navigation

Android Arsenal

BottomNavigationView

Designed according Google [guideLine][1] [1]: https://www.google.com/design/spec/components/bottom-navigation.html#bottom-navigation-usage [2]: http://luseen.com/ [3]: http://fir.im/luseen?release_id=56feaea800fc741d61000000 By [Luseen][2] Technologies

[Download simple apk][3]

Download

Gradle:

compile 'com.github.armcha:LuseenBottomNavigation:1.8.2'

Maven:

<dependency>
  <groupId>com.github.armcha</groupId>
  <artifactId>LuseenBottomNavigation</artifactId>
  <version>1.8.2</version>
  <type>pom</type>
</dependency>

Usage

Add the BottomNavigationView to your layout

 <com.luseen.luseenbottomnavigation.BottomNavigation.BottomNavigationView
        android:id="@+id/bottomNavigation"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true" />

Add BottomNavigation items

  BottomNavigationView bottomNavigationView = (BottomNavigationView) findViewById(R.id.bottomNavigation);
  
   BottomNavigationItem bottomNavigationItem = new BottomNavigationItem
                ("Record", ContextCompat.getColor(this, R.color.firstColor), R.drawable.ic_mic_black_24dp);
   BottomNavigationItem bottomNavigationItem1 = new BottomNavigationItem
                ("Like", ContextCompat.getColor(this, R.color.secondColor), R.drawable.ic_favorite_black_24dp);
  bottomNavigationView.addTab(bottomNavigationItem);
  bottomNavigationView.addTab(bottomNavigationItem1);

Then set your OnBottomNavigationItemClickListener

 
bottomNavigationView.setOnBottomNavigationItemClickListener(new OnBottomNavigationItemClickListener() {
            @Override
            public void onNavigationItemClick(int index) {
                 Toast.makeText(MainActivity.this, "Item " +index +" clicked", Toast.LENGTH_SHORT).show();
            }
        });

If you are using a ViewPager , you can connect to the BottomNavigationView, Set color in this way, when using view pager:

 ContextCompat.getColor(context, R.color.firstColor)
 bottomNavigationView.setUpWithViewPager(yourPager , colorResources , imageResources);

You can disable slide animation when using viewPager

bottomNavigationView.disableViewPagerSlide();

If your activity/fragment will not recreate and bottom navigation items doubled on orientation change, just can call this method

bottomNavigationView.willNotRecreate(true);

Customize

Customize with xml

  <com.luseen.luseenbottomnavigation.BottomNavigation.BottomNavigationView
         android:id="@+id/bottomNavigation"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_alignParentBottom="true"
         app:bnv_colored_background="true"
         app:bnv_with_text="false"
         app:bnv_shadow="true"
         app:bnv_tablet="false"
         app:bnv_viewpager_slide="true"
         app:bnv_active_color="@color/colorPrimary"
         app:bnv_active_text_size="@dimen/bottom_navigation_text_size_active"
         app:bnv_inactive_text_size="@dimen/bottom_navigation_text_size_inactive"/>

or programmatically

You can activate tablet mode

 bottomNavigationView.activateTabletMode();

 bottomNavigationView.isWithText(true);

 bottomNavigationView.isColoredBackground(false);
 bottomNavigationView.setItemActiveColorWithoutColoredBackground(yourColor);

Change text active or inactive size

  bottomNavigationView.setTextActiveSize(float yoursize);
  bottomNavigationView.setTextInactiveSize(float yoursize);

Change tab programmatically

bottomNavigationView.selectTab(int position);

You can just disable BottomNavigationView shadow by calling

 bottomNavigationView.disableShadow();

You can set your custom font for item text. assets/fonts/your_font.ttf

 bottomNavigationView.setFont(Typeface.createFromAsset(getApplicationContext().getAssets(), "fonts/your_font.ttf"));

Contact

Pull requests are more than welcome.

Please fell free to contact me if there is any problem when using the library.

License

      Copyright 2016 Arman Chatikyan

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

More Repositories

1

Space-Navigation-View

Space Navigation is a library allowing easily integrate fully customizable Google Spaces like navigation to your app.
Java
1,991
star
2

AutoLinkTextView

AutoLinkTextView is TextView that supports Hashtags (#), Mentions (@) , URLs (http://), Phone and Email automatically detecting and ability to handle clicks.
Java
1,122
star
3

Ribble

Simple Dribbble Client using Dribbble API, fully written in Kotlin 😱 ❀️
Kotlin
867
star
4

ElasticView

Elastic view is a regular CardView, which can flex from user touches
Kotlin
597
star
5

ColoredShadowImageView

ColoredShadowImageView allows you to create a beautiful shadow around the image based on corresponding area colors.
Kotlin
464
star
6

PlayTabLayout

PlayTabLayout is a tab layout very similar to Google Play tab layout. The main feature is that ripple shows in a particular place where user taps.
Kotlin
328
star
7

Vertical-Intro

Vertical intro allows you to integrate material vertical intro to your app
Java
320
star
8

AutoLinkTextViewV2

AutoLinkTextView is a TextView that supports automatic detection of Hashtags (#), Mentions (@) , URLs (http://), Phone Nubers and emails
Kotlin
267
star
9

MVP-Architecture-Components

This is a sample project, showing the connection between Android Architecture Components and MVP pattern.
Java
140
star
10

DebugBanner

Debug banner lib allows you to attach debug (πŸ›) banner on all your activities, just by one line of code.
Kotlin
59
star
11

MotionLayout_youtube_animation

Kotlin
56
star
12

MotionLayout_example

Kotlin
54
star
13

DateHelper

Simple dateHelper, which can help you to make your life easier. Just give the date to dateHelper and get it in different formats.
Java
40
star
14

Kadapter

Kotlin
38
star
15

Screenshot-observer

Java
37
star
16

logger

Logger is simple library, which will help you to find your logs easily.
Java
24
star
17

SimplePermissions

This library allows you easily implement Android marshmallow permissions. The list of permissions, if I miss any permission please add and send me pull request.
Java
23
star
18

Easy-Fragment-Argument

This library will help you to pass and receive fragment arguments in easier way
Java
17
star
19

KotlinMultiplatformSample

Kotlin
13
star
20

Firebase-notification-android-client

Java
12
star
21

Firbase-notification-server-php

PHP
10
star
22

Meet-My-App

Java
8
star
23

MaterialTabs

Java
5
star
24

EventsWidget

Kotlin
3
star
25

RecyclerView

Java
2
star
26

room_database_sample

Java
2
star
27

AnimatedBottomBar

Kotlin
1
star
28

AwesomeRepo

Kotlin
1
star
29

MPV_architecture_adaptation

This is the second version of MPV architecture adaptation
Kotlin
1
star
30

RateMyApp

1
star
31

summer_school

Java
1
star
32

ActivityResult

Kotlin
1
star
33

Babylon

Java
1
star