Skip to content

Commit

Permalink
fix(barcode-scanning): invalid progress values
Browse files Browse the repository at this point in the history
  • Loading branch information
robingenz committed Apr 9, 2024
1 parent cb63726 commit 21a0698
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/purple-seahorses-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@capacitor-mlkit/barcode-scanning': patch
'@capacitor-mlkit/translation': patch
---

fix(android): invalid `progress` values
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void onInstallStatusUpdated(ModuleInstallStatusUpdate update) {
// Progress info is only set when modules are in the progress of downloading.
Integer progress = null;
if (progressInfo != null) {
progress = (int) (progressInfo.getBytesDownloaded() / progressInfo.getTotalBytesToDownload());
progress = (int) (100 * (progressInfo.getBytesDownloaded() / progressInfo.getTotalBytesToDownload()));
}
implementation.handleGoogleBarcodeScannerModuleInstallProgress(state, progress);
}
Expand Down

0 comments on commit 21a0698

Please sign in to comment.