Skip to content

JJdeGroot/AutoGridView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

AutoGridView

The solution of Android GridView overlap. Explanation: http://obduro.nl/blog/the-solution-of-android-gridview-overlap/

Usage

It is really simple, just define the AutoGridView in XML like you would with a normal GridView. Make sure you set the “android:numColumns” value to a valid integer resource, and you are good to go.

<nl.obduro.views.AutoGridView
        android:id="@+id/activity_version_GridView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:listSelector="@drawable/selector"
        android:numColumns="@integer/pair_cols"
        android:stretchMode="columnWidth">
</nl.obduro.views.AutoGridView>

Attaching an adapter or listener is exactly the same as a GridView as well.

AutoGridView grid = (AutoGridView) findViewById(R.id.activity_version_GridView);
PairAdapter adapter = new PairAdapter(getBaseContext(), -1, list);
grid.setAdapter(adapter);

About

Solution to Android GridView overlap

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages