update progress when processing command

pull/166/head
xufulong 4 years ago
parent b91a61f0ea
commit eb119b7fc3
  1. 5
      app/src/main/java/com/frank/ffmpeg/activity/VideoHandleActivity.java

@ -82,9 +82,12 @@ public class VideoHandleActivity extends BaseActivity {
break; break;
case MSG_PROGRESS: case MSG_PROGRESS:
int progress = msg.arg1; int progress = msg.arg1;
int duration = msg.arg2;
if (progress > 0) { if (progress > 0) {
txtProgress.setVisibility(View.VISIBLE); txtProgress.setVisibility(View.VISIBLE);
txtProgress.setText(String.format(Locale.getDefault(), "%d%%", progress)); String percent = duration > 0 ? "%" : "";
String strProgress = progress + percent;
txtProgress.setText(strProgress);
} else { } else {
txtProgress.setVisibility(View.INVISIBLE); txtProgress.setVisibility(View.INVISIBLE);
} }

Loading…
Cancel
Save