use of android.view.accessibility.CaptioningManager.CaptionStyle in project platform_frameworks_base by android.
the class Cea608CCWidget method updateDisplay.
private void updateDisplay() {
if (mListener != null) {
CaptionStyle captionStyle = mListener.getCaptionStyle();
mListener.onDisplayChanged(mDisplay.getStyledText(captionStyle));
}
}
use of android.view.accessibility.CaptioningManager.CaptionStyle in project android_frameworks_base by ResurrectionRemix.
the class Cea608CCWidget method updateDisplay.
private void updateDisplay() {
if (mListener != null) {
CaptionStyle captionStyle = mListener.getCaptionStyle();
mListener.onDisplayChanged(mDisplay.getStyledText(captionStyle));
}
}
use of android.view.accessibility.CaptioningManager.CaptionStyle in project android_frameworks_base by ResurrectionRemix.
the class SubtitleView method setStyle.
public void setStyle(int styleId) {
final Context context = mContext;
final ContentResolver cr = context.getContentResolver();
final CaptionStyle style;
if (styleId == CaptionStyle.PRESET_CUSTOM) {
style = CaptionStyle.getCustomStyle(cr);
} else {
style = CaptionStyle.PRESETS[styleId];
}
final CaptionStyle defStyle = CaptionStyle.DEFAULT;
mForegroundColor = style.hasForegroundColor() ? style.foregroundColor : defStyle.foregroundColor;
mBackgroundColor = style.hasBackgroundColor() ? style.backgroundColor : defStyle.backgroundColor;
mEdgeType = style.hasEdgeType() ? style.edgeType : defStyle.edgeType;
mEdgeColor = style.hasEdgeColor() ? style.edgeColor : defStyle.edgeColor;
mHasMeasurements = false;
final Typeface typeface = style.getTypeface();
setTypeface(typeface);
requestLayout();
}
use of android.view.accessibility.CaptioningManager.CaptionStyle in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class CaptionPropertiesFragment method updateAllPreferences.
private void updateAllPreferences() {
final int preset = mCaptioningManager.getRawUserStyle();
mPreset.setValue(preset);
final float fontSize = mCaptioningManager.getFontScale();
mFontSize.setValue(Float.toString(fontSize));
final ContentResolver cr = getContentResolver();
final CaptionStyle attrs = CaptionStyle.getCustomStyle(cr);
mEdgeType.setValue(attrs.edgeType);
mEdgeColor.setValue(attrs.edgeColor);
final int foregroundColor = attrs.hasForegroundColor() ? attrs.foregroundColor : CaptionStyle.COLOR_UNSPECIFIED;
parseColorOpacity(mForegroundColor, mForegroundOpacity, foregroundColor);
final int backgroundColor = attrs.hasBackgroundColor() ? attrs.backgroundColor : CaptionStyle.COLOR_UNSPECIFIED;
parseColorOpacity(mBackgroundColor, mBackgroundOpacity, backgroundColor);
final int windowColor = attrs.hasWindowColor() ? attrs.windowColor : CaptionStyle.COLOR_UNSPECIFIED;
parseColorOpacity(mWindowColor, mWindowOpacity, windowColor);
final String rawTypeface = attrs.mRawTypeface;
mTypeface.setValue(rawTypeface == null ? "" : rawTypeface);
final String rawLocale = mCaptioningManager.getRawLocale();
mLocale.setValue(rawLocale == null ? "" : rawLocale);
}
use of android.view.accessibility.CaptioningManager.CaptionStyle in project android_frameworks_base by DirtyUnicorns.
the class SubtitleView method setStyle.
public void setStyle(int styleId) {
final Context context = mContext;
final ContentResolver cr = context.getContentResolver();
final CaptionStyle style;
if (styleId == CaptionStyle.PRESET_CUSTOM) {
style = CaptionStyle.getCustomStyle(cr);
} else {
style = CaptionStyle.PRESETS[styleId];
}
final CaptionStyle defStyle = CaptionStyle.DEFAULT;
mForegroundColor = style.hasForegroundColor() ? style.foregroundColor : defStyle.foregroundColor;
mBackgroundColor = style.hasBackgroundColor() ? style.backgroundColor : defStyle.backgroundColor;
mEdgeType = style.hasEdgeType() ? style.edgeType : defStyle.edgeType;
mEdgeColor = style.hasEdgeColor() ? style.edgeColor : defStyle.edgeColor;
mHasMeasurements = false;
final Typeface typeface = style.getTypeface();
setTypeface(typeface);
requestLayout();
}
Aggregations