From eb119b7fc3233c9b1f89cf562591007f2c4d4670 Mon Sep 17 00:00:00 2001 From: xufulong <839789740@qq.com> Date: Mon, 12 Oct 2020 00:44:26 +0800 Subject: [PATCH] update progress when processing command --- .../java/com/frank/ffmpeg/activity/VideoHandleActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/frank/ffmpeg/activity/VideoHandleActivity.java b/app/src/main/java/com/frank/ffmpeg/activity/VideoHandleActivity.java index cf714ad..2c5b777 100644 --- a/app/src/main/java/com/frank/ffmpeg/activity/VideoHandleActivity.java +++ b/app/src/main/java/com/frank/ffmpeg/activity/VideoHandleActivity.java @@ -82,9 +82,12 @@ public class VideoHandleActivity extends BaseActivity { break; case MSG_PROGRESS: int progress = msg.arg1; + int duration = msg.arg2; if (progress > 0) { txtProgress.setVisibility(View.VISIBLE); - txtProgress.setText(String.format(Locale.getDefault(), "%d%%", progress)); + String percent = duration > 0 ? "%" : ""; + String strProgress = progress + percent; + txtProgress.setText(strProgress); } else { txtProgress.setVisibility(View.INVISIBLE); }