Inline methods in PreferencesUtils.

Donot want to have a pair of getter and setting for each preference.
This commit is contained in:
Jimmy Shih
2012-05-02 12:23:32 -07:00
parent 81281e560e
commit 234f1f4a0a
25 changed files with 84 additions and 231 deletions
@@ -270,7 +270,7 @@ public class SendDocsUtils {
Track track, String spreadsheetId, String worksheetId, String authToken, Context context)
throws IOException {
String worksheetUri = String.format(GET_WORKSHEET_URI, spreadsheetId, worksheetId);
boolean metricUnits = PreferencesUtils.isMetricUnits(context);
boolean metricUnits = PreferencesUtils.getBoolean(context, R.string.metric_units_key, true);
addRow(worksheetUri, getRowContent(track, metricUnits, context), authToken);
}
@@ -205,7 +205,7 @@ public class SendFusionTablesAsyncTask extends AbstractSendAsyncTask {
private boolean uploadAllTrackPoints(Track track) {
Cursor locationsCursor = null;
try {
boolean metricUnits = PreferencesUtils.isMetricUnits(context);
boolean metricUnits = PreferencesUtils.getBoolean(context, R.string.metric_units_key, true);
locationsCursor = myTracksProviderUtils.getLocationsCursor(trackId, 0, -1, false);
if (locationsCursor == null) {
@@ -258,7 +258,7 @@ public class SendMapsAsyncTask extends AbstractSendAsyncTask {
boolean uploadAllTrackPoints(Track track) {
Cursor locationsCursor = null;
try {
boolean metricUnits = PreferencesUtils.isMetricUnits(context);
boolean metricUnits = PreferencesUtils.getBoolean(context, R.string.metric_units_key, true);
locationsCursor = myTracksProviderUtils.getLocationsCursor(trackId, 0, -1, false);
if (locationsCursor == null) {