Commit f2a027e0 by bachinger

Move text classes from lib-exoplayer to lib-extractor and lib-common

PiperOrigin-RevId: 398247348
parent 59cd783d
Showing with 8 additions and 8 deletions
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
*/ */
package com.google.android.exoplayer2.text.webvtt; package com.google.android.exoplayer2.text.webvtt;
import static com.google.android.exoplayer2.text.span.SpanUtil.addOrReplaceSpan;
import static java.lang.Math.min; import static java.lang.Math.min;
import static java.lang.annotation.RetentionPolicy.SOURCE; import static java.lang.annotation.RetentionPolicy.SOURCE;
...@@ -39,6 +38,7 @@ import androidx.annotation.Nullable; ...@@ -39,6 +38,7 @@ import androidx.annotation.Nullable;
import com.google.android.exoplayer2.text.Cue; import com.google.android.exoplayer2.text.Cue;
import com.google.android.exoplayer2.text.span.HorizontalTextInVerticalContextSpan; import com.google.android.exoplayer2.text.span.HorizontalTextInVerticalContextSpan;
import com.google.android.exoplayer2.text.span.RubySpan; import com.google.android.exoplayer2.text.span.RubySpan;
import com.google.android.exoplayer2.text.span.SpanUtil;
import com.google.android.exoplayer2.text.span.TextAnnotation; import com.google.android.exoplayer2.text.span.TextAnnotation;
import com.google.android.exoplayer2.util.Assertions; import com.google.android.exoplayer2.util.Assertions;
import com.google.android.exoplayer2.util.Log; import com.google.android.exoplayer2.util.Log;
...@@ -662,7 +662,7 @@ public final class WebvttCueParser { ...@@ -662,7 +662,7 @@ public final class WebvttCueParser {
return; return;
} }
if (style.getStyle() != WebvttCssStyle.UNSPECIFIED) { if (style.getStyle() != WebvttCssStyle.UNSPECIFIED) {
addOrReplaceSpan( SpanUtil.addOrReplaceSpan(
spannedText, spannedText,
new StyleSpan(style.getStyle()), new StyleSpan(style.getStyle()),
start, start,
...@@ -676,7 +676,7 @@ public final class WebvttCueParser { ...@@ -676,7 +676,7 @@ public final class WebvttCueParser {
spannedText.setSpan(new UnderlineSpan(), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); spannedText.setSpan(new UnderlineSpan(), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
} }
if (style.hasFontColor()) { if (style.hasFontColor()) {
addOrReplaceSpan( SpanUtil.addOrReplaceSpan(
spannedText, spannedText,
new ForegroundColorSpan(style.getFontColor()), new ForegroundColorSpan(style.getFontColor()),
start, start,
...@@ -684,7 +684,7 @@ public final class WebvttCueParser { ...@@ -684,7 +684,7 @@ public final class WebvttCueParser {
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
} }
if (style.hasBackgroundColor()) { if (style.hasBackgroundColor()) {
addOrReplaceSpan( SpanUtil.addOrReplaceSpan(
spannedText, spannedText,
new BackgroundColorSpan(style.getBackgroundColor()), new BackgroundColorSpan(style.getBackgroundColor()),
start, start,
...@@ -692,7 +692,7 @@ public final class WebvttCueParser { ...@@ -692,7 +692,7 @@ public final class WebvttCueParser {
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
} }
if (style.getFontFamily() != null) { if (style.getFontFamily() != null) {
addOrReplaceSpan( SpanUtil.addOrReplaceSpan(
spannedText, spannedText,
new TypefaceSpan(style.getFontFamily()), new TypefaceSpan(style.getFontFamily()),
start, start,
...@@ -701,7 +701,7 @@ public final class WebvttCueParser { ...@@ -701,7 +701,7 @@ public final class WebvttCueParser {
} }
switch (style.getFontSizeUnit()) { switch (style.getFontSizeUnit()) {
case WebvttCssStyle.FONT_SIZE_UNIT_PIXEL: case WebvttCssStyle.FONT_SIZE_UNIT_PIXEL:
addOrReplaceSpan( SpanUtil.addOrReplaceSpan(
spannedText, spannedText,
new AbsoluteSizeSpan((int) style.getFontSize(), true), new AbsoluteSizeSpan((int) style.getFontSize(), true),
start, start,
...@@ -709,7 +709,7 @@ public final class WebvttCueParser { ...@@ -709,7 +709,7 @@ public final class WebvttCueParser {
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
break; break;
case WebvttCssStyle.FONT_SIZE_UNIT_EM: case WebvttCssStyle.FONT_SIZE_UNIT_EM:
addOrReplaceSpan( SpanUtil.addOrReplaceSpan(
spannedText, spannedText,
new RelativeSizeSpan(style.getFontSize()), new RelativeSizeSpan(style.getFontSize()),
start, start,
...@@ -717,7 +717,7 @@ public final class WebvttCueParser { ...@@ -717,7 +717,7 @@ public final class WebvttCueParser {
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
break; break;
case WebvttCssStyle.FONT_SIZE_UNIT_PERCENT: case WebvttCssStyle.FONT_SIZE_UNIT_PERCENT:
addOrReplaceSpan( SpanUtil.addOrReplaceSpan(
spannedText, spannedText,
new RelativeSizeSpan(style.getFontSize() / 100), new RelativeSizeSpan(style.getFontSize() / 100),
start, start,
......
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