From 2318ad2bdea5a3ac15f50db2e80ad73dbc6596b6 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Fri, 4 Mar 2016 14:16:02 +0100 Subject: [PATCH] changed viewcount notation --- .../org/schabi/newpipe/VideoInfoItemViewCreator.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/VideoInfoItemViewCreator.java b/app/src/main/java/org/schabi/newpipe/VideoInfoItemViewCreator.java index 9f0eefcb9..d82d18b39 100644 --- a/app/src/main/java/org/schabi/newpipe/VideoInfoItemViewCreator.java +++ b/app/src/main/java/org/schabi/newpipe/VideoInfoItemViewCreator.java @@ -125,12 +125,14 @@ class VideoInfoItemViewCreator { int minutes = duration / 60; int seconds = duration % 60; + //handle days if(days > 0) { output = Integer.toString(days) + ":"; } + // handle hours if(hours > 0 || !output.isEmpty()) { if(hours > 0) { - if(hours >= 10) { + if(hours >= 10 || output.isEmpty()) { output += Integer.toString(minutes); } else { output += "0" + Integer.toString(minutes); @@ -140,9 +142,10 @@ class VideoInfoItemViewCreator { } output += ":"; } + //handle minutes if(minutes > 0 || !output.isEmpty()) { if(minutes > 0) { - if(minutes >= 10) { + if(minutes >= 10 || output.isEmpty()) { output += Integer.toString(minutes); } else { output += "0" + Integer.toString(minutes); @@ -153,6 +156,11 @@ class VideoInfoItemViewCreator { output += ":"; } + //handle seconds + if(output.isEmpty()) { + output += "0:"; + } + if(seconds >= 10) { output += Integer.toString(seconds); } else {