app/src/main/java/openfoodfacts/github/scrachx/openfood/fragments/AllergensAlertFragment.java
/*
    public method in order to disable shift mode in the bottom navigation bar
    Can also be resolved by using : app:labelVisibilityMode="labeled" on xml fragment
    if using the library com.android.support:design.28.0.0-alpha1
     */
public method in order to disable shift mode in the bottom navigation bar
Can also be resolved by using : app:labelVisibilityMode="labeled" on xml fragment
if using the library com.android.support:design.28.0.0-alpha1
public method in order to disable shift mode in the bottom navigation bar Can also be resolved by using : app : labelVisibilityMode = " labeled " on xml fragment if using the library com . android . support : design . 28 . 0 . 0 - alpha1
@SuppressLint("RestrictedApi")
    public static void disableShiftMode(BottomNavigationView view) {
        BottomNavigationMenuView menuView = (BottomNavigationMenuView) view.getChildAt(0);
        try {
            Field shiftingMode = menuView.getClass().getDeclaredField("mShiftingMode");
            shiftingMode.setAccessible(true);
            shiftingMode.setBoolean(menuView, false);
            shiftingMode.setAccessible(false);
            for (int i = 0; i < menuView.getChildCount(); i++) {
                BottomNavigationItemView item = (BottomNavigationItemView) menuView.getChildAt(i);
                item.setShiftingMode(false);
                item.setChecked(item.getItemData().isChecked());
            }
        } catch (NoSuchFieldException e) {
        } catch (IllegalAccessException e) {
        }
    }
@ SuppressLint ( "RestrictedApi" ) public static void disableShiftMode ( BottomNavigationView view ) { BottomNavigationMenuView menuView = ( BottomNavigationMenuView ) view . getChildAt ( 0 ) ; try { Field shiftingMode = menuView . getClass ( ) . getDeclaredField ( "mShiftingMode" ) ; shiftingMode . setAccessible ( true ) ; shiftingMode . setBoolean ( menuView , false ) ; shiftingMode . setAccessible ( false ) ; for ( int i = 0 ; i < menuView . getChildCount ( ) ; i ++ ) { BottomNavigationItemView item = ( BottomNavigationItemView ) menuView . getChildAt ( i ) ; item . setShiftingMode ( false ) ; item . setChecked ( item . getItemData ( ) . isChecked ( ) ) ; } } catch ( NoSuchFieldException e ) { } catch ( IllegalAccessException e ) { } }
public method in order to disable shift mode in the bottom navigation bar
Can also be resolved by using : app:labelVisibilityMode="labeled" on xml fragment
if using the library com.android.support:design.28.0.0-alpha1
public method in order to disable shift mode in the bottom navigation bar Can also be resolved by using : app : labelVisibilityMode = " labeled " on xml fragment if using the library com . android . support : design . 28 . 0 . 0 - alpha1