summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--res/layout/captioning_preview.xml4
-rw-r--r--src/com/android/settings/accessibility/CaptionPropertiesFragment.java5
2 files changed, 7 insertions, 2 deletions
diff --git a/res/layout/captioning_preview.xml b/res/layout/captioning_preview.xml
index b90c3a5..92824d5 100644
--- a/res/layout/captioning_preview.xml
+++ b/res/layout/captioning_preview.xml
@@ -23,7 +23,9 @@
<FrameLayout
android:id="@+id/preview_viewport"
android:layout_width="match_parent"
- android:layout_height="@dimen/captioning_preview_height" >
+ android:layout_height="@dimen/captioning_preview_height"
+ android:paddingStart="@dimen/settings_side_margin"
+ android:paddingEnd="@dimen/settings_side_margin" >
<ImageView
android:layout_width="match_parent"
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);