mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +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.model.ActivitySample;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.util.DateTimeUtils;
|
import nodomain.freeyourgadget.gadgetbridge.util.DateTimeUtils;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper;
|
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
|
* 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();
|
// date = cal.getTime();
|
||||||
// dateStringTo = dateFormat.format(date);
|
// dateStringTo = dateFormat.format(date);
|
||||||
// }
|
// }
|
||||||
|
int shownActivityType = GBApplication.getPrefs().getInt(GBPrefs.CHART_VISUAL_DATA, 0);
|
||||||
float movement = sample.getIntensity();
|
float movement = 0;
|
||||||
|
if (shownActivityType == 1){
|
||||||
|
movement = sample.getSteps();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
movement = sample.getIntensity();
|
||||||
|
}
|
||||||
|
|
||||||
float value = movement;
|
float value = movement;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
@ -90,7 +90,7 @@ public class ActivitySleepChartFragment extends AbstractChartFragment {
|
|||||||
y.setDrawGridLines(false);
|
y.setDrawGridLines(false);
|
||||||
// y.setDrawLabels(false);
|
// y.setDrawLabels(false);
|
||||||
// TODO: make fixed max value optional
|
// TODO: make fixed max value optional
|
||||||
y.setAxisMaximum(1f);
|
//y.setAxisMaximum(200f);
|
||||||
y.setAxisMinimum(0);
|
y.setAxisMinimum(0);
|
||||||
y.setDrawTopYLabelEntry(false);
|
y.setDrawTopYLabelEntry(false);
|
||||||
y.setTextColor(CHART_TEXT_COLOR);
|
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_MAX_HEART_RATE = "chart_max_heart_rate";
|
||||||
public static final String CHART_MIN_HEART_RATE = "chart_min_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;
|
private final Prefs mPrefs;
|
||||||
|
|
||||||
|
@ -429,4 +429,13 @@
|
|||||||
<item>1800</item>
|
<item>1800</item>
|
||||||
</string-array>
|
</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>
|
</resources>
|
||||||
|
@ -487,6 +487,9 @@
|
|||||||
<string name="activity_prefs_charts">Chart settings</string>
|
<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_max_heart_rate">Max heart rate</string>
|
||||||
<string name="activity_prefs_chart_min_heart_rate">Min 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="authenticating">Authenticating</string>
|
||||||
<string name="authentication_required">Authentication required</string>
|
<string name="authentication_required">Authentication required</string>
|
||||||
|
@ -153,6 +153,14 @@
|
|||||||
android:maxLength="3"
|
android:maxLength="3"
|
||||||
android:defaultValue="10"
|
android:defaultValue="10"
|
||||||
android:title="@string/activity_prefs_chart_min_heart_rate" />
|
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>
|
</PreferenceScreen>
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:layout="@layout/preference_checkbox"
|
android:layout="@layout/preference_checkbox"
|
||||||
|
Loading…
Reference in New Issue
Block a user