Best code examples for GridView getNumColumns method (android.widget.GridView.getNumColumns)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for GridView getNumColumns method.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

GridView getNumColumns examples from Open Source projects
This code example shows how to use the following methods: getLayoutParams, setLayoutParams, getAdapter, getNumColumns
This code example shows how to use the following methods: getLayoutParams, setLayoutParams, getAdapter, getNumColumns
This code example shows how to use the following methods: getLayoutParams, setLayoutParams, getAdapter, getNumColumns
This code example shows how to use the following methods: getNumColumns
    private int getImageHeight(final GridView gridView) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
            return (int)(gridView.getColumnWidth() * IMAGE_SIZE_RATIO);
 
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
            return (int)((getScreenWidth() / gridView.getNumColumns()) * IMAGE_SIZE_RATIO);
 
        return imgHeight;
    } 
 
    public int getScreenWidth() { 
        if (context == null)
            return 0; 
 
        return getDisplayMetrics().widthPixels;
    } 
 
    public DisplayMetrics getDisplayMetrics() {
        final WindowManager windowManager = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
        final DisplayMetrics metrics = new DisplayMetrics();
Full Snippet Info
4
CodeRank
Related GridView getNumColumns Questions & Answers:
getNumColumns Method Overview
Get the number of columns in the grid.
See Code Examples for other Android GridView Methods: