本文整理汇总了Java中android.view.accessibility.CaptioningManager.CaptionStyle方法的典型用法代码示例。如果您正苦于以下问题:Java CaptioningManager.CaptionStyle方法的具体用法?Java CaptioningManager.CaptionStyle怎么用?Java CaptioningManager.CaptionStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.accessibility.CaptioningManager
的用法示例。
在下文中一共展示了CaptioningManager.CaptionStyle方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFromCaptionStyle
import android.view.accessibility.CaptioningManager; //导入方法依赖的package包/类
/**
* 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);
}
}
示例2: createFromCaptionStyleV19
import android.view.accessibility.CaptioningManager; //导入方法依赖的package包/类
@TargetApi(19)
private static CaptionStyleCompat createFromCaptionStyleV19(
CaptioningManager.CaptionStyle captionStyle) {
return new CaptionStyleCompat(
captionStyle.foregroundColor, captionStyle.backgroundColor, Color.TRANSPARENT,
captionStyle.edgeType, captionStyle.edgeColor, captionStyle.getTypeface());
}
示例3: createFromCaptionStyleV21
import android.view.accessibility.CaptioningManager; //导入方法依赖的package包/类
@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());
}
示例4: createFromCaptionStyleV19
import android.view.accessibility.CaptioningManager; //导入方法依赖的package包/类
@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());
}
示例5: createFromCaptionStyleV21
import android.view.accessibility.CaptioningManager; //导入方法依赖的package包/类
@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());
}
示例6: createFromCaptionStyleV21
import android.view.accessibility.CaptioningManager; //导入方法依赖的package包/类
@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());*/
}
示例7: onUserStyleChanged
import android.view.accessibility.CaptioningManager; //导入方法依赖的package包/类
@Override
public void onUserStyleChanged(CaptioningManager.CaptionStyle userStyle) {
final CaptioningStyle captioningStyle = getCaptioningStyleFrom(userStyle);
mCaptioningChangeDelegate.onUserStyleChanged(captioningStyle);
}
示例8: getCaptioningStyleFrom
import android.view.accessibility.CaptioningManager; //导入方法依赖的package包/类
/**
* 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);
}