diff options
author | Alan Viverette <alanv@google.com> | 2013-12-12 01:20:32 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-12-12 01:20:32 +0000 |
commit | 920540799823689fe9d85464cfd8a76c843aefa6 (patch) | |
tree | b163090032492732957e4acf3ad627fb09412fc6 /core/java | |
parent | 84c3d2a7de0a8055bdfdccbd93cfd216b8ab6bcd (diff) | |
parent | 55d70620d9fda8afafb2fdec59757a710eec0e89 (diff) | |
download | frameworks_base-920540799823689fe9d85464cfd8a76c843aefa6.zip frameworks_base-920540799823689fe9d85464cfd8a76c843aefa6.tar.gz frameworks_base-920540799823689fe9d85464cfd8a76c843aefa6.tar.bz2 |
Merge "Add caption window color attribute"
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/provider/Settings.java | 10 | ||||
-rw-r--r-- | core/java/android/view/accessibility/CaptioningManager.java | 28 |
2 files changed, 27 insertions, 11 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 0dffc17..ec3819a 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -3741,6 +3741,16 @@ public final class Settings { "accessibility_captioning_edge_color"; /** + * Integer property that specifes the window color for captions as a + * packed 32-bit color. + * + * @see android.graphics.Color#argb + * @hide + */ + public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR = + "accessibility_captioning_window_color"; + + /** * String property that specifies the typeface for captions, one of: * <ul> * <li>DEFAULT diff --git a/core/java/android/view/accessibility/CaptioningManager.java b/core/java/android/view/accessibility/CaptioningManager.java index 557239f..02929ed 100644 --- a/core/java/android/view/accessibility/CaptioningManager.java +++ b/core/java/android/view/accessibility/CaptioningManager.java @@ -293,6 +293,9 @@ public class CaptioningManager { */ public final int edgeColor; + /** The preferred window color for video captions. */ + public final int windowColor; + /** * @hide */ @@ -301,11 +304,12 @@ public class CaptioningManager { private Typeface mParsedTypeface; private CaptionStyle(int foregroundColor, int backgroundColor, int edgeType, int edgeColor, - String rawTypeface) { + int windowColor, String rawTypeface) { this.foregroundColor = foregroundColor; this.backgroundColor = backgroundColor; this.edgeType = edgeType; this.edgeColor = edgeColor; + this.windowColor = windowColor; mRawTypeface = rawTypeface; } @@ -334,25 +338,27 @@ public class CaptioningManager { cr, Secure.ACCESSIBILITY_CAPTIONING_EDGE_TYPE, defStyle.edgeType); final int edgeColor = Secure.getInt( cr, Secure.ACCESSIBILITY_CAPTIONING_EDGE_COLOR, defStyle.edgeColor); + final int windowColor = Secure.getInt( + cr, Secure.ACCESSIBILITY_CAPTIONING_WINDOW_COLOR, defStyle.windowColor); String rawTypeface = Secure.getString(cr, Secure.ACCESSIBILITY_CAPTIONING_TYPEFACE); if (rawTypeface == null) { rawTypeface = defStyle.mRawTypeface; } - return new CaptionStyle( - foregroundColor, backgroundColor, edgeType, edgeColor, rawTypeface); + return new CaptionStyle(foregroundColor, backgroundColor, edgeType, edgeColor, + windowColor, rawTypeface); } static { - WHITE_ON_BLACK = new CaptionStyle( - Color.WHITE, Color.BLACK, EDGE_TYPE_NONE, Color.BLACK, null); - BLACK_ON_WHITE = new CaptionStyle( - Color.BLACK, Color.WHITE, EDGE_TYPE_NONE, Color.BLACK, null); - YELLOW_ON_BLACK = new CaptionStyle( - Color.YELLOW, Color.BLACK, EDGE_TYPE_NONE, Color.BLACK, null); - YELLOW_ON_BLUE = new CaptionStyle( - Color.YELLOW, Color.BLUE, EDGE_TYPE_NONE, Color.BLACK, null); + WHITE_ON_BLACK = new CaptionStyle(Color.WHITE, Color.BLACK, EDGE_TYPE_NONE, + Color.BLACK, Color.TRANSPARENT, null); + BLACK_ON_WHITE = new CaptionStyle(Color.BLACK, Color.WHITE, EDGE_TYPE_NONE, + Color.BLACK, Color.TRANSPARENT, null); + YELLOW_ON_BLACK = new CaptionStyle(Color.YELLOW, Color.BLACK, EDGE_TYPE_NONE, + Color.BLACK, Color.TRANSPARENT, null); + YELLOW_ON_BLUE = new CaptionStyle(Color.YELLOW, Color.BLUE, EDGE_TYPE_NONE, + Color.BLACK, Color.TRANSPARENT, null); PRESETS = new CaptionStyle[] { WHITE_ON_BLACK, BLACK_ON_WHITE, YELLOW_ON_BLACK, YELLOW_ON_BLUE |