Move Stats settings to StatsSettingsActivity.

This commit is contained in:
Jimmy Shih
2012-05-07 13:38:17 -07:00
parent 77903ed2c9
commit 3461a50288
30 changed files with 320 additions and 368 deletions
@@ -68,7 +68,8 @@ public class PreferenceManager implements OnSharedPreferenceChangeListener {
}
}
if (key == null || PreferencesUtils.getKey(service, R.string.metric_units_key).equals(key)) {
service.setMetricUnits(PreferencesUtils.getBoolean(service, R.string.metric_units_key, true));
service.setMetricUnits(PreferencesUtils.getBoolean(
service, R.string.metric_units_key, PreferencesUtils.METRIC_UNITS_DEFAULT));
}
if (key == null
|| PreferencesUtils.getKey(service, R.string.announcement_frequency_key).equals(key)) {
@@ -150,9 +150,11 @@ public class StatusAnnouncerTask implements PeriodicTask {
*/
// @VisibleForTesting
protected String getAnnouncement(TripStatistics stats) {
boolean metricUnits = PreferencesUtils.getBoolean(context, R.string.metric_units_key, true);
boolean reportSpeed = PreferencesUtils.getBoolean(context, R.string.report_speed_key, true);
double d = stats.getTotalDistance() * UnitConversions.M_TO_KM;
boolean metricUnits = PreferencesUtils.getBoolean(
context, R.string.metric_units_key, PreferencesUtils.METRIC_UNITS_DEFAULT);
boolean reportSpeed = PreferencesUtils.getBoolean(
context, R.string.report_speed_key, PreferencesUtils.REPORT_SPEED_DEFAULT);
double d = stats.getTotalDistance() * UnitConversions.M_TO_KM;
double s = stats.getAverageMovingSpeed() * UnitConversions.MS_TO_KMH;
if (d == 0) {