mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Fixed incorrect caption sizes after device orientation change.
This commit is contained in:
parent
35a9f2635c
commit
ead8abf09f
1 changed files with 4 additions and 4 deletions
|
|
@ -97,7 +97,7 @@ public final class SubtitleLayout extends ViewGroup {
|
||||||
*/
|
*/
|
||||||
public void setFontScale(float scale) {
|
public void setFontScale(float scale) {
|
||||||
fontScale = scale;
|
fontScale = scale;
|
||||||
updateSubtitlesTextSize();
|
updateSubtitlesTextSize(getHeight());
|
||||||
|
|
||||||
for (SubtitleView subtitleView : subtitleViews) {
|
for (SubtitleView subtitleView : subtitleViews) {
|
||||||
subtitleView.setTextSize(textSize);
|
subtitleView.setTextSize(textSize);
|
||||||
|
|
@ -125,7 +125,7 @@ public final class SubtitleLayout extends ViewGroup {
|
||||||
int height = MeasureSpec.getSize(heightMeasureSpec);
|
int height = MeasureSpec.getSize(heightMeasureSpec);
|
||||||
setMeasuredDimension(width, height);
|
setMeasuredDimension(width, height);
|
||||||
|
|
||||||
updateSubtitlesTextSize();
|
updateSubtitlesTextSize(height);
|
||||||
|
|
||||||
for (int i = 0; i < viewsInUse; i++) {
|
for (int i = 0; i < viewsInUse; i++) {
|
||||||
subtitleViews.get(i).setTextSize(textSize);
|
subtitleViews.get(i).setTextSize(textSize);
|
||||||
|
|
@ -175,8 +175,8 @@ public final class SubtitleLayout extends ViewGroup {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateSubtitlesTextSize() {
|
private void updateSubtitlesTextSize(int height) {
|
||||||
textSize = LINE_HEIGHT_RATIO * getHeight() * fontScale;
|
textSize = LINE_HEIGHT_RATIO * height * fontScale;
|
||||||
}
|
}
|
||||||
|
|
||||||
private SubtitleView createSubtitleView() {
|
private SubtitleView createSubtitleView() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue