mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 09:01:55 +01:00
Pebble: Allow to select the preferred activity tracker via settings activity (Health, Misfit, Morpheuz)
This commit is contained in:
parent
cc42583885
commit
70ae5a2a3a
@ -2,6 +2,8 @@
|
||||
|
||||
####Version (next)
|
||||
* Pebble: Support Pebble Health: steps/activity data are stored correctly. Sleep time is considered as light sleep. Deep sleep is discarded. The pebble will send data where it deems appropriate, there is no action to perform on the watch for this to happen.
|
||||
* Pebble: Fix support for newer version of morpheuz (>=3.3?)
|
||||
* Pebble: Allow to select the preferred activity tracker via settings activity (Health, Misfit, Morpheuz)
|
||||
* Mi Band: improvements to pairing
|
||||
|
||||
####Version 0.7.4
|
||||
|
@ -112,6 +112,7 @@ public class SettingsActivity extends AbstractSettingsActivity {
|
||||
"notification_mode_calls",
|
||||
"notification_mode_sms",
|
||||
"notification_mode_k9mail",
|
||||
"pebble_activitytracker",
|
||||
"pebble_emu_addr",
|
||||
"pebble_emu_port",
|
||||
"pebble_reconnect_attempts",
|
||||
|
@ -45,13 +45,19 @@ public class PebbleCoordinator extends AbstractDeviceCoordinator {
|
||||
|
||||
@Override
|
||||
public SampleProvider getSampleProvider() {
|
||||
// FIXME: make this configurable somewhere else.
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(GBApplication.getContext());
|
||||
if (sharedPrefs.getBoolean("pebble_force_untested", false)) {
|
||||
//return new PebbleGadgetBridgeSampleProvider();
|
||||
return new HealthSampleProvider();
|
||||
} else {
|
||||
return new MorpheuzSampleProvider();
|
||||
int activityTracker = Integer.parseInt(sharedPrefs.getString("pebble_activitytracker", Integer.toString(SampleProvider.PROVIDER_PEBBLE_HEALTH)));
|
||||
switch (activityTracker) {
|
||||
case SampleProvider.PROVIDER_PEBBLE_HEALTH:
|
||||
return new HealthSampleProvider();
|
||||
case SampleProvider.PROVIDER_PEBBLE_MISFIT:
|
||||
return new MisfitSampleProvider();
|
||||
case SampleProvider.PROVIDER_PEBBLE_MORPHEUZ:
|
||||
return new MorpheuzSampleProvider();
|
||||
case SampleProvider.PROVIDER_PEBBLE_GADGETBRIDGE:
|
||||
return new PebbleGadgetBridgeSampleProvider();
|
||||
default:
|
||||
return new HealthSampleProvider();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,4 +59,16 @@
|
||||
<item>@string/p_alarm_clock</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="pebble_activitytracker">
|
||||
<item name="4">Pebble Health</item>
|
||||
<item name="3">Misfit</item>
|
||||
<item name="1">Morpheuz</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="pebble_activitytracker_values">
|
||||
<item>4</item>
|
||||
<item>3</item>
|
||||
<item>1</item>
|
||||
</string-array>
|
||||
|
||||
</resources>
|
@ -62,6 +62,7 @@
|
||||
<string name="pref_title_development_miaddr">Mi Band address</string>
|
||||
|
||||
<string name="pref_title_pebble_settings">Pebble Settings</string>
|
||||
<string name="pref_title_pebble_activitytracker">Preferred Activitytracker</string>
|
||||
<string name="pref_title_enable_pebblekit">Allow 3rd Party Android App Access</string>
|
||||
<string name="pref_summary_enable_pebblekit">Enable experimental support for Android Apps using PebbleKit</string>
|
||||
<string name="pref_title_pebble_forceprotocol">Force Notification Protocol</string>
|
||||
|
@ -180,6 +180,12 @@
|
||||
android:key="pebble_reconnect_attempts"
|
||||
android:maxLength="4"
|
||||
android:title="@string/pref_title_pebble_reconnect_attempts" />
|
||||
<ListPreference
|
||||
android:defaultValue="4"
|
||||
android:entries="@array/pebble_activitytracker"
|
||||
android:entryValues="@array/pebble_activitytracker_values"
|
||||
android:key="pebble_activitytracker"
|
||||
android:title="@string/pref_title_pebble_activitytracker" />
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory
|
||||
android:key="pref_key_development"
|
||||
|
Loading…
Reference in New Issue
Block a user