mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Add bottomPaddingFraction support to SubtitleWebView
PiperOrigin-RevId: 309245320
This commit is contained in:
parent
caeeae2c9e
commit
ab57c8010f
1 changed files with 7 additions and 3 deletions
|
|
@ -172,6 +172,7 @@ import java.util.List;
|
||||||
|
|
||||||
float linePercent;
|
float linePercent;
|
||||||
int lineTranslatePercent;
|
int lineTranslatePercent;
|
||||||
|
@Cue.AnchorType int lineAnchor;
|
||||||
if (cue.line != Cue.DIMEN_UNSET) {
|
if (cue.line != Cue.DIMEN_UNSET) {
|
||||||
switch (cue.lineType) {
|
switch (cue.lineType) {
|
||||||
case Cue.LINE_TYPE_NUMBER:
|
case Cue.LINE_TYPE_NUMBER:
|
||||||
|
|
@ -189,14 +190,17 @@ import java.util.List;
|
||||||
linePercent = cue.line * 100;
|
linePercent = cue.line * 100;
|
||||||
lineTranslatePercent = 0;
|
lineTranslatePercent = 0;
|
||||||
}
|
}
|
||||||
|
lineAnchor = cue.lineAnchor;
|
||||||
} else {
|
} else {
|
||||||
linePercent = 100;
|
linePercent = (1.0f - bottomPaddingFraction) * 100;
|
||||||
lineTranslatePercent = 0;
|
lineTranslatePercent = 0;
|
||||||
|
// If Cue.line == DIMEN_UNSET then ignore Cue.lineAnchor and assume ANCHOR_TYPE_END.
|
||||||
|
lineAnchor = Cue.ANCHOR_TYPE_END;
|
||||||
}
|
}
|
||||||
int lineAnchorTranslatePercent =
|
int lineAnchorTranslatePercent =
|
||||||
cue.verticalType == Cue.VERTICAL_TYPE_RL
|
cue.verticalType == Cue.VERTICAL_TYPE_RL
|
||||||
? -anchorTypeToTranslatePercent(cue.lineAnchor)
|
? -anchorTypeToTranslatePercent(lineAnchor)
|
||||||
: anchorTypeToTranslatePercent(cue.lineAnchor);
|
: anchorTypeToTranslatePercent(lineAnchor);
|
||||||
|
|
||||||
String size =
|
String size =
|
||||||
cue.size != Cue.DIMEN_UNSET
|
cue.size != Cue.DIMEN_UNSET
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue