Java Code Examples for android.view.accessibility.CaptioningManager#CaptionStyle

The following examples show how to use android.view.accessibility.CaptioningManager#CaptionStyle . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CaptionStyleCompat.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@TargetApi(19)
@SuppressWarnings("ResourceType")
private static CaptionStyleCompat createFromCaptionStyleV19(
    CaptioningManager.CaptionStyle captionStyle) {
  return new CaptionStyleCompat(
      captionStyle.foregroundColor, captionStyle.backgroundColor, Color.TRANSPARENT,
      captionStyle.edgeType, captionStyle.edgeColor, captionStyle.getTypeface());
}
 
Example 2
Source File: CaptionStyleCompat.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
@TargetApi(21)
@SuppressWarnings("ResourceType")
private static CaptionStyleCompat createFromCaptionStyleV21(
    CaptioningManager.CaptionStyle captionStyle) {
  return new CaptionStyleCompat(
      captionStyle.hasForegroundColor() ? captionStyle.foregroundColor : DEFAULT.foregroundColor,
      captionStyle.hasBackgroundColor() ? captionStyle.backgroundColor : DEFAULT.backgroundColor,
      captionStyle.hasWindowColor() ? captionStyle.windowColor : DEFAULT.windowColor,
      captionStyle.hasEdgeType() ? captionStyle.edgeType : DEFAULT.edgeType,
      captionStyle.hasEdgeColor() ? captionStyle.edgeColor : DEFAULT.edgeColor,
      captionStyle.getTypeface());
}
 
Example 3
Source File: CaptionStyleCompat.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
@TargetApi(19)
@SuppressWarnings("ResourceType")
private static CaptionStyleCompat createFromCaptionStyleV19(
    CaptioningManager.CaptionStyle captionStyle) {
  return new CaptionStyleCompat(
      captionStyle.foregroundColor, captionStyle.backgroundColor, Color.TRANSPARENT,
      captionStyle.edgeType, captionStyle.edgeColor, captionStyle.getTypeface());
}
 
Example 4
Source File: CaptionStyleCompat.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a {@link CaptionStyleCompat} equivalent to a provided {@link CaptionStyle}.
 *
 * @param captionStyle A {@link CaptionStyle}.
 * @return The equivalent {@link CaptionStyleCompat}.
 */
@TargetApi(19)
public static CaptionStyleCompat createFromCaptionStyle(
    CaptioningManager.CaptionStyle captionStyle) {
  if (Util.SDK_INT >= 21) {
    return createFromCaptionStyleV21(captionStyle);
  } else {
    // Note - Any caller must be on at least API level 19 or greater (because CaptionStyle did
    // not exist in earlier API levels).
    return createFromCaptionStyleV19(captionStyle);
  }
}
 
Example 5
Source File: CaptionStyleCompat.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
@TargetApi(21)
@SuppressWarnings("ResourceType")
private static CaptionStyleCompat createFromCaptionStyleV21(
    CaptioningManager.CaptionStyle captionStyle) {
  return new CaptionStyleCompat(
      captionStyle.hasForegroundColor() ? captionStyle.foregroundColor : DEFAULT.foregroundColor,
      captionStyle.hasBackgroundColor() ? captionStyle.backgroundColor : DEFAULT.backgroundColor,
      captionStyle.hasWindowColor() ? captionStyle.windowColor : DEFAULT.windowColor,
      captionStyle.hasEdgeType() ? captionStyle.edgeType : DEFAULT.edgeType,
      captionStyle.hasEdgeColor() ? captionStyle.edgeColor : DEFAULT.edgeColor,
      captionStyle.getTypeface());
}
 
Example 6
Source File: CaptionStyleCompat.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
@TargetApi(19)
@SuppressWarnings("ResourceType")
private static CaptionStyleCompat createFromCaptionStyleV19(
    CaptioningManager.CaptionStyle captionStyle) {
  return new CaptionStyleCompat(
      captionStyle.foregroundColor, captionStyle.backgroundColor, Color.TRANSPARENT,
      captionStyle.edgeType, captionStyle.edgeColor, captionStyle.getTypeface());
}
 
Example 7
Source File: CaptionStyleCompat.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a {@link CaptionStyleCompat} equivalent to a provided {@link CaptionStyle}.
 *
 * @param captionStyle A {@link CaptionStyle}.
 * @return The equivalent {@link CaptionStyleCompat}.
 */
@TargetApi(19)
public static CaptionStyleCompat createFromCaptionStyle(
    CaptioningManager.CaptionStyle captionStyle) {
  if (Util.SDK_INT >= 21) {
    return createFromCaptionStyleV21(captionStyle);
  } else {
    // Note - Any caller must be on at least API level 19 or greater (because CaptionStyle did
    // not exist in earlier API levels).
    return createFromCaptionStyleV19(captionStyle);
  }
}
 
