mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-01-13 11:17:33 +01:00
Amazfit GTS2/GTR2: Fix menu items (#2249)
Amazfit GTS2/GTR2: Add missing menu items Fixes #2193 Fixes #2230 Fixes #2242 Amazfit GTS2/GTR2: Fix setting menu items At least on the GTR2e, including the "watchface" menu item causes the configuration request to be ignored. Assuming the other GTS2 and GTR2 variants behave the same, this patch ensures the forceWatchface argument is set to false when setting display items. Additionally, we now use the correct resource ID for the default settings. Co-authored-by: Vianney le Clément de Saint-Marcq <code@quartic.eu> Reviewed-on: https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/2249 Co-Authored-By: Vianney le Clément de Saint-Marcq <vianney@noreply.codeberg.org> Co-Committed-By: Vianney le Clément de Saint-Marcq <vianney@noreply.codeberg.org>
This commit is contained in:
parent
b7e0e6e44d
commit
c1b7ce2308
@ -50,12 +50,15 @@ class HuamiMenuType {
|
||||
put("goal", 0x21);
|
||||
put("sleep", 0x23);
|
||||
put("spo2", 0x24);
|
||||
put("events", 0x26);
|
||||
put("widgets", 0x28);
|
||||
put("breathing",0x33);
|
||||
put("steps",0x34);
|
||||
put("distance",0x35);
|
||||
put("calories",0x36);
|
||||
put("pomodoro", 0x38);
|
||||
put("alexa", 0x39);
|
||||
put("temperature", 0x40);
|
||||
put("battery", 0x3a);
|
||||
}};
|
||||
}
|
||||
|
@ -22,9 +22,11 @@ import android.net.Uri;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr2.AmazfitGTR2FWHelper;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgtr.AmazfitGTRSupport;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.operations.UpdateFirmwareOperation;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.operations.UpdateFirmwareOperation2020;
|
||||
@ -50,4 +52,10 @@ public class AmazfitGTR2Support extends AmazfitGTRSupport {
|
||||
public int getActivitySampleSize() {
|
||||
return 8;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AmazfitGTR2Support setDisplayItems(TransactionBuilder builder) {
|
||||
setDisplayItemsNew(builder, false, false, R.array.pref_gtsgtr2_display_items_default);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
@ -22,9 +22,11 @@ import android.net.Uri;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgts2.AmazfitGTS2FWHelper;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgts.AmazfitGTSSupport;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.operations.UpdateFirmwareOperation;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.operations.UpdateFirmwareOperation2020;
|
||||
@ -50,4 +52,10 @@ public class AmazfitGTS2Support extends AmazfitGTSSupport {
|
||||
public int getActivitySampleSize() {
|
||||
return 8;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AmazfitGTS2Support setDisplayItems(TransactionBuilder builder) {
|
||||
setDisplayItemsNew(builder, false, false, R.array.pref_gtsgtr2_display_items_default);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
@ -675,6 +675,7 @@
|
||||
|
||||
<string-array name="pref_gtsgtr2_display_items">
|
||||
<item>@string/menuitem_status</item>
|
||||
<item>@string/menuitem_goal</item>
|
||||
<item>@string/menuitem_hr</item>
|
||||
<item>@string/menuitem_pai</item>
|
||||
<item>@string/menuitem_workout</item>
|
||||
@ -682,6 +683,7 @@
|
||||
<item>@string/menuitem_sleep</item>
|
||||
<item>@string/menuitem_weather</item>
|
||||
<item>@string/menuitem_alarm</item>
|
||||
<item>@string/menuitem_events</item>
|
||||
<item>@string/menuitem_stopwatch</item>
|
||||
<item>@string/menuitem_timer</item>
|
||||
<item>@string/menuitem_breathing</item>
|
||||
@ -692,12 +694,15 @@
|
||||
<item>@string/menuitem_music</item>
|
||||
<item>@string/menuitem_cycles</item>
|
||||
<item>@string/menuitem_compass</item>
|
||||
<item>@string/menuitem_temperature</item>
|
||||
<item>@string/menuitem_widgets</item>
|
||||
<item>@string/menuitem_settings</item>
|
||||
<item>@string/menuitem_more</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="pref_gtsgtr2_display_items_values">
|
||||
<item>@string/p_menuitem_status</item>
|
||||
<item>@string/p_menuitem_goal</item>
|
||||
<item>@string/p_menuitem_hr</item>
|
||||
<item>@string/p_menuitem_pai</item>
|
||||
<item>@string/p_menuitem_workout</item>
|
||||
@ -705,6 +710,7 @@
|
||||
<item>@string/p_menuitem_sleep</item>
|
||||
<item>@string/p_menuitem_weather</item>
|
||||
<item>@string/p_menuitem_alarm</item>
|
||||
<item>@string/p_menuitem_events</item>
|
||||
<item>@string/p_menuitem_stopwatch</item>
|
||||
<item>@string/p_menuitem_timer</item>
|
||||
<item>@string/p_menuitem_breathing</item>
|
||||
@ -715,12 +721,15 @@
|
||||
<item>@string/p_menuitem_music</item>
|
||||
<item>@string/p_menuitem_cycles</item>
|
||||
<item>@string/p_menuitem_compass</item>
|
||||
<item>@string/p_menuitem_temperature</item>
|
||||
<item>@string/p_menuitem_widgets</item>
|
||||
<item>@string/p_menuitem_settings</item>
|
||||
<item>@string/p_menuitem_more</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="pref_gtsgtr2_display_items_default">
|
||||
<item>@string/p_menuitem_status</item>
|
||||
<item>@string/p_menuitem_goal</item>
|
||||
<item>@string/p_menuitem_hr</item>
|
||||
<item>@string/p_menuitem_pai</item>
|
||||
<item>@string/p_menuitem_workout</item>
|
||||
@ -728,6 +737,7 @@
|
||||
<item>@string/p_menuitem_sleep</item>
|
||||
<item>@string/p_menuitem_weather</item>
|
||||
<item>@string/p_menuitem_alarm</item>
|
||||
<item>@string/p_menuitem_events</item>
|
||||
<item>@string/p_menuitem_stopwatch</item>
|
||||
<item>@string/p_menuitem_timer</item>
|
||||
<item>@string/p_menuitem_breathing</item>
|
||||
@ -738,6 +748,8 @@
|
||||
<item>@string/p_menuitem_music</item>
|
||||
<item>@string/p_menuitem_cycles</item>
|
||||
<item>@string/p_menuitem_compass</item>
|
||||
<item>@string/p_menuitem_temperature</item>
|
||||
<item>@string/p_menuitem_widgets</item>
|
||||
<item>@string/p_menuitem_settings</item>
|
||||
<item>@string/p_menuitem_more</item>
|
||||
</string-array>
|
||||
|
@ -901,6 +901,9 @@
|
||||
<string name="menuitem_goal">Activity Goal</string>
|
||||
<string name="menuitem_sleep">Sleep</string>
|
||||
<string name="menuitem_pomodoro">Pomodoro Tracker</string>
|
||||
<string name="menuitem_events">Events</string>
|
||||
<string name="menuitem_widgets">Widgets</string>
|
||||
<string name="menuitem_temperature">Temperature</string>
|
||||
<string name="watch9_time_minutes">Minutes:</string>
|
||||
<string name="watch9_time_hours">Hours:</string>
|
||||
<string name="watch9_time_seconds">Seconds:</string>
|
||||
|
@ -50,6 +50,9 @@
|
||||
<item name="p_menuitem_goal" type="string">goal</item>
|
||||
<item name="p_menuitem_sleep" type="string">sleep</item>
|
||||
<item name="p_menuitem_pomodoro" type="string">pomodoro</item>
|
||||
<item name="p_menuitem_events" type="string">events</item>
|
||||
<item name="p_menuitem_widgets" type="string">widgets</item>
|
||||
<item name="p_menuitem_temperature" type="string">temperature</item>
|
||||
|
||||
<!-- currently used for sounds -->
|
||||
<item name="p_menuitem_button" type="string">button</item>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<com.mobeta.android.dslv.DragSortListPreference
|
||||
android:icon="@drawable/ic_widgets"
|
||||
android:defaultValue="@array/pref_gts_display_items_default"
|
||||
android:defaultValue="@array/pref_gtsgtr2_display_items_default"
|
||||
android:dialogTitle="@string/mi2_prefs_display_items"
|
||||
android:entries="@array/pref_gtsgtr2_display_items"
|
||||
android:entryValues="@array/pref_gtsgtr2_display_items_values"
|
||||
|
Loading…
x
Reference in New Issue
Block a user