Skip to content

Instantly share code, notes, and snippets.

@emanuelet
emanuelet / ExampleAdapter.java
Last active September 16, 2017 12:20
Generic List Adapter for Firebase
/**
* This class is an example of how to use FirebaseListAdapter. It uses the ExampleObject class to encapsulate the
* data for each individual chat message
*/
public class ExampleAdapter extends FirebaseListAdapter<ExampleObject> {
@InjectView(R.id.example_list_item)
TextView exampleView;
public DealListAdapter(Query ref, Activity activity, int layout) {
super(ref, ExampleObject.class, layout, activity);
@emanuelet
emanuelet / ExampleFragment.java
Created April 11, 2016 04:41
Populating ListView (or RecyclerView) based on Firebase cross-referenced results with a Geofire node
public class ExampleFragment extends Fragment implements GoogleApiClient.ConnectionCallbacks,
GoogleApiClient.OnConnectionFailedListener,
ResultCallback<LocationSettingsResult>,
SharedPreferences.OnSharedPreferenceChangeListener {
private Callbacks mCallbacks;
private Snackbar snackbar;
public interface Callbacks {
/**