Java 类android.view.accessibility.CaptioningManager 实例源码

项目:androidtv-sample    文件:RichTvInputService.java   
@Override
public void onCreate() {
    super.onCreate();
    mHandlerThread = new HandlerThread(getClass().getSimpleName());
    mHandlerThread.start();
    mDbHandler = new Handler(mHandlerThread.getLooper());
    mCaptioningManager = (CaptioningManager) getSystemService(Context.CAPTIONING_SERVICE);

    setTheme(android.R.style.Theme_Holo_Light_NoActionBar);

    mSessions = new ArrayList<>();
    IntentFilter intentFilter = new IntentFilter();
    intentFilter.addAction(TvInputManager.ACTION_BLOCKED_RATINGS_CHANGED);
    intentFilter.addAction(TvInputManager.ACTION_PARENTAL_CONTROLS_ENABLED_CHANGED);
    registerReceiver(mParentalControlsBroadcastReceiver, intentFilter);
}
项目:android_packages_apps_tv    文件:CaptionWindowLayout.java   
public CaptionWindowLayout(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);

    // Add a subtitle view to the layout.
    mSubtitleView = new SubtitleView(context);
    LayoutParams params = new RelativeLayout.LayoutParams(
            ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    addView(mSubtitleView, params);

    // Set the system wide cc preferences to the subtitle view.
    CaptioningManager captioningManager =
            (CaptioningManager) context.getSystemService(Context.CAPTIONING_SERVICE);
    mFontScale = captioningManager.getFontScale();
    mCaptionStyleCompat =
            CaptionStyleCompat.createFromCaptionStyle(captioningManager.getUserStyle());
    mSubtitleView.setStyle(mCaptionStyleCompat);
    mSubtitleView.setText("");
    captioningManager.addCaptioningChangeListener(new SystemWideCaptioningChangeListener());
    updateWidestChar();
}
项目:airgram    文件:CaptionStyleCompat.java   
/**
 * 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);
  }
}
项目:airgram    文件:CaptionStyleCompat.java   
@TargetApi(19)
private static CaptionStyleCompat createFromCaptionStyleV19(
    CaptioningManager.CaptionStyle captionStyle) {
  return new CaptionStyleCompat(
      captionStyle.foregroundColor, captionStyle.backgroundColor, Color.TRANSPARENT,
      captionStyle.edgeType, captionStyle.edgeColor, captionStyle.getTypeface());
}
项目:airgram    文件:CaptionStyleCompat.java   
@TargetApi(21)
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());
}
项目:Pocket-Plays-for-Twitch    文件:VideoCastManager.java   
@SuppressLint("NewApi")
private void registerCaptionListener(final Context context) {
    if (Utils.IS_KITKAT_OR_ABOVE) {
        CaptioningManager captioningManager =
                (CaptioningManager) context.getSystemService(Context.CAPTIONING_SERVICE);
        captioningManager.addCaptioningChangeListener(
                new CaptioningManager.CaptioningChangeListener() {
                    @Override
                    public void onEnabledChanged(boolean enabled) {
                        onTextTrackEnabledChanged(enabled);
                    }

                    @Override
                    public void onUserStyleChanged(
                            @NonNull CaptioningManager.CaptionStyle userStyle) {
                        onTextTrackStyleChanged(mTrackManager.getTextTrackStyle());
                    }

                    @Override
                    public void onFontScaleChanged(float fontScale) {
                        onTextTrackStyleChanged(mTrackManager.getTextTrackStyle());
                    }

                    @Override
                    public void onLocaleChanged(Locale locale) {
                        onTextTrackLocaleChanged(locale);
                    }
                }
        );
    }
}
项目:Pocket-Plays-for-Twitch    文件:TracksPreferenceManager.java   
@SuppressLint("NewApi")
public boolean isCaptionEnabled() {
    if (Utils.IS_KITKAT_OR_ABOVE) {
        CaptioningManager captioningManager =
                (CaptioningManager) mContext.getSystemService(Context.CAPTIONING_SERVICE);
        return captioningManager.isEnabled();
    } else {
        return mPreferenceAccessor.getBooleanFromPreference(
                mContext.getString(R.string.ccl_key_caption_enabled), false);
    }
}
项目:Exoplayer2Radio    文件:CaptionStyleCompat.java   
/**
 * 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);
  }
}
项目:Exoplayer2Radio    文件:CaptionStyleCompat.java   
@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());
}
项目:Exoplayer2Radio    文件:CaptionStyleCompat.java   
@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());
}
项目:android_packages_apps_tv    文件:TunerSessionWorker.java   
public TunerSessionWorker(Context context, ChannelDataManager channelDataManager,
            BufferManager bufferManager, TunerSession tunerSession) {
    if (DEBUG) Log.d(TAG, "TunerSessionWorker created");
    mContext = context;

    // HandlerThread should be set up before it is registered as a listener in the all other
    // components.
    HandlerThread handlerThread = new HandlerThread(TAG);
    handlerThread.start();
    mHandler = new Handler(handlerThread.getLooper(), this);
    mSession = tunerSession;
    mChannelDataManager = channelDataManager;
    mChannelDataManager.setListener(this);
    mChannelDataManager.checkDataVersion(mContext);
    mSourceManager = TsDataSourceManager.createSourceManager(false);
    mTvInputManager = (TvInputManager) context.getSystemService(Context.TV_INPUT_SERVICE);
    mTvTracks = new ArrayList<>();
    mAudioTrackMap = new SparseArray<>();
    mCaptionTrackMap = new SparseArray<>();
    CaptioningManager captioningManager =
            (CaptioningManager) context.getSystemService(Context.CAPTIONING_SERVICE);
    mCaptionEnabled = captioningManager.isEnabled();
    mPlaybackParams.setSpeed(1.0f);
    mBufferManager = bufferManager;
    mPreparingStartTimeMs = INVALID_TIME;
    mBufferingStartTimeMs = INVALID_TIME;
    mReadyStartTimeMs = INVALID_TIME;
}
项目:miku    文件:CaptionStyleCompat.java   
/**
 * 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);
  }
}
项目:miku    文件:CaptionStyleCompat.java   
@TargetApi(19)
private static CaptionStyleCompat createFromCaptionStyleV19(
    CaptioningManager.CaptionStyle captionStyle) {
  return new CaptionStyleCompat(
      captionStyle.foregroundColor, captionStyle.backgroundColor, Color.TRANSPARENT,
      captionStyle.edgeType, captionStyle.edgeColor, captionStyle.getTypeface());
}
项目:miku    文件:CaptionStyleCompat.java   
@TargetApi(21)
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());
}
项目:K-Sonic    文件:CaptionStyleCompat.java   
/**
 * 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);
  }
}
项目:K-Sonic    文件:CaptionStyleCompat.java   
@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());
}
项目:K-Sonic    文件:CaptionStyleCompat.java   
@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());
}
项目:ExoPlayer-Demo    文件:CaptionStyleCompat.java   
/**
 * 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);
  }
}
项目:ExoPlayer-Demo    文件:CaptionStyleCompat.java   
@TargetApi(19)
private static CaptionStyleCompat createFromCaptionStyleV19(
    CaptioningManager.CaptionStyle captionStyle) {
  return new CaptionStyleCompat(
      captionStyle.foregroundColor, captionStyle.backgroundColor, Color.TRANSPARENT,
      captionStyle.edgeType, captionStyle.edgeColor, captionStyle.getTypeface());
}
项目:ExoPlayer-Demo    文件:CaptionStyleCompat.java   
@TargetApi(21)
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());
}
项目:videoPickPlayer    文件:CaptionStyleCompat.java   
/**
 * 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);
  }
}
项目:videoPickPlayer    文件:CaptionStyleCompat.java   
@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());
}
项目:videoPickPlayer    文件:CaptionStyleCompat.java   
@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());
}
项目:codelab-chromecast    文件:VideoCastManager.java   
@SuppressLint("NewApi")
private void registerCaptionListener(final Context context) {
    if (Utils.IS_KITKAT_OR_ABOVE) {
        CaptioningManager captioningManager =
                (CaptioningManager) context.getSystemService(Context.CAPTIONING_SERVICE);
        captioningManager.addCaptioningChangeListener(
                new CaptioningManager.CaptioningChangeListener() {
                    @Override
                    public void onEnabledChanged(boolean enabled) {
                        onTextTrackEnabledChanged(enabled);
                    }

                    @Override
                    public void onUserStyleChanged(
                            CaptioningManager.CaptionStyle userStyle) {
                        onTextTrackStyleChanged(mTrackManager.getTextTrackStyle());
                    }

                    @Override
                    public void onFontScaleChanged(float fontScale) {
                        onTextTrackStyleChanged(mTrackManager.getTextTrackStyle());
                    }

                    @Override
                    public void onLocaleChanged(Locale locale) {
                        onTextTrackLocaleChanged(locale);
                    }
                }
        );
    }
}
项目:codelab-chromecast    文件:TracksPreferenceManager.java   
@SuppressLint("NewApi")
public boolean isCaptionEnabled() {
    if (Utils.IS_KITKAT_OR_ABOVE) {
        CaptioningManager captioningManager =
                (CaptioningManager) mContext.getSystemService(Context.CAPTIONING_SERVICE);
        return captioningManager.isEnabled();
    } else {
        return Utils.getBooleanFromPreference(mContext,
                mContext.getString(R.string.ccl_key_caption_enabled), false);
    }
}
项目:android-exoplayer    文件:CaptionStyleCompat.java   
/**
 * 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);
  }
}
项目:android-exoplayer    文件:CaptionStyleCompat.java   
@TargetApi(19)
private static CaptionStyleCompat createFromCaptionStyleV19(
    CaptioningManager.CaptionStyle captionStyle) {
  return new CaptionStyleCompat(
      captionStyle.foregroundColor, captionStyle.backgroundColor, Color.TRANSPARENT,
      captionStyle.edgeType, captionStyle.edgeColor, captionStyle.getTypeface());
}
项目:android-exoplayer    文件:CaptionStyleCompat.java   
@TargetApi(21)
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());
}
项目:iWediaSimpleTvInputService    文件:TvSession.java   
/**
 * Constructor
 *
 * @param sessionListener Listener through which reporting when session onRelease() is called.
 */
