app/src/main/java/nerd/tuxmobil/fahrplan/congress/schedule/HorizontalSnapScrollView.java
/**
     * Calculates the number of columns to display at a time based on the physical dimensions and
     * the screen density of the device and the column count of the schedule. Further limiting
     * factors are a maximum column count to be displayed and a minimum column width.
     */
Calculates the number of columns to display at a time based on the physical dimensions and
the screen density of the device and the column count of the schedule. Further limiting
factors are a maximum column count to be displayed and a minimum column width.
Calculates the number of columns to display at a time based on the physical dimensions and the screen density of the device and the column count of the schedule . Further limiting factors are a maximum column count to be displayed and a minimum column width .
@VisibleForTesting
    public static int calculateDisplayColumnCount(
            int availablePixels,
            int columnsCount,
            int maxColumnCountForLayout,
            float densityScaleFactor,
            int minColumnWidthDip
    ) {
        int columnCountLimit = Math.min(columnsCount, maxColumnCountForLayout);
        if (columnCountLimit == 1) {
            return 1;
        }
        float availableDips = ((float) availablePixels) / densityScaleFactor;
        int minWidthColumnCount = (int) Math.floor(availableDips / minColumnWidthDip);
        int columnCount = Math.min(minWidthColumnCount, columnCountLimit);
        return Math.max(1, columnCount);
    }
@ VisibleForTesting public static int calculateDisplayColumnCount ( int availablePixels , int columnsCount , int maxColumnCountForLayout , float densityScaleFactor , int minColumnWidthDip ) { int columnCountLimit = Math . min ( columnsCount , maxColumnCountForLayout ) ; if ( columnCountLimit == 1 ) { return 1 ; } float availableDips = ( ( float ) availablePixels ) / densityScaleFactor ; int minWidthColumnCount = ( int ) Math . floor ( availableDips / minColumnWidthDip ) ; int columnCount = Math . min ( minWidthColumnCount , columnCountLimit ) ; return Math . max ( 1 , columnCount ) ; }
Calculates the number of columns to display at a time based on the physical dimensions and
 the screen density of the device and the column count of the schedule.
Calculates the number of columns to display at a time based on the physical dimensions and the screen density of the device and the column count of the schedule .