Commit 0fb4ba78 by ibaker Committed by Oliver Woodman

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
parent 8528129e
...@@ -127,7 +127,7 @@ import java.util.List; ...@@ -127,7 +127,7 @@ import java.util.List;
StringBuilder html = new StringBuilder(); StringBuilder html = new StringBuilder();
html.append( html.append(
Util.formatInvariant( Util.formatInvariant(
"<html><body><div style=\"" "<html><body><div style='"
+ "-webkit-user-select:none;" + "-webkit-user-select:none;"
+ "position:fixed;" + "position:fixed;"
+ "top:0;" + "top:0;"
...@@ -136,7 +136,7 @@ import java.util.List; ...@@ -136,7 +136,7 @@ import java.util.List;
+ "right:0;" + "right:0;"
+ "color:%s;" + "color:%s;"
+ "font-size:%s;" + "font-size:%s;"
+ "\">", + "'>",
HtmlUtils.toCssRgba(style.foregroundColor), HtmlUtils.toCssRgba(style.foregroundColor),
convertTextSizeToCss(defaultTextSizeType, defaultTextSize))); convertTextSizeToCss(defaultTextSizeType, defaultTextSize)));
...@@ -222,7 +222,7 @@ import java.util.List; ...@@ -222,7 +222,7 @@ import java.util.List;
html.append( html.append(
Util.formatInvariant( Util.formatInvariant(
"<div style=\"" "<div style='"
+ "position:absolute;" + "position:absolute;"
+ "%s:%.2f%%;" + "%s:%.2f%%;"
+ "%s:%.2f%%;" + "%s:%.2f%%;"
...@@ -232,7 +232,7 @@ import java.util.List; ...@@ -232,7 +232,7 @@ import java.util.List;
+ "font-size:%s;" + "font-size:%s;"
+ "background-color:%s;" + "background-color:%s;"
+ "transform:translate(%s%%,%s%%);" + "transform:translate(%s%%,%s%%);"
+ "\">", + "'>",
positionProperty, positionProperty,
positionPercent, positionPercent,
lineProperty, lineProperty,
...@@ -245,7 +245,7 @@ import java.util.List; ...@@ -245,7 +245,7 @@ import java.util.List;
windowCssColor, windowCssColor,
horizontalTranslatePercent, horizontalTranslatePercent,
verticalTranslatePercent)) verticalTranslatePercent))
.append(Util.formatInvariant("<span style=\"background-color:%s;\">", backgroundColorCss)) .append(Util.formatInvariant("<span style='background-color:%s;'>", backgroundColorCss))
.append( .append(
SpannedToHtmlConverter.convert( SpannedToHtmlConverter.convert(
cue.text, getContext().getResources().getDisplayMetrics().density)) cue.text, getContext().getResources().getDisplayMetrics().density))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment