Skip to content

Commit

Permalink
[History] Update delete icon from trash can to (X) button
Browse files Browse the repository at this point in the history
Update the delete icon next to items in the Android history UI. Also
remove duplicate resource.

Also removes duplicate btn_trash icon and replaces uses with
ic_delete_white_24dp.

BUG=799493

Change-Id: I9c628372f25298e50632b6412a87926dd7cf46ad
Reviewed-on: https://chromium-review.googlesource.com/895914
Reviewed-by: Matthew Jones <mdjones@chromium.org>
Commit-Queue: Theresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533479}
  • Loading branch information
Theresa authored and Commit Bot committed Feb 1, 2018
1 parent e09f8de commit 845319f
Show file tree
Hide file tree
Showing 18 changed files with 20 additions and 19 deletions.
Binary file removed chrome/android/java/res/drawable-hdpi/btn_trash.png
Binary file not shown.
Binary file removed chrome/android/java/res/drawable-mdpi/btn_trash.png
Binary file not shown.
Binary file removed chrome/android/java/res/drawable-xhdpi/btn_trash.png
Binary file not shown.
Binary file removed chrome/android/java/res/drawable-xxhdpi/btn_trash.png
Binary file not shown.
Binary file removed chrome/android/java/res/drawable-xxxhdpi/btn_trash.png
Binary file not shown.
2 changes: 1 addition & 1 deletion chrome/android/java/res/layout-sw600dp/location_bar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
android:id="@+id/delete_button"
style="@style/LocationBarButtonTablet"
android:layout_marginEnd="44dp"
android:src="@drawable/btn_delete_url"
android:src="@drawable/btn_delete_24dp"
android:visibility="gone"
android:contentDescription="@string/accessibility_toolbar_btn_delete_url" />
<!-- delete_button and bookmark_button overlap, so they should have the same right margin -->
Expand Down
2 changes: 1 addition & 1 deletion chrome/android/java/res/layout/clear_storage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/webstorage_clear_data_dialog_title"
android:src="@drawable/btn_trash"
android:src="@drawable/ic_delete_white_24dp"
chrome:chrometint="@color/blue_mode_tint"/>
11 changes: 3 additions & 8 deletions chrome/android/java/res/layout/history_item_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" >

<!-- TODO(twellington): remove start/end margin when new assets with
correct built in padding are available. The end
padding is set programatically so margin is used
rather than padding to achieve the correct visual
effect. -->
<LinearLayout
android:id="@+id/content"
style="@style/ListItemContainer" >
Expand All @@ -22,10 +17,10 @@

<org.chromium.chrome.browser.widget.TintedImageButton
android:id="@+id/remove"
style="@style/ListItemEndIcon"
style="@style/HistoryListItemEndIcon"
android:contentDescription="@string/remove"
android:src="@drawable/btn_trash"
chrome:chrometint="@color/dark_mode_tint" />
android:src="@drawable/btn_delete_24dp"
chrome:chrometint="@color/black_alpha_38" />
</LinearLayout>

</org.chromium.chrome.browser.history.HistoryItemView>
2 changes: 1 addition & 1 deletion chrome/android/java/res/layout/location_bar_base.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="center"
android:src="@drawable/btn_delete_url"
android:src="@drawable/btn_delete_24dp"
android:visibility="invisible"
android:contentDescription="@string/accessibility_toolbar_btn_delete_url" />

Expand Down
4 changes: 2 additions & 2 deletions chrome/android/java/res/layout/search_toolbar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingStart="16dp"
android:paddingEnd="12dp"
android:src="@drawable/btn_delete_url"
android:paddingEnd="8dp"
android:src="@drawable/btn_delete_24dp"
android:background="@null"
android:scaleType="center"
android:contentDescription="@string/accessibility_toolbar_btn_delete_url"
Expand Down
6 changes: 6 additions & 0 deletions chrome/android/java/res/values-v17/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,12 @@
<item name="android:background">@null</item>
<item name="android:scaleType">center</item>
</style>
<!-- 18dp padding is added to each side to limit the image width to 20dp (56dp - 2 * 18dp). -->
<style name="HistoryListItemEndIcon" parent="ListItemEndIcon">
<item name="android:paddingStart">18dp</item>
<item name="android:paddingEnd">18dp</item>
<item name="android:scaleType">centerInside</item>
</style>
<style name="ListMenuStyle" parent="Widget.AppCompat.ListPopupWindow">
<item name="android:popupBackground">@drawable/menu_bg</item>
</style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ public boolean onCreateOptionsMenu(Menu menu) {
.setShowAsActionFlags(MenuItem.SHOW_AS_ACTION_IF_ROOM);
} else {
mDeleteButton = menu.add(R.string.bookmark_action_bar_delete)
.setIcon(TintedDrawable.constructTintedDrawable(
getResources(), R.drawable.btn_trash))
.setShowAsActionFlags(MenuItem.SHOW_AS_ACTION_IF_ROOM);
.setIcon(TintedDrawable.constructTintedDrawable(
getResources(), R.drawable.ic_delete_white_24dp))
.setShowAsActionFlags(MenuItem.SHOW_AS_ACTION_IF_ROOM);
}

return super.onCreateOptionsMenu(menu);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ private void updateViewContent(boolean modelChanged) {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
mDeleteButton = menu.add(R.string.bookmark_action_bar_delete)
.setIcon(TintedDrawable.constructTintedDrawable(
getResources(), R.drawable.btn_trash))
.setShowAsActionFlags(MenuItem.SHOW_AS_ACTION_IF_ROOM);
.setIcon(TintedDrawable.constructTintedDrawable(
getResources(), R.drawable.ic_delete_white_24dp))
.setShowAsActionFlags(MenuItem.SHOW_AS_ACTION_IF_ROOM);

return super.onCreateOptionsMenu(menu);
}
Expand Down

0 comments on commit 845319f

Please sign in to comment.