1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-27 12:26:48 +01:00

Amazfit GTR/GTR Lite: enable setting menu items (untested)

This commit is contained in:
Andreas Shimokawa 2020-05-03 20:14:29 +02:00
parent 7d9b070f71
commit 94358e79b0
8 changed files with 12 additions and 71 deletions

View File

@ -6,6 +6,7 @@
* Fossil Hybrid HR: Fix some issues with custon widgets
* Fossil Hybrid HR: Allow setting alarm titles and descriptions
* Amazfit GTS: Fix setting menu items with low MTU
* Amazfit GTR: Allow setting menu itdem like GTS
#### Version 0.43.3
* Fossil Hybrid HR: Initial support for activity tracking (no sleep yet)

View File

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

View File

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

View File

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

View File

@ -23,41 +23,20 @@ import java.io.IOException;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr.AmazfitGTRLiteFWHelper;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitbip.AmazfitBipSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.operations.UpdateFirmwareOperationNew;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgts.AmazfitGTSSupport;
public class AmazfitGTRLiteSupport extends AmazfitBipSupport {
@Override
public byte getCryptFlags() {
return (byte) 0x80;
}
@Override
protected byte getAuthFlags() {
return 0x00;
}
@Override
public void onNotification(NotificationSpec notificationSpec) {
super.sendNotificationNew(notificationSpec, true);
}
public class AmazfitGTRLiteSupport extends AmazfitGTSSupport {
@Override
public HuamiFWHelper createFWHelper(Uri uri, Context context) throws IOException {
return new AmazfitGTRLiteFWHelper(uri, context);
}
// override to skip requesting GPS version
@Override
public UpdateFirmwareOperationNew createUpdateFirmwareOperation(Uri uri) {
return new UpdateFirmwareOperationNew(uri, this);
}
@Override
protected AmazfitGTRLiteSupport setDisplayItems(TransactionBuilder builder) {
// not supported yet
return this;
public void phase2Initialize(TransactionBuilder builder) {
super.phase2Initialize(builder);
setLanguage(builder);
}
}

View File

@ -23,41 +23,13 @@ import java.io.IOException;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr.AmazfitGTRFWHelper;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitbip.AmazfitBipSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.operations.UpdateFirmwareOperationNew;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgts.AmazfitGTSSupport;
public class AmazfitGTRSupport extends AmazfitBipSupport {
@Override
public byte getCryptFlags() {
return (byte) 0x80;
}
@Override
protected byte getAuthFlags() {
return 0x00;
}
@Override
public void onNotification(NotificationSpec notificationSpec) {
super.sendNotificationNew(notificationSpec, true);
}
public class AmazfitGTRSupport extends AmazfitGTSSupport {
@Override
public HuamiFWHelper createFWHelper(Uri uri, Context context) throws IOException {
return new AmazfitGTRFWHelper(uri, context);
}
@Override
public UpdateFirmwareOperationNew createUpdateFirmwareOperation(Uri uri) {
return new UpdateFirmwareOperationNew(uri, this);
}
@Override
protected AmazfitGTRSupport setDisplayItems(TransactionBuilder builder) {
// not supported yet
return this;
}
}

View File

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<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>