app/src/main/java/com/mensa/zhmensa/activities/MainActivity.java
/**
     * Selects a given mensa and displays its menus inside the cards.
     * Gets called when a mensa from the sidebar is selected
     *
     * @param mensa the mensa which should be shown
     */
Selects a given mensa and displays its menus inside the cards.
Gets called when a mensa from the sidebar is selected

@param mensa the mensa which should be shown
Selects a given mensa and displays its menus inside the cards . Gets called when a mensa from the sidebar is selected @param mensa the mensa which should be shown
private void selectMensa(@Nullable Mensa mensa) {
        if (mensa == null) {
            Log.d("selectMensa", "Mensa was null");
            return;
        }
        selectedMensa = mensa;
        Log.d("Select Mensa: ", "Mensa: " + mensa.toString());
        getSupportActionBar().setTitle(mensa.getDisplayName());
        int pos = getMensaPosForId(mensa.getUniqueId());
        if (pos == -1) {
            Log.e("MainActivity.select", "got invalid mensa id: " + mensa.getUniqueId());
            return;
        }
        if (viewPager.getAdapter().getCount() > pos)
            viewPager.setCurrentItem(pos);
        else
            Log.e("MainActivity.selectM", "Position : " + pos + " is not stored in veiwpager");
    }
private void selectMensa ( @ Nullable Mensa mensa ) { if ( mensa == null ) { Log . d ( "selectMensa" , "Mensa was null" ) ; return ; } selectedMensa = mensa ; Log . d ( "Select Mensa: " , "Mensa: " + mensa . toString ( ) ) ; getSupportActionBar ( ) . setTitle ( mensa . getDisplayName ( ) ) ; int pos = getMensaPosForId ( mensa . getUniqueId ( ) ) ; if ( pos == - 1 ) { Log . e ( "MainActivity.select" , "got invalid mensa id: " + mensa . getUniqueId ( ) ) ; return ; } if ( viewPager . getAdapter ( ) . getCount ( ) > pos ) viewPager . setCurrentItem ( pos ) ; else Log . e ( "MainActivity.selectM" , "Position : " + pos + " is not stored in veiwpager" ) ; }
Selects a given mensa and displays its menus inside the cards.
Selects a given mensa and displays its menus inside the cards .