mirror of
https://github.com/samsonjs/media.git
synced 2026-04-11 12:15:47 +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;
|
||||
int lineTranslatePercent;
|
||||
@Cue.AnchorType int lineAnchor;
|
||||
if (cue.line != Cue.DIMEN_UNSET) {
|
||||
switch (cue.lineType) {
|
||||
case Cue.LINE_TYPE_NUMBER:
|
||||
|
|
@ -189,14 +190,17 @@ import java.util.List;
|
|||
linePercent = cue.line * 100;
|
||||
lineTranslatePercent = 0;
|
||||
}
|
||||
lineAnchor = cue.lineAnchor;
|
||||
} else {
|
||||
linePercent = 100;
|
||||
linePercent = (1.0f - bottomPaddingFraction) * 100;
|
||||
lineTranslatePercent = 0;
|
||||
// If Cue.line == DIMEN_UNSET then ignore Cue.lineAnchor and assume ANCHOR_TYPE_END.
|
||||
lineAnchor = Cue.ANCHOR_TYPE_END;
|
||||
}
|
||||
int lineAnchorTranslatePercent =
|
||||
cue.verticalType == Cue.VERTICAL_TYPE_RL
|
||||
? -anchorTypeToTranslatePercent(cue.lineAnchor)
|
||||
: anchorTypeToTranslatePercent(cue.lineAnchor);
|
||||
? -anchorTypeToTranslatePercent(lineAnchor)
|
||||
: anchorTypeToTranslatePercent(lineAnchor);
|
||||
|
||||
String size =
|
||||
cue.size != Cue.DIMEN_UNSET
|
||||
|
|
|
|||
Loading…
Reference in a new issue