Use list preference for chart x axis settings

This commit is contained in:
Jimmy Shih
2013-08-20 15:19:33 -07:00
parent 594f156a1f
commit c7ba2bc5a1
7 changed files with 47 additions and 14 deletions
@@ -50,12 +50,12 @@ public class PreferencesUtils {
public static final String BLUETOOTH_SENSOR_DEFAULT = "";
public static final boolean CHART_BY_DISTANCE_DEFAULT = true;
public static final boolean CHART_SHOW_CADENCE_DEFAULT = true;
public static final boolean CHART_SHOW_ELEVATION_DEFAULT = true;
public static final boolean CHART_SHOW_HEART_RATE_DEFAULT = true;
public static final boolean CHART_SHOW_POWER_DEFAULT = true;
public static final boolean CHART_SHOW_SPEED_DEFAULT = true;
public static final String CHART_X_AXIS_DEFAULT = "DISTANCE";
public static final boolean CONFIRM_PLAY_EARTH_DEFAULT = true;
@@ -257,9 +257,10 @@ public class PreferencesUtils {
return PreferencesUtils.STATS_UNITS_DEFAULT.equals(
getString(context, R.string.stats_units_key, PreferencesUtils.STATS_UNITS_DEFAULT));
}
/**
* Returns true if the preferred rate is speed, false if the preferred rate is pace.
* Returns true if the preferred rate is speed, false if the preferred rate is
* pace.
*
* @param context the context
*/
@@ -267,4 +268,14 @@ public class PreferencesUtils {
return PreferencesUtils.STATS_RATE_DEFAULT.equals(
getString(context, R.string.stats_rate_key, PreferencesUtils.STATS_RATE_DEFAULT));
}
/**
* Returns true if chart x axis is by distance, false if by time.
*
* @param context the context
*/
public static boolean isChartByDistance(Context context) {
return PreferencesUtils.CHART_X_AXIS_DEFAULT.equals(
getString(context, R.string.chart_x_axis_key, PreferencesUtils.CHART_X_AXIS_DEFAULT));
}
}