android.view.accessibility.CaptioningManager.CaptionStyle#getTypeface ( )源码实例Demo

下面列出了android.view.accessibility.CaptioningManager.CaptionStyle#getTypeface ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: MediaSDK   文件: CaptionStyleCompat.java
@TargetApi(19)
@SuppressWarnings("ResourceType")
private static CaptionStyleCompat createFromCaptionStyleV19(
    CaptionStyle captionStyle) {
  return new CaptionStyleCompat(
      captionStyle.foregroundColor, captionStyle.backgroundColor, Color.TRANSPARENT,
      captionStyle.edgeType, captionStyle.edgeColor, captionStyle.getTypeface());
}
 
源代码2 项目: MediaSDK   文件: CaptionStyleCompat.java
@TargetApi(21)
@SuppressWarnings("ResourceType")
private static CaptionStyleCompat createFromCaptionStyleV21(
    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());
}
 
源代码3 项目: 365browser   文件: CaptioningStyle.java
/**
 * Converts from a platform CaptionStyle to a Chromium CaptioningStyle. In the case that null
 * is passed in, a CaptioningStyle that includes no settings is returned.
 * This is safe to call on KitKat.
 *
 * KitKat CaptionStyle supported neither windowColor nor a few enum values of edgeType.
 *
 * @param captionStyle an Android platform CaptionStyle object
 * @return a Chromium CaptioningStyle object
 */
@SuppressLint("NewApi")
public static CaptioningStyle createFrom(CaptionStyle captionStyle) {
    if (captionStyle == null) {
        return new CaptioningStyle(null, null, null, null, null, null);
    }

    Integer backgroundColor = null;
    Integer edgeColor = null;
    Integer edgeType = null;
    Integer foregroundColor = null;
    Integer windowColor = null;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        if (captionStyle.hasBackgroundColor()) {
            backgroundColor = Integer.valueOf(captionStyle.backgroundColor);
        }
        if (captionStyle.hasEdgeColor()) {
            edgeColor = Integer.valueOf(captionStyle.edgeColor);
        }
        if (captionStyle.hasEdgeType()) {
            edgeType = Integer.valueOf(captionStyle.edgeType);
        }
        if (captionStyle.hasForegroundColor()) {
            foregroundColor = Integer.valueOf(captionStyle.foregroundColor);
        }
        if (captionStyle.hasWindowColor()) {
            windowColor = Integer.valueOf(captionStyle.windowColor);
        }
    } else {
        backgroundColor = Integer.valueOf(captionStyle.backgroundColor);
        edgeColor = Integer.valueOf(captionStyle.edgeColor);
        edgeType = Integer.valueOf(captionStyle.edgeType);
        foregroundColor = Integer.valueOf(captionStyle.foregroundColor);
    }

    return new CaptioningStyle(backgroundColor, edgeColor, edgeType, foregroundColor,
            windowColor, captionStyle.getTypeface());
}