Class ShadowCaptioningManager
java.lang.Object
org.robolectric.shadows.ShadowCaptioningManager
Shadow of
CaptioningManager.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanvoidsetEnabled(boolean enabled) Sets the enabled state of the captioning manager.voidsetFontScale(float fontScale) Sets the preferred font scale of the captioning manager.voidSets the preferred locale of the captioning manager.protected voidsetSystemAudioCaptioningEnabled(boolean isEnabled) protected voidsetSystemAudioCaptioningUiEnabled(boolean isEnabled) voidsetUserStyle(int foregroundColor, int backgroundColor, int edgeType, int edgeColor, int windowColor, String typeface) Sets a custom user caption style, as if the user had chosen custom caption options in the system settings.
-
Constructor Details
-
ShadowCaptioningManager
public ShadowCaptioningManager()
-
-
Method Details
-
setSystemAudioCaptioningEnabled
-
setSystemAudioCaptioningUiEnabled
-
isSystemAudioCaptioningUiEnabled
-
setEnabled
public void setEnabled(boolean enabled) Sets the enabled state of the captioning manager. -
setLocale
-
setFontScale
public void setFontScale(float fontScale) Sets the preferred font scale of the captioning manager.- Parameters:
fontScale- The font scale, where 1 is the default size.
-
setUserStyle
public void setUserStyle(int foregroundColor, int backgroundColor, int edgeType, int edgeColor, int windowColor, @Nullable String typeface) Sets a custom user caption style, as if the user had chosen custom caption options in the system settings.CaptioningManager.getUserStyle()then returns aCaptioningManager.CaptionStylewith these values.- Parameters:
foregroundColor- The text color.backgroundColor- The color behind the text.edgeType- The edge type, for exampleCaptioningManager.CaptionStyle.EDGE_TYPE_OUTLINE.edgeColor- The edge color.windowColor- The color of the window that contains the captions.typeface- The typeface family name, for example"monospace", ornullfor the default typeface.
-