public void initialise(){
  mSelectedPosition=DEFAULT_SELECTED_POSITION;
  mBottomNavigationTabs.clear();
  if (!mBottomNavigationItems.isEmpty()) {
    mTabContainer.removeAllViews();
    if (mMode == MODE_DEFAULT) {
      if (mBottomNavigationItems.size() <= MIN_SIZE) {
        mMode=MODE_FIXED;
      }
 else {
        mMode=MODE_SHIFTING;
      }
    }
    if (mBackgroundStyle == BACKGROUND_STYLE_DEFAULT) {
      if (mMode == MODE_FIXED) {
        mBackgroundStyle=BACKGROUND_STYLE_STATIC;
      }
 else {
        mBackgroundStyle=BACKGROUND_STYLE_RIPPLE;
      }
    }
    if (mBackgroundStyle == BACKGROUND_STYLE_STATIC) {
      mBackgroundOverlay.setVisibility(View.GONE);
      mContainer.setBackgroundColor(mBackgroundColor);
    }
    int screenWidth=Utils.getScreenWidth(getContext());
    if (mMode == MODE_FIXED) {
      int[] widths=BottomNavigationHelper.getMeasurementsForFixedMode(getContext(),screenWidth,mBottomNavigationItems.size(),mScrollable);
      int itemWidth=widths[0];
      for (      BottomNavigationItem currentItem : mBottomNavigationItems) {
        FixedBottomNavigationTab bottomNavigationTab=new FixedBottomNavigationTab(getContext());
        setUpTab(bottomNavigationTab,currentItem,itemWidth,itemWidth);
      }
    }
 else     if (mMode == MODE_SHIFTING) {
      int[] widths=BottomNavigationHelper.getMeasurementsForShiftingMode(getContext(),screenWidth,mBottomNavigationItems.size(),mScrollable);
      int itemWidth=widths[0];
      int itemActiveWidth=widths[1];
      for (      BottomNavigationItem currentItem : mBottomNavigationItems) {
        ShiftingBottomNavigationTab bottomNavigationTab=new ShiftingBottomNavigationTab(getContext());
        setUpTab(bottomNavigationTab,currentItem,itemWidth,itemActiveWidth);
      }
    }
    if (mBottomNavigationTabs.size() > mFirstSelectedPosition) {
      selectTabInternal(mFirstSelectedPosition,true,false,false);
    }
 else     if (!mBottomNavigationTabs.isEmpty()) {
      selectTabInternal(0,true,false,false);
    }
  }
}

public void initialise ( ) { mSelectedPosition = DEFAULT_SELECTED_POSITION ; mBottomNavigationTabs . clear ( ) ; if ( ! mBottomNavigationItems . isEmpty ( ) ) { mTabContainer . removeAllViews ( ) ; if ( mMode == MODE_DEFAULT ) { if ( mBottomNavigationItems . size ( ) <= MIN_SIZE ) { mMode = MODE_FIXED ; } else { mMode = MODE_SHIFTING ; } } if ( mBackgroundStyle == BACKGROUND_STYLE_DEFAULT ) { if ( mMode == MODE_FIXED ) { mBackgroundStyle = BACKGROUND_STYLE_STATIC ; } else { mBackgroundStyle = BACKGROUND_STYLE_RIPPLE ; } } if ( mBackgroundStyle == BACKGROUND_STYLE_STATIC ) { mBackgroundOverlay . setVisibility ( View . GONE ) ; mContainer . setBackgroundColor ( mBackgroundColor ) ; } int screenWidth = Utils . getScreenWidth ( getContext ( ) ) ; if ( mMode == MODE_FIXED ) { int [ ] widths = BottomNavigationHelper . getMeasurementsForFixedMode ( getContext ( ) , screenWidth , mBottomNavigationItems . size ( ) , mScrollable ) ; int itemWidth = widths [ 0 ] ; for ( BottomNavigationItem currentItem : mBottomNavigationItems ) { FixedBottomNavigationTab bottomNavigationTab = new FixedBottomNavigationTab ( getContext ( ) ) ; setUpTab ( bottomNavigationTab , currentItem , itemWidth , itemWidth ) ; } } else if ( mMode == MODE_SHIFTING ) { int [ ] widths = BottomNavigationHelper . getMeasurementsForShiftingMode ( getContext ( ) , screenWidth , mBottomNavigationItems . size ( ) , mScrollable ) ; int itemWidth = widths [ 0 ] ; int itemActiveWidth = widths [ 1 ] ; for ( BottomNavigationItem currentItem : mBottomNavigationItems ) { ShiftingBottomNavigationTab bottomNavigationTab = new ShiftingBottomNavigationTab ( getContext ( ) ) ; setUpTab ( bottomNavigationTab , currentItem , itemWidth , itemActiveWidth ) ; } } if ( mBottomNavigationTabs . size ( ) > mFirstSelectedPosition ) { selectTabInternal ( mFirstSelectedPosition , true , false , false ) ; } else if ( ! mBottomNavigationTabs . isEmpty ( ) ) { selectTabInternal ( 0 , true , false , false ) ; } } }
this method should be called at the end of all customisation method . this method will take all changes in to consideration and redraws tabs .