Example 8
Source File: CaptionStyleCompat.java    From Exoplayer_VLC with Apache License 2.0 5 votes vote down vote up
@TargetApi(21)
private static CaptionStyleCompat createFromCaptionStyleV21(
    CaptioningManager.CaptionStyle captionStyle) {
  return null;
          /*CaptionStyleCompat(
      captionStyle.hasForegroundColor() ? captionStyle.foregroundColor : DEFAULT.foregroundColor,
      captionStyle.hasBackgroundColor() ? captionStyle.backgroundColor : DEFAULT.backgroundColor,
      captionStyle.hasWindowColor() ? captionStyle.windowColor : DEFAULT.windowColor,
      captionStyle.hasEdgeType() ? captionStyle.edgeType : DEFAULT.edgeType,
      captionStyle.hasEdgeColor() ? captionStyle.edgeColor : DEFAULT.edgeColor,
      captionStyle.getTypeface());*/
}
 
Example 9
Source File: CaptionStyleCompat.java    From Exoplayer_VLC with Apache License 2.0 5 votes vote down vote up
@TargetApi(19)
private static CaptionStyleCompat createFromCaptionStyleV19(
    CaptioningManager.CaptionStyle captionStyle) {
  return new CaptionStyleCompat(
      captionStyle.foregroundColor, captionStyle.backgroundColor, Color.TRANSPARENT,
      captionStyle.edgeType, captionStyle.edgeColor, captionStyle.getTypeface());
}
 
Example 10
Source File: CaptionStyleCompat.java    From Exoplayer_VLC with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a {@link CaptionStyleCompat} equivalent to a provided {@link CaptionStyle}.
 *
 * @param captionStyle A {@link CaptionStyle}.
 * @return The equivalent {@link CaptionStyleCompat}.
 */
@TargetApi(19)
public static CaptionStyleCompat createFromCaptionStyle(
    CaptioningManager.CaptionStyle captionStyle) {
  if (Util.SDK_INT >= 21) {
    return createFromCaptionStyleV21(captionStyle);
  } else {
    // Note - Any caller must be on at least API level 19 or greater (because CaptionStyle did
    // not exist in earlier API levels).
    return createFromCaptionStyleV19(captionStyle);
  }
}
 
Example 11
Source File: CaptionStyleCompat.java    From K-Sonic with MIT License 5 votes vote down vote up
@TargetApi(21)
@SuppressWarnings("ResourceType")
private static CaptionStyleCompat createFromCaptionStyleV21(
    CaptioningManager.CaptionStyle captionStyle) {
  return new CaptionStyleCompat(
      captionStyle.hasForegroundColor() ? captionStyle.foregroundColor : DEFAULT.foregroundColor,
      captionStyle.hasBackgroundColor() ? captionStyle.backgroundColor : DEFAULT.backgroundColor,
      captionStyle.hasWindowColor() ? captionStyle.windowColor : DEFAULT.windowColor,
      captionStyle.hasEdgeType() ? captionStyle.edgeType : DEFAULT.edgeType,
      captionStyle.hasEdgeColor() ? captionStyle.edgeColor : DEFAULT.edgeColor,
      captionStyle.getTypeface());
}
 
Example 12
Source File: CaptionStyleCompat.java    From K-Sonic with MIT License 5 votes vote down vote up
@TargetApi(19)
@SuppressWarnings("ResourceType")
private static CaptionStyleCompat createFromCaptionStyleV19(
    CaptioningManager.CaptionStyle captionStyle) {
  return new CaptionStyleCompat(
      captionStyle.foregroundColor, captionStyle.backgroundColor, Color.TRANSPARENT,
      captionStyle.edgeType, captionStyle.edgeColor, captionStyle.getTypeface());
}
 
Example 13
Source File: CaptionStyleCompat.java    From K-Sonic with MIT License 5 votes vote down vote up
/**
 * Creates a {@link CaptionStyleCompat} equivalent to a provided {@link CaptionStyle}.
 *
 * @param captionStyle A {@link CaptionStyle}.
 * @return The equivalent {@link CaptionStyleCompat}.
 */
@TargetApi(19)
public static CaptionStyleCompat createFromCaptionStyle(
    CaptioningManager.CaptionStyle captionStyle) {
  if (Util.SDK_INT >= 21) {
    return createFromCaptionStyleV21(captionStyle);
  } else {
    // Note - Any caller must be on at least API level 19 or greater (because CaptionStyle did
    // not exist in earlier API levels).
    return createFromCaptionStyleV19(captionStyle);
  }
}
 
