From 95cc53857556b680bf7069a5236f34428ffd3811 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Tue, 30 Jan 2018 23:06:08 +0100 Subject: [PATCH] Amazfit Bip: Allow language to be set to Spanish (needs firmware 0.1.0.66 beta, not recommended) This also requires the latin font to be flashed before. --- .../devices/huami/amazfitbip/AmazfitBipService.java | 1 + .../service/devices/amazfitbip/AmazfitBipSupport.java | 8 ++++++++ app/src/main/res/values/arrays.xml | 2 ++ app/src/main/res/values/strings.xml | 1 + 4 files changed, 12 insertions(+) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip/AmazfitBipService.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip/AmazfitBipService.java index fd2bf918c..0033fad8d 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip/AmazfitBipService.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitbip/AmazfitBipService.java @@ -32,6 +32,7 @@ public class AmazfitBipService { public static final byte[] COMMAND_SET_LANGUAGE_SIMPLIFIED_CHINESE = new byte[]{ENDPOINT_DISPLAY, 0x13, 0x00, 0x00}; public static final byte[] COMMAND_SET_LANGUAGE_TRADITIONAL_CHINESE = new byte[]{ENDPOINT_DISPLAY, 0x13, 0x00, 0x01}; public static final byte[] COMMAND_SET_LANGUAGE_ENGLISH = new byte[]{ENDPOINT_DISPLAY, 0x13, 0x00, 0x02}; + public static final byte[] COMMAND_SET_LANGUAGE_SPANISH = new byte[]{ENDPOINT_DISPLAY, 0x13, 0x00, 0x03}; public static final byte[] COMMAND_ACK_FIND_PHONE_IN_PROGRESS = new byte[]{ENDPOINT_DISPLAY, 0x14, 0x00, 0x00}; } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/AmazfitBipSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/AmazfitBipSupport.java index c10728ae6..2181b12c6 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/AmazfitBipSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/AmazfitBipSupport.java @@ -319,6 +319,14 @@ public class AmazfitBipSupport extends MiBand2Support { case 2: command = AmazfitBipService.COMMAND_SET_LANGUAGE_ENGLISH; break; + case 3: + Version version = new Version(gbDevice.getFirmwareVersion()); + if (version.compareTo(new Version("0.1.0.66")) >= 0) { + command = AmazfitBipService.COMMAND_SET_LANGUAGE_SPANISH; + } else { + command = AmazfitBipService.COMMAND_SET_LANGUAGE_ENGLISH; + } + break; default: if (language.equals("zh")) { if (country.equals("TW") || country.equals("HK") || country.equals("MO")) { // Taiwan, Hong Kong, Macao diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index f2830dd9d..dc290da03 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -207,6 +207,7 @@ @string/simplified_chinese @string/traditional_chinese @string/english + @string/spanish @@ -214,6 +215,7 @@ 0 1 2 + 3 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b9bb00e30..018dec8a6 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -406,6 +406,7 @@ Simplified Chinese Traditional Chinese English + Spanish About to transfer data since %1$s