Fix preview image alignment issue due to clip padding.

CaptionPropertiesFragment is using a non-standard way to display preview
images. Changed to use LayoutPreference.

Bug: 132797057
Test: visual
Change-Id: I92bfd38e2880226d7385e98ed871dad4e1f30e42
This commit is contained in:
Fan Zhang
2019-05-15 13:13:10 -07:00
parent b4b7725937
commit db3fca16f7
4 changed files with 48 additions and 76 deletions

View File

@@ -15,41 +15,32 @@
limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/preview_viewport"
android:clipToPadding="true"
android:clipChildren="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
android:layout_height="wrap_content">
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/captioning_preview_height"
android:contentDescription="@null"
android:scaleType="centerCrop"
android:src="@drawable/caption_background"/>
<FrameLayout
android:id="@+id/preview_viewport"
android:id="@+id/preview_window"
android:layout_width="match_parent"
android:layout_height="@dimen/captioning_preview_height" >
android:layout_height="wrap_content"
android:layout_gravity="bottom|start"
android:padding="16dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@null"
android:scaleType="centerCrop"
android:src="@drawable/caption_background" />
<FrameLayout
android:id="@+id/preview_window"
android:layout_width="match_parent"
<com.android.internal.widget.SubtitleView
android:id="@+id/preview_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|start"
android:padding="16dp" >
<com.android.internal.widget.SubtitleView
android:id="@+id/preview_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/captioning_preview_text" />
</FrameLayout>
android:text="@string/captioning_preview_text"/>
</FrameLayout>
<FrameLayout
android:id="@+id/properties_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</FrameLayout>

View File

@@ -16,7 +16,9 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:clipChildren="true"
android:clipToPadding="true">
<ImageView
android:id="@+id/video_background"