diff options
author | Alan Viverette <alanv@google.com> | 2014-07-21 16:48:13 -0700 |
---|---|---|
committer | Alan Viverette <alanv@google.com> | 2014-07-21 23:50:15 +0000 |
commit | 389287e5f8a1fe137de959034de39608830878d1 (patch) | |
tree | c5ab905508d17cdf4b31192d1503f0abc80aa86d /src/com/android/settings/accessibility | |
parent | aed4c7284ecdeb4353da0b5a90c11e2f598d733a (diff) | |
download | packages_apps_Settings-389287e5f8a1fe137de959034de39608830878d1.tar.gz packages_apps_Settings-389287e5f8a1fe137de959034de39608830878d1.tar.bz2 packages_apps_Settings-389287e5f8a1fe137de959034de39608830878d1.zip |
Treat caption preview viewport as clipped 16:9 aspect
Also adds standard start/end padding to preview frame.
BUG: 16462107
Change-Id: I89001d1656cee0c2d8abd95eae09975307b1ff06
Diffstat (limited to 'src/com/android/settings/accessibility')
-rw-r--r-- | src/com/android/settings/accessibility/CaptionPropertiesFragment.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/settings/accessibility/CaptionPropertiesFragment.java b/src/com/android/settings/accessibility/CaptionPropertiesFragment.java index fa664bbbd..9822fc39d 100644 --- a/src/com/android/settings/accessibility/CaptionPropertiesFragment.java +++ b/src/com/android/settings/accessibility/CaptionPropertiesFragment.java @@ -206,7 +206,10 @@ public class CaptionPropertiesFragment extends SettingsPreferenceFragment final ContentResolver cr = context.getContentResolver(); final float fontScale = manager.getFontScale(); if (previewWindow != null) { - previewText.setTextSize(previewWindow.getHeight() * LINE_HEIGHT_RATIO * fontScale); + // Assume the viewport is clipped with a 16:9 aspect ratio. + final float virtualHeight = Math.max(9 * previewWindow.getWidth(), + 16 * previewWindow.getHeight()) / 16.0f; + previewText.setTextSize(virtualHeight * LINE_HEIGHT_RATIO * fontScale); } else { final float textSize = context.getResources().getDimension( R.dimen.caption_preview_text_size); |