Fix progress bar

live-activity-data
Daniele Gobbetti 2015-09-24 14:02:33 +02:00
parent 8ba307657a
commit 5578691321
1 changed files with 2 additions and 2 deletions

View File

@ -190,10 +190,10 @@ public class UpdateFirmwareOperation extends AbstractBTLEOperation<MiBandSupport
if ((i > 0) && (i % 50 == 0)) {
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)) {