diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/zeppos/watches/AmazfitActive2NfcCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/zeppos/watches/AmazfitActive2NfcCoordinator.java index ec9109e2ff..b54e5e6970 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/zeppos/watches/AmazfitActive2NfcCoordinator.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/zeppos/watches/AmazfitActive2NfcCoordinator.java @@ -23,7 +23,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst; * This seems to be the same as the Active 2, but with NFC. The bluetooth name is different, but the * device sources seem to be similar. */ -public class AmazfitActive2NfcCoordinator extends AmazfitActive2Coordinator { +public class AmazfitActive2NfcCoordinator extends AmazfitActive2RoundCoordinator { @Override public String getDeviceBluetoothName() { return HuamiConst.AMAZFIT_ACTIVE_2_NFC_NAME; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/zeppos/watches/AmazfitActive2Coordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/zeppos/watches/AmazfitActive2RoundCoordinator.java similarity index 94% rename from app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/zeppos/watches/AmazfitActive2Coordinator.java rename to app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/zeppos/watches/AmazfitActive2RoundCoordinator.java index f60a3ce9d5..be1d996b0a 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/zeppos/watches/AmazfitActive2Coordinator.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/zeppos/watches/AmazfitActive2RoundCoordinator.java @@ -25,7 +25,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst; import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator; import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; -public class AmazfitActive2Coordinator extends ZeppOsCoordinator { +public class AmazfitActive2RoundCoordinator extends ZeppOsCoordinator { @Override public String getDeviceBluetoothName() { return HuamiConst.AMAZFIT_ACTIVE_2_NAME; @@ -47,7 +47,7 @@ public class AmazfitActive2Coordinator extends ZeppOsCoordinator { @Override public int getDeviceNameResource() { - return R.string.devicetype_amazfit_active_2; + return R.string.devicetype_amazfit_active_2_round; } @Override diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/zeppos/watches/AmazfitActive2SquareCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/zeppos/watches/AmazfitActive2SquareCoordinator.java new file mode 100644 index 0000000000..05e0817857 --- /dev/null +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/zeppos/watches/AmazfitActive2SquareCoordinator.java @@ -0,0 +1,72 @@ +/* Copyright (C) 2025 José Rebelo + + This file is part of Gadgetbridge. + + Gadgetbridge is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Gadgetbridge is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ +package nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.watches; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +import nodomain.freeyourgadget.gadgetbridge.R; +import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.ZeppOsCoordinator; +import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; + +public class AmazfitActive2SquareCoordinator extends ZeppOsCoordinator { + @Override + public boolean isExperimental() { + // untested + return true; + } + + @Override + public String getDeviceBluetoothName() { + return "Active 2 (Square)"; + } + + @Override + public Set getDeviceSources() { + return new HashSet<>(Arrays.asList( + 9830656, // chinese mainland version + 9830657, + 9830659 + )); + } + + @Override + public int getDeviceNameResource() { + return R.string.devicetype_amazfit_active_2_square; + } + + @Override + public boolean mainMenuHasMoreSection() { + return false; + } + + @Override + public boolean supportsControlCenter() { + return true; + } + + @Override + public boolean supportsToDoList() { + return true; + } + + @Override + public boolean supportsBluetoothPhoneCalls(final GBDevice device) { + return true; + } +} diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java index a6e2e85e8a..b449948462 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java @@ -174,8 +174,9 @@ import nodomain.freeyourgadget.gadgetbridge.devices.huami.miband5.MiBand5Coordin import nodomain.freeyourgadget.gadgetbridge.devices.huami.miband6.MiBand6Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppe.ZeppECoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.straps.AmazfitHelioStrapCoordinator; -import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.watches.AmazfitActive2Coordinator; +import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.watches.AmazfitActive2RoundCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.watches.AmazfitActive2NfcCoordinator; +import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.watches.AmazfitActive2SquareCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.watches.AmazfitActiveCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.watches.AmazfitActiveEdgeCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.watches.AmazfitBalance2Coordinator; @@ -471,8 +472,9 @@ public enum DeviceType { AMAZFITBALANCE(AmazfitBalanceCoordinator.class), AMAZFITBALANCE2(AmazfitBalance2Coordinator.class), AMAZFITACTIVE(AmazfitActiveCoordinator.class), - AMAZFITACTIVE2(AmazfitActive2Coordinator.class), + AMAZFITACTIVE2(AmazfitActive2RoundCoordinator.class), AMAZFITACTIVE2NFC(AmazfitActive2NfcCoordinator.class), + AMAZFITACTIVE2SQUARE(AmazfitActive2SquareCoordinator.class), AMAZFITACTIVEEDGE(AmazfitActiveEdgeCoordinator.class), AMAZFITHELIOSTRAP(AmazfitHelioStrapCoordinator.class), HPLUS(HPlusCoordinator.class), diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index efeed970d6..b4dfcc4abd 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1780,6 +1780,8 @@ Amazfit Balance 2 Amazfit Active Amazfit Active 2 + Amazfit Active 2 (Round) + Amazfit Active 2 (Square) Amazfit Active 2 NFC Amazfit Active Edge Amazfit Cheetah (Square)