Merge "Treat caption preview viewport as clipped 16:9 aspect" into lmp-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
dd9dcb4377
@@ -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"
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user