1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-16 10:00:08 +02:00

Amazfit T-Rex Pro: Fix for watch face upload and device settings (#2321)

Reviewed-on: https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/2321
Co-authored-by: GeekosaurusR3x <geekosaurusr3x@noreply.codeberg.org>
Co-committed-by: GeekosaurusR3x <geekosaurusr3x@noreply.codeberg.org>
This commit is contained in:
GeekosaurusR3x 2021-06-13 22:58:00 +02:00 committed by Andreas Shimokawa
parent f328f80394
commit 685fc8b585
4 changed files with 29 additions and 3 deletions

View File

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

View File

@ -32,6 +32,11 @@ public class AmazfitTRexProFirmwareInfo extends HuamiFirmwareInfo {
0x20, (byte) 0x99, 0x12, 0x01, 0x08 // completely nonsense probably
};
private static final byte[] WATCHFACE_HEADER = new byte[]{
0x55, 0x49, 0x48, 0x48, 0x02, 0x00
};
private static final byte[] GPS_ALMANAC_HEADER = new byte[]{ // probably wrong
(byte) 0xa0, (byte) 0x80, 0x08, 0x00, (byte) 0x8b, 0x07
};

View File

@ -23,7 +23,7 @@ import java.io.IOException;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfittrex.AmazfitTRexFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfittrexpro.AmazfitTRexProFWHelper;
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgts.AmazfitGTSSupport;
@ -31,7 +31,7 @@ public class AmazfitTRexProSupport extends AmazfitGTSSupport {
@Override
public HuamiFWHelper createFWHelper(Uri uri, Context context) throws IOException {
return new AmazfitTRexFWHelper(uri, context);
return new AmazfitTRexProFWHelper(uri, context);
}
@Override

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_trex_display_items_default"
android:dialogTitle="@string/mi2_prefs_display_items"
android:entries="@array/pref_trex_display_items"
android:entryValues="@array/pref_trex_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>