Switch SubtitleWebView to use single-quotes in generated HTML

The current state is inconsistent with SpannedToHtmlConverter, it seems
they might as well agree on quoting strategy.

PiperOrigin-RevId: 310926683
This commit is contained in:
ibaker 2020-05-11 17:19:03 +01:00 committed by Oliver Woodman
parent 8528129e8d
commit 0fb4ba788f

View File

@ -127,7 +127,7 @@ import java.util.List;
StringBuilder html = new StringBuilder();
html.append(
Util.formatInvariant(
"<html><body><div style=\""
"<html><body><div style='"
+ "-webkit-user-select:none;"
+ "position:fixed;"
+ "top:0;"
@ -136,7 +136,7 @@ import java.util.List;
+ "right:0;"
+ "color:%s;"
+ "font-size:%s;"
+ "\">",
+ "'>",
HtmlUtils.toCssRgba(style.foregroundColor),
convertTextSizeToCss(defaultTextSizeType, defaultTextSize)));
@ -222,7 +222,7 @@ import java.util.List;
html.append(
Util.formatInvariant(
"<div style=\""
"<div style='"
+ "position:absolute;"
+ "%s:%.2f%%;"
+ "%s:%.2f%%;"
@ -232,7 +232,7 @@ import java.util.List;
+ "font-size:%s;"
+ "background-color:%s;"
+ "transform:translate(%s%%,%s%%);"
+ "\">",
+ "'>",
positionProperty,
positionPercent,
lineProperty,
@ -245,7 +245,7 @@ import java.util.List;
windowCssColor,
horizontalTranslatePercent,
verticalTranslatePercent))
.append(Util.formatInvariant("<span style=\"background-color:%s;\">", backgroundColorCss))
.append(Util.formatInvariant("<span style='background-color:%s;'>", backgroundColorCss))
.append(
SpannedToHtmlConverter.convert(
cue.text, getContext().getResources().getDisplayMetrics().density))