Commit 04d32533 by ibaker Committed by Ian Baker

Add default to switch in TtmlDecoder

Also de-dupe a couple of case statements

PiperOrigin-RevId: 290610993
parent 9cfc75ff
...@@ -488,20 +488,19 @@ public final class TtmlDecoder extends SimpleSubtitleDecoder { ...@@ -488,20 +488,19 @@ public final class TtmlDecoder extends SimpleSubtitleDecoder {
case TtmlNode.ATTR_TTS_TEXT_ALIGN: case TtmlNode.ATTR_TTS_TEXT_ALIGN:
switch (Util.toLowerInvariant(attributeValue)) { switch (Util.toLowerInvariant(attributeValue)) {
case TtmlNode.LEFT: case TtmlNode.LEFT:
style = createIfNull(style).setTextAlign(Layout.Alignment.ALIGN_NORMAL);
break;
case TtmlNode.START: case TtmlNode.START:
style = createIfNull(style).setTextAlign(Layout.Alignment.ALIGN_NORMAL); style = createIfNull(style).setTextAlign(Layout.Alignment.ALIGN_NORMAL);
break; break;
case TtmlNode.RIGHT: case TtmlNode.RIGHT:
style = createIfNull(style).setTextAlign(Layout.Alignment.ALIGN_OPPOSITE);
break;
case TtmlNode.END: case TtmlNode.END:
style = createIfNull(style).setTextAlign(Layout.Alignment.ALIGN_OPPOSITE); style = createIfNull(style).setTextAlign(Layout.Alignment.ALIGN_OPPOSITE);
break; break;
case TtmlNode.CENTER: case TtmlNode.CENTER:
style = createIfNull(style).setTextAlign(Layout.Alignment.ALIGN_CENTER); style = createIfNull(style).setTextAlign(Layout.Alignment.ALIGN_CENTER);
break; break;
default:
// ignore
break;
} }
break; break;
case TtmlNode.ATTR_TTS_TEXT_DECORATION: case TtmlNode.ATTR_TTS_TEXT_DECORATION:
......
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