All Projects → irfaan008 → IRBottomNavigationView

irfaan008 / IRBottomNavigationView

Licence: other
Floating Bottom Navigation/Tab System

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to IRBottomNavigationView

BetterBottomBar
Fork of the BottomNavigationView from the design lib to allow for view state, accessibility and colorful animations
Stars: ✭ 33 (-31.25%)
Mutual labels:  bottombar, bottomnavigationview
Bubble Navigation
🎉 [Android Library] A light-weight library to easily make beautiful Navigation Bar with ton of 🎨 customization option.
Stars: ✭ 1,537 (+3102.08%)
Mutual labels:  bottomnavigationview, navigationbar
Animatedbottombar
A customizable and easy to use BottomBar navigation view with sleek animations, with support for ViewPager, ViewPager2, NavController, and badges.
Stars: ✭ 797 (+1560.42%)
Mutual labels:  bottombar, navigationbar
BottomNavygation
Bottom Navigation based on Bottom Navigation View from Android
Stars: ✭ 62 (+29.17%)
Mutual labels:  bottombar, bottomnavigationview
BottomNavigationBar
A light bottom navigation bar in Android supporting Tint mode.
Stars: ✭ 48 (+0%)
Mutual labels:  bottomnavigationview, navigationbar
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 (+393.75%)
Mutual labels:  bottomnavigationview
BottomNavigationCircularColorReveal
Build a BottomNavigationView with a circular color reveal animation like in Material Design guidelines demos.
Stars: ✭ 24 (-50%)
Mutual labels:  bottomnavigationview
LLNavigationController
This is a subClass Of UINavigationController.本导航条继承UINavigationController,自定义滑动返回手势与滑动动画,同时可自定义过场动画,解决了手势共存时的冲突。在系统类的基础上进行扩展,节约性能,无任何代码耦合度,可随时集成与剥离。支持iOS7以上系统,兼容iOS11,版本稳定。
Stars: ✭ 20 (-58.33%)
Mutual labels:  navigationbar
Fluent-Design
Microsoft's Fluent Design with pure HTML/CSS/JS
Stars: ✭ 36 (-25%)
Mutual labels:  navigationbar
bottomnavigationviewex-android-binding
Xamarin.Android Binding Library for Ittianyu BottomNavigationViewEx
Stars: ✭ 25 (-47.92%)
Mutual labels:  bottomnavigationview
BottomNavigation-RichPath-Sample
BottomNavigation RichPath Sample
Stars: ✭ 76 (+58.33%)
Mutual labels:  bottomnavigationview
flutter-bottomAppBar
Watch the tutorial video on Youtube ->
Stars: ✭ 15 (-68.75%)
Mutual labels:  bottomnavigationview
react-native-detect-navbar-android
React Native module that tells if android device has soft navigation bar.
Stars: ✭ 14 (-70.83%)
Mutual labels:  navigationbar
react-native-floating-action-bar
A React Native floating action bar.
Stars: ✭ 39 (-18.75%)
Mutual labels:  navigationbar
WaveSideBar
Animated side bar view
Stars: ✭ 38 (-20.83%)
Mutual labels:  navigationbar
WXNavigationBar
Handle UINavigationBar like WeChat. Simple and easy to use.
Stars: ✭ 116 (+141.67%)
Mutual labels:  navigationbar
bsnav
An extended Bootstrap 4 menu with a bunch of utilities
Stars: ✭ 90 (+87.5%)
Mutual labels:  navigationbar
angular-scrollspy
A simple lightweight library for Angular which automatically updates links to indicate the currently active section in the viewport
Stars: ✭ 34 (-29.17%)
Mutual labels:  navigationbar
BottomNavArchDemo
The demo project for Bottom Navigation with Navigation Architecture Components article
Stars: ✭ 53 (+10.42%)
Mutual labels:  bottomnavigationview
BottomNavigationView
Bottom Navigation Example
Stars: ✭ 15 (-68.75%)
Mutual labels:  bottomnavigationview

Space-Navigation-View

Android Arsenal Buy Me a Coffee at ko-fi.com

Introduction


IR Bottom Navigation is a library allowing easily integrate fully customizable Google [Spaces][1] like navigation to your app. [1]: https://play.google.com/store/apps/details?id=com.google.android.apps.social.spaces

The current minSDK version is API level 14 Android 4.0 (ICE CREAM SANDWICH).

YouTube demos

Demo 1

Demo 1

Demo 2

Demo 2

Download magic


Gradle:

compile 'com.github.irfaan008:IRBottomNavigationView:1.0.1'

Setup and usage


Add the IR Bottom Navigation view to your layout

 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="match_parent">
     
      <...View
             ....
             android:layout_marginBottom="@dimen/view_bottom_margin" />
             
      <com.irfaan008.irbottomnavigation.SpaceNavigationView
             android:id="@+id/space"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:layout_gravity="bottom"/>
             
 </FrameLayout>

Add IR Bottom Navigation items.

   SpaceNavigationView spaceNavigationView = (SpaceNavigationView) findViewById(R.id.space);
   spaceNavigationView.initWithSaveInstanceState(savedInstanceState);
   spaceNavigationView.addSpaceItem(new SpaceItem("HOME", R.drawable.yourDrawable));
   spaceNavigationView.addSpaceItem(new SpaceItem("SEARCH", R.drawable.yourDrawable));

Use initWithSaveInstanceState(savedInstanceState) and override onSaveInstanceState if you want to keep selected item position and badge on device rotation

       @Override
       protected void onSaveInstanceState(Bundle outState) {
           super.onSaveInstanceState(outState);
           spaceNavigationView.onSaveInstanceState(outState);
       }

Set onClick listener

   spaceNavigationView.setSpaceOnClickListener(new SpaceOnClickListener() {
            @Override
            public void onCentreButtonClick() {
               Toast.makeText(MainActivity.this,"onCentreButtonClick", Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onItemClick(int itemIndex, String itemName) {
               Toast.makeText(MainActivity.this, itemIndex + " " + itemName, Toast.LENGTH_SHORT).show();
            }
            
             @Override
             public void onItemReselected(int itemIndex, String itemName) {
               Toast.makeText(MainActivity.this, itemIndex + " " + itemName, Toast.LENGTH_SHORT).show();           
            }
        });

Set onLongClick listener

    spaceNavigationView.setSpaceOnLongClickListener(new SpaceOnLongClickListener() {
            @Override
            public void onCentreButtonLongClick() {
                Toast.makeText(MainActivity.this,"onCentreButtonLongClick", Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onItemLongClick(int itemIndex, String itemName) {
                Toast.makeText(MainActivity.this, itemIndex + " " + itemName, Toast.LENGTH_SHORT).show();
            }
        });

Customize

Customize with xml

 <com.irfaan008.irbottomnavigation.SpaceNavigationView
        android:id="@+id/space"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="bottom"
        app:active_item_color="@color/colorAccent"
        app:centre_button_color="@color/centre_button_color"
        app:inactive_item_color="@color/white"
        app:space_background_color="@color/colorPrimary"
        app:centre_button_icon="@drawable/my_drawable"
        app:space_item_icon_size="@dimen/space_item_icon_default_size"
        app:space_item_icon_only_size="@dimen/space_item_icon_only_size"
        app:space_item_text_size="@dimen/space_item_text_default_size" />
Attribute Description
active_item_color item color when selected
inactive_item_color item color when unselected
centre_button_color centre circle button color
space_background_color space view background color
space_item_icon_size item icon size
space_item_icon_only_size item icon size on showIconOnly() mode
space_item_text_size item text size
centre_button_icon allow changing center icon from layout

Change IR Bottom Navigation background

spaceNavigationView.setSpaceBackgroundColor(ContextCompat.getColor(this, R.color.yourColor));

Change centre button icon

spaceNavigationView.setCentreButtonIcon(R.drawable.yourDrawable);

Change centre button background color

spaceNavigationView.setCentreButtonColor(ContextCompat.getColor(this, R.color.yourColor));

Change selected item text and icon color

spaceNavigationView.setActiveSpaceItemColor(ContextCompat.getColor(this, R.color.yourColor));

Change unselected item text and icon color

spaceNavigationView.setInActiveSpaceItemColor(ContextCompat.getColor(this, R.color.yourColor));

Change space item icon size

spaceNavigationView.setSpaceItemIconSize((int) getResources().getDimension(R.dimen.yourDimen));

Change space item icon size when showIconOnly(); mode activated

spaceNavigationView.setSpaceItemIconSizeInOnlyIconMode((int) getResources().getDimension(R.dimen.yourDimen));

Change space item text size

spaceNavigationView.setSpaceItemTextSize((int) getResources().getDimension(R.dimen.yourDimen));

Hide items text and show only icons

spaceNavigationView.showIconOnly();

Hide items icon and show only texts

spaceNavigationView.showTextOnly();

You can change selected item programmatically

spaceNavigationView.changeCurrentItem(int tabIndexToSelect);

Show badge

spaceNavigationView.showBadgeAtIndex(int itemIndexToShowBadge, int badgeCountText, int badgeBackgroundColor);

Hide badge at index

spaceNavigationView.hideBadgeAtIndex(int itemIndexToHideBadge);

Hide all badges

spaceNavigationView.hideAllBadges();

Change badge text

spaceNavigationView.changeBadgeTextAtIndex(int itemIndexToChangeBadge, int badgeCountText);

Set your custom font

spaceNavigationView.setFont(Typeface.createFromAsset(getAssets(), "your_cutom_font.ttf"));

Set centre button pressed state color

spaceNavigationView.setCentreButtonRippleColor(ContextCompat.getColor(this, R.color.yourColor));

Now you can change centre button icon if IR Bottom Navigation view already set up

spaceNavigationView.changeCenterButtonIcon(R.drawable.yourDrawable);

Also you can change item text and icon if IR Bottom Navigation view already set up

spaceNavigationView.changeItemTextAtPosition(0, "NEW TEXT");
spaceNavigationView.changeItemIconAtPosition(1, R.drawable.yourDrawable);

Now you can change IR Bottom Navigation view background color if it already set up

 spaceNavigationView.changeSpaceBackgroundColor(ContextCompat.getColor(context,R.color.yourColor));

If you want to show full badge text or show 9+

spaceNavigationView.shouldShowFullBadgeText(true);

Set centre button icon color

spaceNavigationView.setCentreButtonIconColor(ContextCompat.getColor(context,R.color.yourColor));

If you want to disable default white color filter, just call

spaceNavigationView.setCentreButtonIconColorFilterEnabled(false);

Add recycler view scroll behavior

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=iirfaan008
    <android.support.v7.widget.RecyclerView
        android:id="@+id/recyclerView"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <com.irfaan008.irbottomnavigation.SpaceNavigationView
        android:id="@+id/space"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        app:layout_behavior="com.irfaan008.irbottomnavigation.SpaceNavigationViewBehavior" />

Contact

Pull requests are more than welcome. Please fell free to contact me if there is any problem when using the library.

License

  IR Bottom Navigation library for Android
  Copyright (c) 2018 Irfan Raza 
  
  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.
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].