Extract common part from if
This commit is contained in:
parent
b7f50c3e12
commit
552d585fca
1 changed files with 2 additions and 4 deletions
|
@ -322,18 +322,16 @@ public class VideoPlayerImpl extends VideoPlayer
|
|||
if (popupPlayerSelected()) {
|
||||
final float captionRatio = (captionScale - 1.0f) / 5.0f + 1.0f;
|
||||
view.setFractionalTextSize(SubtitleView.DEFAULT_TEXT_SIZE_FRACTION * captionRatio);
|
||||
view.setApplyEmbeddedStyles(captionStyle.equals(CaptionStyleCompat.DEFAULT));
|
||||
view.setStyle(captionStyle);
|
||||
} else {
|
||||
final DisplayMetrics metrics = context.getResources().getDisplayMetrics();
|
||||
final int minimumLength = Math.min(metrics.heightPixels, metrics.widthPixels);
|
||||
final float captionRatioInverse = 20f + 4f * (1.0f - captionScale);
|
||||
view.setFixedTextSize(TypedValue.COMPLEX_UNIT_PX,
|
||||
(float) minimumLength / captionRatioInverse);
|
||||
}
|
||||
view.setApplyEmbeddedStyles(captionStyle.equals(CaptionStyleCompat.DEFAULT));
|
||||
view.setStyle(captionStyle);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method ensures that popup and main players have different look.
|
||||
|
|
Loading…
Reference in a new issue