Search in sources :

Example 1 with CaptionStyle

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));
    }
}
Also used : CaptionStyle(android.view.accessibility.CaptioningManager.CaptionStyle)

Example 2 with 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));
    }
}
Also used : CaptionStyle(android.view.accessibility.CaptioningManager.CaptionStyle)

Example 3 with 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();
}
Also used : Context(android.content.Context) Typeface(android.graphics.Typeface) CaptionStyle(android.view.accessibility.CaptioningManager.CaptionStyle) ContentResolver(android.content.ContentResolver)

Example 4 with CaptionStyle

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);
}
Also used : CaptionStyle(android.view.accessibility.CaptioningManager.CaptionStyle) ContentResolver(android.content.ContentResolver)

Example 5 with CaptionStyle

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();
}
Also used : Context(android.content.Context) Typeface(android.graphics.Typeface) CaptionStyle(android.view.accessibility.CaptioningManager.CaptionStyle) ContentResolver(android.content.ContentResolver)

Aggregations

CaptionStyle (android.view.accessibility.CaptioningManager.CaptionStyle)22 Context (android.content.Context)11 ContentResolver (android.content.ContentResolver)6 Typeface (android.graphics.Typeface)5 SubtitleView (com.android.internal.widget.SubtitleView)1 Locale (java.util.Locale)1