Skip to content

Commit 819ce11

Browse files
committed
Simplify timestamp generation for slider
1 parent 1c45c00 commit 819ce11

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/src/main/java/protect/videotranscoder/activity/MainActivity.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ public void onPrepared(MediaPlayer mp)
318318
{
319319
int durationMs = mp.getDuration();
320320
tvLeft.setVisibility(View.VISIBLE);
321-
tvLeft.setText("00:00:00");
321+
tvLeft.setText(getTime(0));
322322
tvRight.setVisibility(View.VISIBLE);
323323
tvRight.setText(getTime(durationMs / 1000));
324324
mp.setLooping(true);
@@ -372,7 +372,8 @@ private String getTime(int seconds)
372372
int rem = seconds % 3600;
373373
int mn = rem / 60;
374374
int sec = rem % 60;
375-
return String.format("%02d", hr) + ":" + String.format("%02d", mn) + ":" + String.format("%02d", sec);
375+
376+
return String.format(Locale.US, "%02d:%02d:%02d", hr, mn, sec);
376377
}
377378

378379
private void showUnsupportedExceptionDialog()

0 commit comments

Comments
 (0)