This method initiates the bottomNavigationBar and handles layout related values
545304
private void init() {

//        MarginLayoutParams marginParams = new ViewGroup.MarginLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (int) getContext().getResources().getDimension(R.dimen.bottom_navigation_padded_height)));
//        marginParams.setMargins(0, (int) getContext().getResources().getDimension(R.dimen.bottom_navigation_top_margin_correction), 0, 0);

        setLayoutParams(new ViewGroup.LayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)));

        LayoutInflater inflater = LayoutInflater.from(getContext());
        View parentView = inflater.inflate(R.layout.bottom_navigation_bar_container, this, true);
        mBackgroundOverlay = parentView.findViewById(R.id.bottom_navigation_bar_overLay);
        mContainer = parentView.findViewById(R.id.bottom_navigation_bar_container);
        mTabContainer = parentView.findViewById(R.id.bottom_navigation_bar_item_container);

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            this.setOutlineProvider(ViewOutlineProvider.BOUNDS);
        } else {
            //to do
        }

        ViewCompat.setElevation(this, mElevation);
        setClipToPadding(false);
    }
487166
public void addNavButtons()
    {
        new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, MenuConstants.FORMDETAIL, MenuConstants.FORMDETAIL, null);
        super.addNavButtons();  // Next buttons will be "First!"
    }
350437
@OnLifecycleEvent(Lifecycle.Event.ON_START)
  public void onStart() {
    if (navigation != null) {
      navigation.addProgressChangeListener(progressChangeListener);
    }
  }
1113182
public final void setNavigationWidth(@Px final int width) {
        Condition.INSTANCE.ensureGreater(width, 0, "The width must be greater than 0");
        this.navigationWidth = width;

        if (!isNavigationHidden()) {
            RelativeLayout.LayoutParams layoutParams =
                    (RelativeLayout.LayoutParams) toolbar.getLayoutParams();
            layoutParams.width = width;
            toolbar.requestLayout();
        }
    }
1258248
@SuppressLint("NewApi")
    private void buildAndAttach(){
        // Disable any pending transition on the activity since we are transforming it
        mActivity.overridePendingTransition(0, 0);

        // Setup window flags if Lollipop
        if(BuildUtils.isLollipop()) {
            Window window = mActivity.getWindow();
            window.addFlags(FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
            window.setStatusBarColor(Color.TRANSPARENT);
        }

        // attach layout and pane to UI
        hiJackDecor();

        // Setup
        setupDrawer();

        // Populate and Inflate
        populateNavDrawer();

    }
312389
function () {
			BaseController.prototype.onInit.call(this);

			// manually call the handler once at startup as device API won't do this for us
			this._onOrientationChange({
				landscape: Device.orientation.landscape
			});

			this.getRouter().getRoute("tools").attachPatternMatched(this._onMatched, this);
		}
541764
private void initializeShowBottomSheetPreference() {
        Preference showBottomSheetPreference =
                findPreference(getString(R.string.show_bottom_sheet_preference_key));
        showBottomSheetPreference.setOnPreferenceClickListener(new OnPreferenceClickListener() {

            @Override
            public boolean onPreferenceClick(final Preference preference) {
                initializeBottomSheet();
                bottomSheet.show();
                return true;
            }

        });
    }
505226
private void initializeBackground() {
    if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP) {
      int navigationViewBannerBackgroundColor = ThemeSwitcher.retrieveThemeColor(getContext(),
        R.attr.navigationViewBannerBackground);
      int navigationViewListBackgroundColor = ThemeSwitcher.retrieveThemeColor(getContext(),
        R.attr.navigationViewListBackground);
      // Instruction Layout landscape - banner background
      if (isLandscape()) {
        View instructionLayoutManeuver = findViewById(R.id.instructionManeuverLayout);
        Drawable maneuverBackground = DrawableCompat.wrap(instructionLayoutManeuver.getBackground()).mutate();
        DrawableCompat.setTint(maneuverBackground, navigationViewBannerBackgroundColor);

        View subStepLayout = findViewById(R.id.subStepLayout);
        Drawable subStepBackground = DrawableCompat.wrap(subStepLayout.getBackground()).mutate();
        DrawableCompat.setTint(subStepBackground, navigationViewListBackgroundColor);

        View turnLaneLayout = findViewById(R.id.turnLaneLayout);
        Drawable turnLaneBackground = DrawableCompat.wrap(turnLaneLayout.getBackground()).mutate();
        DrawableCompat.setTint(turnLaneBackground, navigationViewListBackgroundColor);
      }
    }
  }
