remove static import for String.format and unused constant

This commit is contained in:
caneleex 2021-07-24 20:22:31 +02:00
parent 00350bf081
commit d3e2f2c5e4

View File

@ -35,7 +35,6 @@ import static android.text.Html.fromHtml;
import static android.view.View.GONE; import static android.view.View.GONE;
import static android.view.View.VISIBLE; import static android.view.View.VISIBLE;
import static fi.razerman.youtube.XGlobals.debug; import static fi.razerman.youtube.XGlobals.debug;
import static java.lang.String.format;
import static pl.jakubweg.PlayerController.getCurrentVideoId; import static pl.jakubweg.PlayerController.getCurrentVideoId;
import static pl.jakubweg.PlayerController.getLastKnownVideoTime; import static pl.jakubweg.PlayerController.getLastKnownVideoTime;
import static pl.jakubweg.PlayerController.sponsorSegmentsOfCurrentVideo; import static pl.jakubweg.PlayerController.sponsorSegmentsOfCurrentVideo;
@ -50,7 +49,6 @@ import static pl.jakubweg.requests.Requester.voteForSegment;
public abstract class SponsorBlockUtils { public abstract class SponsorBlockUtils {
public static final String TAG = "jakubweg.SponsorBlockUtils"; public static final String TAG = "jakubweg.SponsorBlockUtils";
public static final String DATE_FORMAT = "HH:mm:ss.SSS"; public static final String DATE_FORMAT = "HH:mm:ss.SSS";
public static final String TIME_WITHOUT_SEGMENTS_FORMAT = "%d:%d%02d";
@SuppressLint("SimpleDateFormat") @SuppressLint("SimpleDateFormat")
public static final SimpleDateFormat dateFormatter = new SimpleDateFormat(DATE_FORMAT); public static final SimpleDateFormat dateFormatter = new SimpleDateFormat(DATE_FORMAT);
public static boolean videoHasSegments = false; public static boolean videoHasSegments = false;
@ -330,7 +328,7 @@ public abstract class SponsorBlockUtils {
String start = dateFormatter.format(new Date(segment.start)); String start = dateFormatter.format(new Date(segment.start));
String end = dateFormatter.format(new Date(segment.end)); String end = dateFormatter.format(new Date(segment.end));
StringBuilder htmlBuilder = new StringBuilder(); StringBuilder htmlBuilder = new StringBuilder();
htmlBuilder.append(format("<b><font color=\"#%06X\">⬤</font> %s<br> %s to %s", htmlBuilder.append(String.format("<b><font color=\"#%06X\">⬤</font> %s<br> %s to %s",
segment.category.color, segment.category.title, start, end)); segment.category.color, segment.category.title, start, end));
if (i + 1 != segmentAmount) // prevents trailing new line after last segment if (i + 1 != segmentAmount) // prevents trailing new line after last segment
htmlBuilder.append("<br>"); htmlBuilder.append("<br>");
@ -475,7 +473,7 @@ public abstract class SponsorBlockUtils {
double saved = stats.getMinutesSaved(); double saved = stats.getMinutesSaved();
int hoursSaved = (int) (saved / 60); int hoursSaved = (int) (saved / 60);
double minutesSaved = saved % 60; double minutesSaved = saved % 60;
String formattedSaved = format(SAVED_TEMPLATE, hoursSaved, minutesSaved); String formattedSaved = String.format(SAVED_TEMPLATE, hoursSaved, minutesSaved);
preference.setTitle(fromHtml(str("stats_saved", formatted))); preference.setTitle(fromHtml(str("stats_saved", formatted)));
preference.setSummary(fromHtml(str("stats_saved_sum", formattedSaved))); preference.setSummary(fromHtml(str("stats_saved_sum", formattedSaved)));
@ -494,7 +492,7 @@ public abstract class SponsorBlockUtils {
long hoursSaved = skippedTime / 3600000; long hoursSaved = skippedTime / 3600000;
double minutesSaved = (skippedTime / 60000d) % 60; double minutesSaved = (skippedTime / 60000d) % 60;
String formattedSaved = format(SAVED_TEMPLATE, hoursSaved, minutesSaved); String formattedSaved = String.format(SAVED_TEMPLATE, hoursSaved, minutesSaved);
preference.setTitle(fromHtml(str("stats_self_saved", formatted))); preference.setTitle(fromHtml(str("stats_self_saved", formatted)));
preference.setSummary(fromHtml(str("stats_self_saved_sum", formattedSaved))); preference.setSummary(fromHtml(str("stats_self_saved_sum", formattedSaved)));