Skip to content

Instantly share code, notes, and snippets.

View cirion's full-sized avatar

Chris King cirion

View GitHub Profile

Keybase proof

I hereby claim:

  • I am cirion on github.
  • I am chris_king (https://keybase.io/chris_king) on keybase.
  • I have a public key ASARvo9Dwo2ZHR2HfYmnP7RXkpvkj9GITxbL_eBfFPg3jAo

To claim this, I am signing this object:

@cirion
cirion / gist:5302925
Created April 3, 2013 16:40
Sample book item for the sectioned grid adapter demo
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="190dp"
android:layout_height="190dp"
android:orientation="vertical"
android:padding="8dp"
>
<TextView
android:id="@+id/bookItem_title"
android:layout_width="match_parent"
@cirion
cirion / gist:5302898
Created April 3, 2013 16:37
A sectioned grid row with a variable number of columns
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/bookRow_itemHolder"
>
<include layout="@layout/book_item_vary_columns"/>
<include layout="@layout/book_item_vary_columns"/>
<include layout="@layout/book_item_vary_columns"/>
<include layout="@layout/book_item_vary_columns"/>
@cirion
cirion / gist:5302889
Created April 3, 2013 16:35
A 2-column row for a sectioned grid
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/bookRow_itemHolder"
>
<include layout="@layout/book_item"/>
<include layout="@layout/book_item"/>
</LinearLayout>
@cirion
cirion / getCount.java
Created October 24, 2012 17:47
Sectioned Grid getCount()
@Override
public int getCount()
{
int totalCount = 0;
for (int i = 0; i < sectionsCount; ++i)
{
int count = getCountInSection(i);
if (count > 0)
totalCount += (getCountInSection(i)-1) / colCount + 1;
}