From 451a896af0c33df34f3baaed19b0ffa5ee310fef Mon Sep 17 00:00:00 2001 From: Aleksander Nowakowski Date: Wed, 25 Oct 2023 13:39:09 +0200 Subject: [PATCH] Minor UI improvements --- .../fragment/mcumgr/ImageUpgradeFragment.java | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/sample/src/main/java/io/runtime/mcumgr/sample/fragment/mcumgr/ImageUpgradeFragment.java b/sample/src/main/java/io/runtime/mcumgr/sample/fragment/mcumgr/ImageUpgradeFragment.java index 3d9312cb..eb3e73b1 100644 --- a/sample/src/main/java/io/runtime/mcumgr/sample/fragment/mcumgr/ImageUpgradeFragment.java +++ b/sample/src/main/java/io/runtime/mcumgr/sample/fragment/mcumgr/ImageUpgradeFragment.java @@ -357,25 +357,16 @@ protected void onFileLoaded(@NonNull final byte[] data) { for (final McuMgrTargetImage binary: zip.getBinaries().getImages()) { final byte[] hash = binary.image.getHash(); hashBuilder - .append(StringUtils.toHex(hash)); + .append(StringUtils.toHex(hash)) + .append("\n"); sizeBuilder .append(getString(R.string.image_upgrade_size_value, binary.image.getData().length)); switch (binary.imageIndex) { - case 0 -> { - hashBuilder.append(" (app core)"); - sizeBuilder.append(" (app core)"); - } - case 1 -> { - hashBuilder.append(" (net core)"); - sizeBuilder.append(" (net core)"); - } - default -> { - hashBuilder.append(" (unknown core (").append(binary.imageIndex).append(")"); - sizeBuilder.append(" (unknown core (").append(binary.imageIndex).append(")"); - } + case 0 -> sizeBuilder.append(" (app core"); + case 1 -> sizeBuilder.append(" (net core"); + default -> sizeBuilder.append(" (unknown core (").append(binary.imageIndex); } - hashBuilder.append("\n"); - sizeBuilder.append("\n"); + sizeBuilder.append(", slot: ").append(binary.slot).append(")\n"); } hashBuilder.setLength(hashBuilder.length() - 1); sizeBuilder.setLength(sizeBuilder.length() - 1);