summaryrefslogtreecommitdiffstats
path: root/core/java/com
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2014-06-04 18:35:42 -0700
committerAlan Viverette <alanv@google.com>2014-06-04 18:35:42 -0700
commite88aee8ad85b01229b12dbc0c3cc2f0b8b490192 (patch)
treeea03bb3ae8e88df6b776b8dd0411a187e4a8fcb7 /core/java/com
parent648a309d9badc405bc969bcb4461369bf89fe7ef (diff)
downloadframeworks_base-e88aee8ad85b01229b12dbc0c3cc2f0b8b490192.zip
frameworks_base-e88aee8ad85b01229b12dbc0c3cc2f0b8b490192.tar.gz
frameworks_base-e88aee8ad85b01229b12dbc0c3cc2f0b8b490192.tar.bz2
Add defaults for caption colors and edge type
BUG: 8151470 Change-Id: I4d7b75bf647aeded77b4000cdcd37e9ace46a374
Diffstat (limited to 'core/java/com')
-rw-r--r--core/java/com/android/internal/widget/SubtitleView.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/core/java/com/android/internal/widget/SubtitleView.java b/core/java/com/android/internal/widget/SubtitleView.java
index 117463a..2f987e9 100644
--- a/core/java/com/android/internal/widget/SubtitleView.java
+++ b/core/java/com/android/internal/widget/SubtitleView.java
@@ -271,10 +271,13 @@ public class SubtitleView extends View {
style = CaptionStyle.PRESETS[styleId];
}
- mForegroundColor = style.foregroundColor;
- mBackgroundColor = style.backgroundColor;
- mEdgeType = style.edgeType;
- mEdgeColor = style.edgeColor;
+ 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();