OSDN Git Service

FUJIのファイルダウンロード中、進捗ダイアログの進捗が適切に表現されていなかったのを修正。する。
authorMRSa <mrsa@myad.jp>
Tue, 5 May 2020 01:52:54 +0000 (10:52 +0900)
committerMRSa <mrsa@myad.jp>
Tue, 5 May 2020 01:52:54 +0000 (10:52 +0900)
app/src/main/java/net/osdn/gokigen/gr2control/camera/fuji_x/wrapper/playback/FujiXFullImageReceiver.java

index 2e30f43..ff1a687 100644 (file)
@@ -43,8 +43,8 @@ public class FujiXFullImageReceiver implements IFujiXCommandCallback
         try
         {
             receivedLength = receivedLength + currentBytes;
         try
         {
             receivedLength = receivedLength + currentBytes;
-            //Log.v(TAG, " onReceiveProgress() " + receivedLength + "/" + totalBytes);
-            float percent = (totalBytes == 0) ? 0.0f : ((float) currentBytes / (float) totalBytes);
+            float percent = (totalBytes == 0) ? 0.0f : ((float) receivedLength / (float) totalBytes);
+            //Log.v(TAG, " onReceiveProgress() " + receivedLength + "/" + totalBytes + " " + percent);
             ProgressEvent event = new ProgressEvent(percent, null);
             callback.onProgress(body, currentBytes, event);
         }
             ProgressEvent event = new ProgressEvent(percent, null);
             callback.onProgress(body, currentBytes, event);
         }