Skip to content

Instantly share code, notes, and snippets.

View kevinmrohr's full-sized avatar

Kevin Rohr kevinmrohr

View GitHub Profile
[
{'id': '1', 'name': 'Costco', 'address':'999 Lake Drive, Issaquah, WA 98027'},
{'id': '2', 'name': 'Walmart', 'address' : '702 SW 8th St, Bentonville, AR 72716'},
{'id': '3', 'name': 'Kroger', 'address' : '1014 Vine St, Cincinnati, OH 45202'},
{'id': '4', 'name': 'Lowes', 'address' : '1000 Lowe\'s Blvd, Mooresville, NC 2811'}
]
@kevinmrohr
kevinmrohr / StateManager
Last active December 25, 2015 21:48
Utility class to standardize pulling state off a Bundle, Intent, or data source in Android apps. Also provides timeout functionality for if the data has expired.
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import org.joda.time.DateTime;
import java.io.Serializable;
import static org.joda.time.DateTime.now;
/**
@kevinmrohr
kevinmrohr / BindingAdapter.java
Last active December 25, 2015 21:39 — forked from patrickhammond/BindingAdapter.java
BindingAdapter now receives a List (could be a Collection if we want to make it more generic), and provides default implementations of getItem(), getCount() and getItemId()
import java.util.List;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
/**
* An implementation of {@link android.widget.BaseAdapter} which uses the new/bind pattern and