Commit 64d96743 authored by Shakti Sahu's avatar Shakti Sahu Committed by Commit Bot

Download Home : Video layout bug causing shift of content and menu button

Long title text on the video item causes weird shift in the image view and
also hides the three dot menu button that is located on the right. Didn't
find a way to fix this in GridLayout. Changed this to use LinearLayout
which will fix this issue.

We also need to do the same fix for in-progress video layout where the
cancel button is getting hidden by the long text.

Bug: 904979
Change-Id: I1e2974c1772d5745242d106ee8e35fde58b5c1cf
Reviewed-on: https://chromium-review.googlesource.com/c/1334828
Commit-Queue: Shakti Sahu <shaktisahu@chromium.org>
Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608533}
parent 956b9f66
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:clickable="true" android:clickable="true"
android:background="@drawable/hairline_border_card_background" android:background="@drawable/hairline_border_card_background"
app:columnCount="2" app:columnCount="1"
app:rowCount="3"> app:rowCount="2">
<!-- Set the src attribute in Java to wrap the drawable properly. --> <!-- Set the src attribute in Java to wrap the drawable properly. -->
<org.chromium.chrome.browser.download.home.list.view.ForegroundRoundedCornerImageView <org.chromium.chrome.browser.download.home.list.view.ForegroundRoundedCornerImageView
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
android:adjustViewBounds="true" android:adjustViewBounds="true"
app:layout_column="0" app:layout_column="0"
app:layout_row="0" app:layout_row="0"
app:layout_columnSpan="2"
app:layout_gravity="center" app:layout_gravity="center"
app:cornerRadiusTopStart="@dimen/download_manager_thumbnail_corner_radius" app:cornerRadiusTopStart="@dimen/download_manager_thumbnail_corner_radius"
app:cornerRadiusTopEnd="@dimen/download_manager_thumbnail_corner_radius" app:cornerRadiusTopEnd="@dimen/download_manager_thumbnail_corner_radius"
...@@ -37,43 +36,49 @@ ...@@ -37,43 +36,49 @@
android:id="@+id/action_button" android:id="@+id/action_button"
app:layout_column="0" app:layout_column="0"
app:layout_row="0" app:layout_row="0"
app:layout_columnSpan="2"
app:layout_gravity="center" app:layout_gravity="center"
style="@style/LargeCircularProgress" /> style="@style/LargeCircularProgress" />
<TextView <LinearLayout
android:id="@+id/title" android:layout_width="match_parent"
style="@style/DownloadItemText" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:orientation="horizontal"
android:layout_marginTop="11dp" android:baselineAligned="false"
android:textAppearance="@style/BlackTitle1"
app:layout_column="0" app:layout_column="0"
app:layout_row="1" app:layout_row="1">
android:layout_marginStart="16dp"
app:layout_gravity="fill_horizontal" />
<TextView <LinearLayout
android:id="@+id/caption" android:layout_width="0dp"
style="@style/DownloadItemText" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:orientation="vertical"
android:layout_marginBottom="11dp" android:layout_marginStart="16dp"
android:textAppearance="@style/BlackHint2" android:layout_weight="1">
app:layout_column="0" <TextView
app:layout_row="2" android:id="@+id/title"
android:layout_marginStart="16dp" style="@style/DownloadItemText"
app:layout_gravity="fill_horizontal" /> android:layout_width="match_parent"
android:layout_marginTop="11dp"
android:textAppearance="@style/BlackTitle1" />
<TextView
android:id="@+id/caption"
style="@style/DownloadItemText"
android:layout_width="match_parent"
android:layout_marginBottom="11dp"
android:textAppearance="@style/BlackHint2" />
</LinearLayout>
<org.chromium.ui.widget.ChromeImageButton
android:id="@+id/cancel_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_weight="0"
android:background="?attr/selectableItemBackground"
android:contentDescription="@string/download_notification_cancel_button"
android:src="@drawable/btn_close"
app:tint="@color/default_icon_color" />
<org.chromium.ui.widget.ChromeImageButton </LinearLayout>
android:id="@+id/cancel_button"
android:layout_width="48dp"
android:layout_height="48dp"
app:layout_column="1"
app:layout_row="1"
app:layout_rowSpan="2"
app:layout_gravity="center_vertical|end"
android:background="?attr/selectableItemBackground"
android:contentDescription="@string/download_notification_cancel_button"
android:src="@drawable/btn_close"
app:tint="@color/default_icon_color" />
</android.support.v7.widget.GridLayout> </android.support.v7.widget.GridLayout>
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:clickable="true" android:clickable="true"
android:background="@drawable/hairline_border_card_background" android:background="@drawable/hairline_border_card_background"
app:columnCount="2" app:columnCount="1"
app:rowCount="3"> app:rowCount="2">
<org.chromium.chrome.browser.download.home.list.view.AsyncImageView <org.chromium.chrome.browser.download.home.list.view.AsyncImageView
android:id="@+id/thumbnail" android:id="@+id/thumbnail"
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
android:adjustViewBounds="true" android:adjustViewBounds="true"
app:layout_column="0" app:layout_column="0"
app:layout_row="0" app:layout_row="0"
app:layout_columnSpan="2"
app:layout_gravity="center" app:layout_gravity="center"
app:cornerRadiusTopStart="@dimen/download_manager_thumbnail_corner_radius" app:cornerRadiusTopStart="@dimen/download_manager_thumbnail_corner_radius"
app:cornerRadiusTopEnd="@dimen/download_manager_thumbnail_corner_radius" app:cornerRadiusTopEnd="@dimen/download_manager_thumbnail_corner_radius"
...@@ -39,34 +38,40 @@ ...@@ -39,34 +38,40 @@
app:layout_column="0" app:layout_column="0"
app:layout_row="0" /> app:layout_row="0" />
<TextView <LinearLayout
android:id="@+id/title" android:layout_width="match_parent"
style="@style/DownloadItemText" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:orientation="horizontal"
android:layout_marginTop="11dp" android:baselineAligned="false"
android:textAppearance="@style/BlackTitle1"
app:layout_column="0" app:layout_column="0"
app:layout_row="1" app:layout_row="1">
android:layout_marginStart="16dp"
app:layout_gravity="fill_horizontal" />
<TextView <LinearLayout
android:id="@+id/caption" android:layout_width="0dp"
style="@style/DownloadItemText" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:orientation="vertical"
android:layout_marginBottom="11dp" android:layout_marginStart="16dp"
android:textAppearance="@style/BlackHint2" android:layout_weight="1">
app:layout_column="0" <TextView
app:layout_row="2" android:id="@+id/title"
android:layout_marginStart="16dp" style="@style/DownloadItemText"
app:layout_gravity="fill_horizontal" /> android:layout_width="match_parent"
android:layout_marginTop="11dp"
android:textAppearance="@style/BlackTitle1" />
<TextView
android:id="@+id/caption"
style="@style/DownloadItemText"
android:layout_width="match_parent"
android:layout_marginBottom="11dp"
android:textAppearance="@style/BlackHint2" />
</LinearLayout>
<include layout="@layout/list_menu_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_weight="0" />
<include layout="@layout/list_menu_button" </LinearLayout>
android:layout_width="48dp"
android:layout_height="48dp"
app:layout_column="1"
app:layout_row="1"
app:layout_rowSpan="2"
app:layout_gravity="center_vertical|end" />
</android.support.v7.widget.GridLayout> </android.support.v7.widget.GridLayout>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment