From bc56213eba914b3fb240374405556d1021a2c4c0 Mon Sep 17 00:00:00 2001 From: Me7c7 Date: Mon, 21 Oct 2024 12:36:28 +0300 Subject: [PATCH] Huawei: improve texts for file uploads, music icon --- .../devices/huawei/HuaweiInstallHandler.java | 8 +++---- .../devices/huawei/HuaweiSupportProvider.java | 5 ++--- app/src/main/res/drawable/ic_music.xml | 21 +++++++++++++++++++ app/src/main/res/values/strings.xml | 2 ++ 4 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 app/src/main/res/drawable/ic_music.xml diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/HuaweiInstallHandler.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/HuaweiInstallHandler.java index b7c5098a6..52ab1a8a9 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/HuaweiInstallHandler.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/HuaweiInstallHandler.java @@ -182,7 +182,7 @@ public class HuaweiInstallHandler implements InstallHandler { installActivity.setInstallItem(installItem); if (device.isBusy()) { LOG.error("App cannot be installed (device busy)"); - installActivity.setInfoText("Firmware cannot be installed (device busy)"); + installActivity.setInfoText("App cannot be installed (device busy)"); installActivity.setInfoText(device.getBusyTask()); installActivity.setInstallEnabled(false); return; @@ -190,7 +190,7 @@ public class HuaweiInstallHandler implements InstallHandler { if (!device.isConnected()) { LOG.error("App cannot be installed (not connected or wrong device)"); - installActivity.setInfoText("Firmware cannot be installed (not connected or wrong device)"); + installActivity.setInfoText("App cannot be installed (not connected or wrong device)"); installActivity.setInstallEnabled(false); return; } @@ -251,9 +251,9 @@ public class HuaweiInstallHandler implements InstallHandler { installItem.setDetails(helper.getMusicInfo().getFileName()); - installItem.setIcon(R.drawable.ic_music_note); + installItem.setIcon(R.drawable.ic_music); - installActivity.setInfoText(context.getString(R.string.app_install_info, helper.getMusicInfo().getFileName(), helper.getMusicInfo().getTitle(), helper.getMusicInfo().getArtist())); + installActivity.setInfoText(context.getString(R.string.music_upload_info, helper.getMusicInfo().getFileName(), helper.getMusicInfo().getTitle(), helper.getMusicInfo().getArtist())); LOG.debug("Initialized HuaweiInstallHandler: Music"); } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huawei/HuaweiSupportProvider.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huawei/HuaweiSupportProvider.java index 0f8d94c6e..16b70ae06 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huawei/HuaweiSupportProvider.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huawei/HuaweiSupportProvider.java @@ -2001,16 +2001,15 @@ public class HuaweiSupportProvider { @Override public void onError(int code) { if (code == 140004) { - LOG.error("Too many watchfaces installed"); + LOG.error("Too many watchfaces installed or musics uploaded"); HuaweiSupportProvider.this.handleGBDeviceEvent(new GBDeviceEventDisplayMessage(HuaweiSupportProvider.this.getContext().getString(R.string.cannot_upload_watchface_too_many_watchfaces_installed), Toast.LENGTH_LONG, GB.ERROR)); } else if (code == 140008) { LOG.error("File already exists"); - HuaweiSupportProvider.this.handleGBDeviceEvent(new GBDeviceEventDisplayMessage("File already exists", Toast.LENGTH_LONG, GB.ERROR)); //TODO: localization + HuaweiSupportProvider.this.handleGBDeviceEvent(new GBDeviceEventDisplayMessage(HuaweiSupportProvider.this.getContext().getString(R.string.file_already_exists), Toast.LENGTH_LONG, GB.ERROR)); } else if (code == 140009) { LOG.error("Insufficient space for upload"); HuaweiSupportProvider.this.handleGBDeviceEvent(new GBDeviceEventDisplayMessage(HuaweiSupportProvider.this.getContext().getString(R.string.insufficient_space_for_upload), Toast.LENGTH_LONG, GB.ERROR)); } - } }); diff --git a/app/src/main/res/drawable/ic_music.xml b/app/src/main/res/drawable/ic_music.xml new file mode 100644 index 000000000..b8960502e --- /dev/null +++ b/app/src/main/res/drawable/ic_music.xml @@ -0,0 +1,21 @@ + + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c78e5eee9..35627422a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -632,6 +632,7 @@ YOU ARE TRYING TO INSTALL A FIRMWARE, PROCEED AT YOUR OWN RISK.\n\n\n This firmware is for HW Revision: %s You are about to install the following app:\n\n%1$s\nVersion %2$s by %3$s\n You are about to install the following watchface:\n\n%1$s\nVersion %2$s by %3$s\n + You are about to upload the following music file:\n\n%1$s\nSong title: %2$s\nAlbum: %3$s\n N/A initialized %1$s by %2$s @@ -3322,6 +3323,7 @@ Fetch unknown activity files from the watch. They will not be processed, but will be saved in the phone. "Cannot upload watchface, too many watchfaces installed" "Insufficient space for upload" + "File already exists" Measurement error. Are the ring\'s sensors oriented correctly? Unknown measurement error %d received from ring Deprecated functionalities