public TvSession(Context context, ITvSession sessionListener, String inputID) {
    super(context);
    mLog.d("[TvSession][Started!]");
    mTvManager = (TvInputManager) context.getSystemService(Context.TV_INPUT_SERVICE);
    mInputID = inputID;
    mSessionListener = sessionListener;
    mContext = context;
    mIsSubtitleEnabled = ((CaptioningManager) mContext
            .getSystemService(Context.CAPTIONING_SERVICE)).isEnabled();
    mDtvManager = DtvManager.getInstance();
    mChannelManager = mDtvManager.getChannelManager();
    mSubtitleManager = mDtvManager.getSubtitleManager();
    mAudioManager = mDtvManager.getAudioManager();
}
项目:365browser    文件:KitKatCaptioningBridge.java   
/**
 * Construct a new KitKat+ captioning bridge
 *
 * @param context the Context to associate with this bridge.
 */
private KitKatCaptioningBridge(Context context) {
    mCaptioningChangeDelegate = new CaptioningChangeDelegate();
    mCaptioningManager =
            (CaptioningManager) context.getApplicationContext().getSystemService(
                    Context.CAPTIONING_SERVICE);
}
项目:transistor    文件:CaptionStyleCompat.java   
/**
 * 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);
  }
}
项目:transistor    文件:CaptionStyleCompat.java   
@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());
}
项目:transistor    文件:CaptionStyleCompat.java   
@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());
}
项目:Exoplayer_VLC    文件:CaptionStyleCompat.java   
/**
 * 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);
  }
}
项目:Exoplayer_VLC    文件:CaptionStyleCompat.java   
@TargetApi(19)
private static CaptionStyleCompat createFromCaptionStyleV19(
    CaptioningManager.CaptionStyle captionStyle) {
  return new CaptionStyleCompat(
      captionStyle.foregroundColor, captionStyle.backgroundColor, Color.TRANSPARENT,
      captionStyle.edgeType, captionStyle.edgeColor, captionStyle.getTypeface());
}
项目:Exoplayer_VLC    文件:CaptionStyleCompat.java   
@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());*/
}
项目:ExoPlayer    文件:CaptionStyleCompat.java   
/**
 * 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);
  }
}
项目:ExoPlayer    文件:CaptionStyleCompat.java   
@TargetApi(19)
private static CaptionStyleCompat createFromCaptionStyleV19(
    CaptioningManager.CaptionStyle captionStyle) {
  return new CaptionStyleCompat(
      captionStyle.foregroundColor, captionStyle.backgroundColor, Color.TRANSPARENT,
      captionStyle.edgeType, captionStyle.edgeColor, captionStyle.getTypeface());
}
项目:ExoPlayer    文件:CaptionStyleCompat.java   
@TargetApi(21)
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());
}
项目:Telegram    文件:CaptionStyleCompat.java   
/**
 * 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);
  }
}