mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 09:01:55 +01:00
selectable which activity data will be shown on diagrams - activity or
steps
This commit is contained in:
parent
87d41bf09f
commit
9a8fef2a1b
@ -69,6 +69,7 @@ import nodomain.freeyourgadget.gadgetbridge.model.ActivityKind;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.DateTimeUtils;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.GBPrefs;
|
||||
|
||||
/**
|
||||
* A base class fragment to be used with ChartsActivity. The fragment can supply
|
||||
@ -460,8 +461,14 @@ public abstract class AbstractChartFragment extends AbstractGBFragment {
|
||||
// date = cal.getTime();
|
||||
// dateStringTo = dateFormat.format(date);
|
||||
// }
|
||||
|
||||
float movement = sample.getIntensity();
|
||||
int shownActivityType = GBApplication.getPrefs().getInt(GBPrefs.CHART_VISUAL_DATA, 0);
|
||||
float movement = 0;
|
||||
if (shownActivityType == 1){
|
||||
movement = sample.getSteps();
|
||||
}
|
||||
else{
|
||||
movement = sample.getIntensity();
|
||||
}
|
||||
|
||||
float value = movement;
|
||||
switch (type) {
|
||||
|
@ -90,7 +90,7 @@ public class ActivitySleepChartFragment extends AbstractChartFragment {
|
||||
y.setDrawGridLines(false);
|
||||
// y.setDrawLabels(false);
|
||||
// TODO: make fixed max value optional
|
||||
y.setAxisMaximum(1f);
|
||||
//y.setAxisMaximum(200f);
|
||||
y.setAxisMinimum(0);
|
||||
y.setDrawTopYLabelEntry(false);
|
||||
y.setTextColor(CHART_TEXT_COLOR);
|
||||
|
@ -42,6 +42,7 @@ public class GBPrefs {
|
||||
|
||||
public static final String CHART_MAX_HEART_RATE = "chart_max_heart_rate";
|
||||
public static final String CHART_MIN_HEART_RATE = "chart_min_heart_rate";
|
||||
public static final String CHART_VISUAL_DATA = "chart_visual_data";
|
||||
|
||||
private final Prefs mPrefs;
|
||||
|
||||
|
@ -429,4 +429,13 @@
|
||||
<item>1800</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="chart_visual">
|
||||
<item>@string/activity_prefs_chart_visual_activity</item>
|
||||
<item>@string/activity_prefs_chart_visual_steps</item>
|
||||
</string-array>
|
||||
<string-array name="chart_visual_values">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
</string-array>
|
||||
|
||||
</resources>
|
||||
|
@ -487,6 +487,9 @@
|
||||
<string name="activity_prefs_charts">Chart settings</string>
|
||||
<string name="activity_prefs_chart_max_heart_rate">Max heart rate</string>
|
||||
<string name="activity_prefs_chart_min_heart_rate">Min heart rate</string>
|
||||
<string name="activity_prefs_chart_visual_description">Shown activity data on chart</string>
|
||||
<string name="activity_prefs_chart_visual_activity">Activity</string>
|
||||
<string name="activity_prefs_chart_visual_steps">Steps</string>
|
||||
|
||||
<string name="authenticating">Authenticating</string>
|
||||
<string name="authentication_required">Authentication required</string>
|
||||
|
@ -153,6 +153,14 @@
|
||||
android:maxLength="3"
|
||||
android:defaultValue="10"
|
||||
android:title="@string/activity_prefs_chart_min_heart_rate" />
|
||||
|
||||
<ListPreference
|
||||
android:defaultValue="0"
|
||||
android:entries="@array/chart_visual"
|
||||
android:entryValues="@array/chart_visual_values"
|
||||
android:key="chart_visual_data"
|
||||
android:title="@string/activity_prefs_chart_visual_description"
|
||||
android:summary="%s" />
|
||||
</PreferenceScreen>
|
||||
<CheckBoxPreference
|
||||
android:layout="@layout/preference_checkbox"
|
||||
|
Loading…
Reference in New Issue
Block a user