mirror of
https://github.com/samsonjs/media.git
synced 2026-03-30 10:15:48 +00:00
Don't try to access the caption manager when in edit mode.
Issue: #1991 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=137131819
This commit is contained in:
parent
99503e6e3a
commit
ba6368a07a
2 changed files with 6 additions and 4 deletions
|
|
@ -46,6 +46,7 @@ public abstract class TrackSelector<T> {
|
|||
* @param trackSelections The new track selections.
|
||||
*/
|
||||
void onTrackSelectionsChanged(TrackSelections<? extends T> trackSelections);
|
||||
|
||||
}
|
||||
|
||||
private final Handler eventHandler;
|
||||
|
|
|
|||
|
|
@ -122,10 +122,10 @@ public final class SubtitleView extends View implements TextRenderer.Output {
|
|||
|
||||
/**
|
||||
* Sets the text size to one derived from {@link CaptioningManager#getFontScale()}, or to a
|
||||
* default size on API level 19 and earlier.
|
||||
* default size before API level 19.
|
||||
*/
|
||||
public void setUserDefaultTextSize() {
|
||||
float fontScale = Util.SDK_INT >= 19 ? getUserCaptionFontScaleV19() : 1f;
|
||||
float fontScale = Util.SDK_INT >= 19 && !isInEditMode() ? getUserCaptionFontScaleV19() : 1f;
|
||||
setFractionalTextSize(DEFAULT_TEXT_SIZE_FRACTION * fontScale);
|
||||
}
|
||||
|
||||
|
|
@ -180,10 +180,11 @@ public final class SubtitleView extends View implements TextRenderer.Output {
|
|||
|
||||
/**
|
||||
* Sets the caption style to be equivalent to the one returned by
|
||||
* {@link CaptioningManager#getUserStyle()}, or to a default style on API level 19 and earlier.
|
||||
* {@link CaptioningManager#getUserStyle()}, or to a default style before API level 19.
|
||||
*/
|
||||
public void setUserDefaultStyle() {
|
||||
setStyle(Util.SDK_INT >= 19 ? getUserCaptionStyleV19() : CaptionStyleCompat.DEFAULT);
|
||||
setStyle(Util.SDK_INT >= 19 && !isInEditMode()
|
||||
? getUserCaptionStyleV19() : CaptionStyleCompat.DEFAULT);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue