Skip to content

Instantly share code, notes, and snippets.

View teohaik's full-sized avatar

Theodore Chaikalis teohaik

View GitHub Profile
@teohaik
teohaik / Utility.java
Created January 6, 2017 23:05 — forked from udacityandroid/Utility.java
5.03 Forecast Adapter Quiz
// Format used for storing dates in the database. ALso used for converting those strings
// back into date objects for comparison/processing.
public static final String DATE_FORMAT = "yyyyMMdd";
/**
* Helper method to convert the database representation of the date into something to display
* to users. As classy and polished a user experience as "20140102" is, we can do better.
*
* @param context Context to use for resource localization
* @param dateInMillis The date in milliseconds
@teohaik
teohaik / ForecastAdapter.java
Created January 6, 2017 23:04 — forked from udacityandroid/ForecastAdapter.java
5.03 Hint for bindView
/*
This is where we fill-in the views with the contents of the cursor.
*/
@Override
public void bindView(View view, Context context, Cursor cursor) {
// our view is pretty simple here --- just a text view
// we'll keep the UI functional with a simple (and slow!) binding.
// Read weather icon ID from cursor
int weatherId = cursor.getInt(ForecastFragment.COL_WEATHER_ID);