Example 14
Source File: CaptionStyleCompat.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@TargetApi(21)
@SuppressWarnings("ResourceType")
private static CaptionStyleCompat createFromCaptionStyleV21(
    CaptioningManager.CaptionStyle captionStyle) {
  return new CaptionStyleCompat(
      captionStyle.hasForegroundColor() ? captionStyle.foregroundColor : DEFAULT.foregroundColor,
      captionStyle.hasBackgroundColor() ? captionStyle.backgroundColor : DEFAULT.backgroundColor,
      captionStyle.hasWindowColor() ? captionStyle.windowColor : DEFAULT.windowColor,
      captionStyle.hasEdgeType() ? captionStyle.edgeType : DEFAULT.edgeType,
      captionStyle.hasEdgeColor() ? captionStyle.edgeColor : DEFAULT.edgeColor,
      captionStyle.getTypeface());
}
 
Example 15
Source File: CaptionStyleCompat.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@TargetApi(19)
@SuppressWarnings("ResourceType")
private static CaptionStyleCompat createFromCaptionStyleV19(
    CaptioningManager.CaptionStyle captionStyle) {
  return new CaptionStyleCompat(
      captionStyle.foregroundColor, captionStyle.backgroundColor, Color.TRANSPARENT,
      captionStyle.edgeType, captionStyle.edgeColor, captionStyle.getTypeface());
}
 
Example 16
Source File: CaptionStyleCompat.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a {@link CaptionStyleCompat} equivalent to a provided {@link CaptionStyle}.
 *
 * @param captionStyle A {@link CaptionStyle}.
 * @return The equivalent {@link CaptionStyleCompat}.
 */
@TargetApi(19)
public static CaptionStyleCompat createFromCaptionStyle(
    CaptioningManager.CaptionStyle captionStyle) {
  if (Util.SDK_INT >= 21) {
    return createFromCaptionStyleV21(captionStyle);
  } else {
    // Note - Any caller must be on at least API level 19 or greater (because CaptionStyle did
    // not exist in earlier API levels).
    return createFromCaptionStyleV19(captionStyle);
  }
}
 
Example 17
Source File: CaptionStyleCompat.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@TargetApi(21)
@SuppressWarnings("ResourceType")
private static CaptionStyleCompat createFromCaptionStyleV21(
    CaptioningManager.CaptionStyle captionStyle) {
  return new CaptionStyleCompat(
      captionStyle.hasForegroundColor() ? captionStyle.foregroundColor : DEFAULT.foregroundColor,
      captionStyle.hasBackgroundColor() ? captionStyle.backgroundColor : DEFAULT.backgroundColor,
      captionStyle.hasWindowColor() ? captionStyle.windowColor : DEFAULT.windowColor,
      captionStyle.hasEdgeType() ? captionStyle.edgeType : DEFAULT.edgeType,
      captionStyle.hasEdgeColor() ? captionStyle.edgeColor : DEFAULT.edgeColor,
      captionStyle.getTypeface());
}
 
Example 18
Source File: CaptionStyleCompat.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a {@link CaptionStyleCompat} equivalent to a provided {@link CaptionStyle}.
 *
 * @param captionStyle A {@link CaptionStyle}.
 * @return The equivalent {@link CaptionStyleCompat}.
 */
@TargetApi(19)
public static CaptionStyleCompat createFromCaptionStyle(
    CaptioningManager.CaptionStyle captionStyle) {
  if (Util.SDK_INT >= 21) {
    return createFromCaptionStyleV21(captionStyle);
  } else {
    // Note - Any caller must be on at least API level 19 or greater (because CaptionStyle did
    // not exist in earlier API levels).
    return createFromCaptionStyleV19(captionStyle);
  }
}
 
Example 19
Source File: KitKatCaptioningBridge.java    From 365browser with Apache License 2.0 4 votes vote down vote up
@Override
public void onUserStyleChanged(CaptioningManager.CaptionStyle userStyle) {
    final CaptioningStyle captioningStyle = getCaptioningStyleFrom(userStyle);
    mCaptioningChangeDelegate.onUserStyleChanged(captioningStyle);
}
 
Example 20
Source File: KitKatCaptioningBridge.java    From 365browser with Apache License 2.0 2 votes vote down vote up
/**
 * Create a Chromium CaptioningStyle from a platform CaptionStyle
 *
 * @param userStyle the platform CaptionStyle
 * @return a Chromium CaptioningStyle
 */
private CaptioningStyle getCaptioningStyleFrom(CaptioningManager.CaptionStyle userStyle) {
    return CaptioningStyle.createFrom(userStyle);
}