This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!-- Layout for weather forecast list item for future day (not today) --> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:gravity="center_vertical" | |
android:minHeight="?android:attr/listPreferredItemHeight" | |
android:orientation="horizontal" | |
android:padding="16dp"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Utility { | |
public static String getPreferredLocation(Context context) { | |
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); | |
return prefs.getString(context.getString(R.string.pref_location_key), | |
context.getString(R.string.pref_location_default)); | |
} | |
public static boolean isMetric(Context context) { | |
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); | |
return prefs.getString(context.getString(R.string.pref_units_key), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ForecastAdapter extends CursorAdapter { | |
public ForecastAdapter(Context context, Cursor c, int flags) { | |
super(context, c, flags); | |
} | |
/* | |
Remember that these views are reused as needed. | |
*/ | |
@Override | |
public View newView(Context context, Cursor cursor, ViewGroup parent) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!-- Layout for weather forecast list item for today --> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:gravity="center_vertical" | |
android:minHeight="?android:attr/listPreferredItemHeight" | |
android:orientation="horizontal" | |
android:padding="16dp"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!-- Layout for weather forecast list item for future day (not today) --> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:gravity="center_vertical" | |
android:minHeight="?android:attr/listPreferredItemHeight" | |
android:orientation="horizontal" | |
android:padding="16dp"> |
NewerOlder