496964
private void handleShowOnLaunch() {
        //check if it should be shown on launch (and we have a drawerLayout)
        if (mActivity != null && mDrawerLayout != null) {
            if (mShowDrawerOnFirstLaunch || mShowDrawerUntilDraggedOpened) {
                final SharedPreferences preferences = mSharedPreferences != null ? mSharedPreferences : PreferenceManager.getDefaultSharedPreferences(mActivity);

                if (mShowDrawerOnFirstLaunch && !preferences.getBoolean(Drawer.PREF_USER_LEARNED_DRAWER, false)) {
                    //if it was not shown yet
                    //open the drawer
                    mDrawerLayout.openDrawer(mSliderLayout);

                    //save that it showed up once ;)
                    SharedPreferences.Editor editor = preferences.edit();
                    editor.putBoolean(Drawer.PREF_USER_LEARNED_DRAWER, true);
                    editor.apply();

                } else if (mShowDrawerUntilDraggedOpened && !preferences.getBoolean(Drawer.PREF_USER_OPENED_DRAWER_BY_DRAGGING, false)) {
                    // open the drawer since the user has not dragged it open yet
                    mDrawerLayout.openDrawer(mSliderLayout);

                    // add a listener to detect dragging
                    mDrawerLayout.addDrawerListener(new DrawerLayout.SimpleDrawerListener() {
                        boolean hasBeenDragged = false;

                        @Override
                        public void onDrawerStateChanged(int newState) {
                            if (newState == DrawerLayout.STATE_DRAGGING) {
                                // save that the user was dragging
                                hasBeenDragged = true;

                            } else if (newState == DrawerLayout.STATE_IDLE) {
                                // check if the user was dragging and if that resulted in an open drawer
                                if (hasBeenDragged && mDrawerLayout.isDrawerOpen(mDrawerGravity)) {
                                    // Save that the user has dragged it open
                                    SharedPreferences.Editor editor = preferences.edit();
                                    editor.putBoolean(Drawer.PREF_USER_OPENED_DRAWER_BY_DRAGGING, true);
                                    editor.apply();
                                } else {
                                    // reset the drag boolean
                                    hasBeenDragged = false;
                                }
                            }
                        }
                    });
                }
            }
        }
    }
529827
private void initializeAppearanceNavigationPreference(
            @NonNull final PreferenceFragmentCompat fragment) {
        String key = getString(R.string.appearance_navigation_preference_key);
        NavigationPreference navigationPreference =
                (NavigationPreference) fragment.findPreference(key);
        Bundle extras = new Bundle();
        extras.putBoolean(PreferenceFragment.EXTRA_SHOW_RESTORE_DEFAULTS_BUTTON, true);
        navigationPreference.setExtras(extras);

    }
269065
private void showToolbarNavigationIcon() {
        if (isPreferenceFragmentShown() && isNavigationIconOverridden() && !isNavigationHidden() &&
                !(!isSplitScreen() && isButtonBarShown())) {
            displayHomeAsUp = isDisplayHomeAsUpEnabled();
            ActionBar actionBar = getSupportActionBar();

            if (actionBar != null) {
                actionBar.setDisplayHomeAsUpEnabled(true);
            }
        }
    }
1308159
private void initContentView(LayoutInflater inflater, View header, boolean fixedHeader, View footer,
                               boolean fixedFooter, BaseAdapter adapter, int[] padding, int[] margin) {
    View contentView = createView(inflater, header, fixedHeader, footer, fixedFooter, adapter);
    FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
        ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT
    );
    params.setMargins(margin[0], margin[1], margin[2], margin[3]);
    contentView.setLayoutParams(params);
    getHolderView().setPadding(padding[0], padding[1], padding[2], padding[3]);
    contentContainer.addView(contentView);
  }
882553
private void updateFabTranslationForBottomNavigationBar(CoordinatorLayout parent, FloatingActionButton fab, View dependency) {

        float snackBarTranslation = getFabTranslationYForSnackBar(parent, fab);
        float[] bottomBarParameters = getFabTranslationYForBottomNavigationBar(parent, fab);
        float bottomBarTranslation = bottomBarParameters[0];
        float bottomBarHeight = bottomBarParameters[1];

        float targetTransY;
        if (snackBarTranslation >= bottomBarTranslation) {
            // when snackBar is below BottomBar in translation present.
            targetTransY = bottomBarTranslation;
        } else {
            targetTransY = snackBarTranslation;
        }

//        if (mFabBehaviour == BottomNavigationBar.FAB_BEHAVIOUR_DISAPPEAR) {
//            if (targetTransY == 0) {
//                fab.hide();
//            } else {
//                fab.show();
//            }
//        }

        final float currentTransY = fab.getTranslationY();

        // Make sure that any current animation is cancelled
        ensureOrCancelAnimator(fab);


        if (fab.isShown()
                && Math.abs(currentTransY - targetTransY) > (fab.getHeight() * 0.667f)) {
            // If the FAB will be travelling by more than 2/3 of it's height, let's animate it instead
            mFabTranslationYAnimator.translationY(targetTransY).start();
        } else {
            // Now update the translation Y
            fab.setTranslationY(targetTransY);
        }
    }
1115118
private void initializeNavigationWidth(final SharedPreferences sharedPreferences) {
        String key = getString(R.string.navigation_width_preference_key);
        String defaultValue = getString(R.string.navigation_width_preference_default_value);
        int width = Integer.valueOf(sharedPreferences.getString(key, defaultValue));
        setNavigationWidth(dpToPixels(this, width));
    }
1199688
def init_layout(self):
        
        super(AndroidViewGroup, self).init_layout()
        widget = self.widget
        i = 0
        for child in self.children():
            child_widget = child.widget
            if child_widget:
                if child.layout_params:
                    widget.addView_(child_widget, i,
                                             child.layout_params)
                else:
                    widget.addView(child_widget, i)
                i += 1

        # Force layout using the default params
        if not self.layout_params:
            self.set_layout({})
675191
private void initialize() {
        LayoutInflater inflater = LayoutInflater.from(getContext());
        inflater.inflate(R.layout.color_palette_item, this, true);
        colorView = findViewById(R.id.color_view);
        selectionView = findViewById(R.id.selection_view);
        adaptSelectionView();
    }
675852
protected void addNavigationBarHeader(Content body) {
        Content htmlTree = (configuration.allowTag(HtmlTag.HEADER))
                ? HtmlTree.HEADER()
                : body;
        addTop(htmlTree);
        addNavLinks(true, htmlTree);
        if (configuration.allowTag(HtmlTag.HEADER)) {
            body.addContent(htmlTree);
        }
    }