summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/accessibility
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2014-07-22 00:10:17 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-07-21 15:42:19 +0000
commitdd9dcb43778437358847e57c05c6926e42e47c62 (patch)
treea3b94fba02cd397afac3c8160e92210cc2711a43 /src/com/android/settings/accessibility
parentc94e7e611cd4cacdcc4ae7297a476024a4ba3b5c (diff)
parent389287e5f8a1fe137de959034de39608830878d1 (diff)
downloadpackages_apps_Settings-dd9dcb43778437358847e57c05c6926e42e47c62.zip
packages_apps_Settings-dd9dcb43778437358847e57c05c6926e42e47c62.tar.gz
packages_apps_Settings-dd9dcb43778437358847e57c05c6926e42e47c62.tar.bz2
Merge "Treat caption preview viewport as clipped 16:9 aspect" into lmp-dev
Diffstat (limited to 'src/com/android/settings/accessibility')
-rw-r--r--src/com/android/settings/accessibility/CaptionPropertiesFragment.java5
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 fa664bb..9822fc3 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);