1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-16 18:34:03 +02:00

Fix progress bar

This commit is contained in:
Daniele Gobbetti 2015-09-24 14:02:33 +02:00
parent 8ba307657a
commit 5578691321

View File

@ -190,10 +190,10 @@ public class UpdateFirmwareOperation extends AbstractBTLEOperation<MiBandSupport
if ((i > 0) && (i % 50 == 0)) { if ((i > 0) && (i % 50 == 0)) {
builder.write(getCharacteristic(MiBandService.UUID_CHARACTERISTIC_CONTROL_POINT), new byte[]{MiBandService.COMMAND_SYNC}); builder.write(getCharacteristic(MiBandService.UUID_CHARACTERISTIC_CONTROL_POINT), new byte[]{MiBandService.COMMAND_SYNC});
builder.add(new SetProgressAction("Firmware update in progress", true, (firmwareProgress / len) * 100, getContext())); builder.add(new SetProgressAction("Firmware update in progress", true, (int)(((float) firmwareProgress) / len * 100), getContext()));
} }
LOG.info("Firmware update progress:" + firmwareProgress + " total len:" + len + " progress:" + (firmwareProgress / len)); LOG.info("Firmware update progress:" + firmwareProgress + " total len:" + len + " progress:" + (int)(((float) firmwareProgress) / len * 100));
} }
if (!(len % packetLength == 0)) { if (!(len % packetLength == 0)) {