1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-01 22:43:00 +01:00

Amazfit GTS/GTR2 (all variants): Try to fix missing menu items

This was reported in #2189 for the GTS 2 Mini, but let's assume it is the same problem for all variants.
This commit is contained in:
Andreas Shimokawa 2021-02-07 16:23:45 +01:00
parent 46195add24
commit 6d02e8c488
7 changed files with 99 additions and 5 deletions

View File

@ -88,7 +88,7 @@ public class AmazfitGTR2Coordinator extends HuamiCoordinator {
}
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
return new int[]{
R.xml.devicesettings_amazfitgtsgtr,
R.xml.devicesettings_amazfitgtsgtr2,
R.xml.devicesettings_wearlocation,
R.xml.devicesettings_timeformat,
R.xml.devicesettings_liftwrist_display,

View File

@ -89,7 +89,7 @@ public class AmazfitGTR2eCoordinator extends HuamiCoordinator {
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
return new int[]{
R.xml.devicesettings_amazfitgtsgtr,
R.xml.devicesettings_amazfitgtsgtr2,
R.xml.devicesettings_wearlocation,
R.xml.devicesettings_timeformat,
R.xml.devicesettings_liftwrist_display,

View File

@ -88,7 +88,7 @@ public class AmazfitGTS2Coordinator extends HuamiCoordinator {
}
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
return new int[]{
R.xml.devicesettings_amazfitgtsgtr,
R.xml.devicesettings_amazfitgtsgtr2,
R.xml.devicesettings_wearlocation,
R.xml.devicesettings_timeformat,
R.xml.devicesettings_liftwrist_display,

View File

@ -89,7 +89,7 @@ public class AmazfitGTS2eCoordinator extends HuamiCoordinator {
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
return new int[]{
R.xml.devicesettings_amazfitgtsgtr,
R.xml.devicesettings_amazfitgtsgtr2,
R.xml.devicesettings_wearlocation,
R.xml.devicesettings_timeformat,
R.xml.devicesettings_liftwrist_display,

View File

@ -1999,7 +1999,14 @@ public class HuamiSupport extends AbstractBTLEDeviceSupport {
@Override
public void onTestNewFunction() {
try {
boolean test = false;
TransactionBuilder builder = performInitialized("test pattern");
byte[] testpattern = new byte[] {0x20,0x00, (byte) 0x4b,0x64,0x00, (byte) 0x8d,0x01,0x73,0x00,0x38,0x01,0x64,0x00,0x64,0x00,0x64,0x00,0x67,0x00,0x64,0x00,0x37,0x01,0x7c,0x00,0x64,0x00,0x64,0x00,0x67,0x00,0x64,0x00,0x67,0x00,0x64,0x00,0x37,0x01,0x64,0x00,0x64,0x00,0x64,0x00, (byte) 0xe5,0x02};
//byte[] testpattern = new byte[] {0x20,0x00, (byte) 0x00, 0,0,0,0};
writeToChunked(builder,2, testpattern);
builder.queue(getQueue());
} catch (Exception ignored) {}
}
@Override

View File

@ -667,6 +667,72 @@
<item>@string/p_menuitem_settings</item>
</string-array>
<string-array name="pref_gtsgtr2_display_items">
<item>@string/menuitem_status</item>
<item>@string/menuitem_hr</item>
<item>@string/menuitem_pai</item>
<item>@string/menuitem_workout</item>
<item>@string/menuitem_activity</item>
<item>@string/menuitem_sleep</item>
<item>@string/menuitem_weather</item>
<item>@string/menuitem_alarm</item>
<item>@string/menuitem_stopwatch</item>
<item>@string/menuitem_timer</item>
<item>@string/menuitem_breathing</item>
<item>@string/menuitem_stress</item>
<item>@string/menuitem_spo2</item>
<item>@string/menuitem_worldclock</item>
<item>@string/menuitem_pomodoro</item>
<item>@string/menuitem_music</item>
<item>@string/menuitem_cycles</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_hr</item>
<item>@string/p_menuitem_pai</item>
<item>@string/p_menuitem_workout</item>
<item>@string/p_menuitem_activity</item>
<item>@string/p_menuitem_sleep</item>
<item>@string/p_menuitem_weather</item>
<item>@string/p_menuitem_alarm</item>
<item>@string/p_menuitem_stopwatch</item>
<item>@string/p_menuitem_timer</item>
<item>@string/p_menuitem_breathing</item>
<item>@string/p_menuitem_stress</item>
<item>@string/p_menuitem_spo2</item>
<item>@string/p_menuitem_worldclock</item>
<item>@string/p_menuitem_pomodoro</item>
<item>@string/p_menuitem_music</item>
<item>@string/p_menuitem_cycles</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_hr</item>
<item>@string/p_menuitem_pai</item>
<item>@string/p_menuitem_workout</item>
<item>@string/p_menuitem_activity</item>
<item>@string/p_menuitem_sleep</item>
<item>@string/p_menuitem_weather</item>
<item>@string/p_menuitem_alarm</item>
<item>@string/p_menuitem_stopwatch</item>
<item>@string/p_menuitem_timer</item>
<item>@string/p_menuitem_breathing</item>
<item>@string/p_menuitem_stress</item>
<item>@string/p_menuitem_spo2</item>
<item>@string/p_menuitem_worldclock</item>
<item>@string/p_menuitem_pomodoro</item>
<item>@string/p_menuitem_music</item>
<item>@string/p_menuitem_cycles</item>
<item>@string/p_menuitem_settings</item>
<item>@string/p_menuitem_more</item>
</string-array>
<string-array name="pref_trex_display_items">
<item>@string/menuitem_status</item>
<item>@string/menuitem_pai</item>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<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:dialogTitle="@string/mi2_prefs_display_items"
android:entries="@array/pref_gtsgtr2_display_items"
android:entryValues="@array/pref_gtsgtr2_display_items_values"
android:key="display_items_sortable"
android:persistent="true"
android:summary="@string/mi2_prefs_display_items_summary"
android:title="@string/mi2_prefs_display_items" />
<ListPreference
android:icon="@drawable/ic_language"
android:defaultValue="auto"
android:entries="@array/pref_amazfitbip_language"
android:entryValues="@array/pref_amazfitbip_language_values"
android:key="language"
android:summary="%s"
android:title="@string/pref_title_language" />
</androidx.preference.PreferenceScreen>