Class ShadowCaptioningManager

java.lang.Object
org.robolectric.shadows.ShadowCaptioningManager

@Implements(CaptioningManager.class) public class ShadowCaptioningManager extends Object
  • Constructor Details

    • ShadowCaptioningManager

      public ShadowCaptioningManager()
  • Method Details

    • setSystemAudioCaptioningEnabled

      @Implementation(minSdk=33) protected void setSystemAudioCaptioningEnabled(boolean isEnabled)
    • setSystemAudioCaptioningUiEnabled

      @Implementation(minSdk=33) protected void setSystemAudioCaptioningUiEnabled(boolean isEnabled)
    • isSystemAudioCaptioningUiEnabled

      @Implementation(minSdk=33) protected boolean isSystemAudioCaptioningUiEnabled()
    • setEnabled

      public void setEnabled(boolean enabled)
      Sets the enabled state of the captioning manager.
    • setLocale

      public void setLocale(Locale locale)
      Sets the preferred locale of the captioning manager.
      Parameters:
      locale - The Locale.
    • 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 a CaptioningManager.CaptionStyle with these values.

      Parameters:
      foregroundColor - The text color.
      backgroundColor - The color behind the text.
      edgeType - The edge type, for example CaptioningManager.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", or null for the default typeface.