Commit bd9af7f3 authored by Becky Zhou's avatar Becky Zhou Committed by Commit Bot

[NTP OptOut] Polish on expandable header view

+ Using material icon for expand/collapse
+ Remove 10dp top padding from header view

Bug: 818368
Change-Id: I7d9318e1a8c9b1edcf7b51aa9e4804eb82f38ea9
Reviewed-on: https://chromium-review.googlesource.com/952542Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Becky Zhou <huayinz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541688}
parent 8680afd3
...@@ -44,13 +44,13 @@ ...@@ -44,13 +44,13 @@
android:id="@+id/find_prev_button" android:id="@+id/find_prev_button"
style="@style/ToolbarButton" style="@style/ToolbarButton"
android:layout_height="match_parent" android:layout_height="match_parent"
android:src="@drawable/ic_collapsed" android:src="@drawable/ic_expand_less_black_24dp"
android:contentDescription="@string/accessibility_find_toolbar_btn_prev" /> android:contentDescription="@string/accessibility_find_toolbar_btn_prev" />
<org.chromium.chrome.browser.widget.TintedImageButton <org.chromium.chrome.browser.widget.TintedImageButton
android:id="@+id/find_next_button" android:id="@+id/find_next_button"
style="@style/ToolbarButton" style="@style/ToolbarButton"
android:layout_height="match_parent" android:layout_height="match_parent"
android:src="@drawable/ic_expanded" android:src="@drawable/ic_expand_more_black_24dp"
android:contentDescription="@string/accessibility_find_toolbar_btn_next" /> android:contentDescription="@string/accessibility_find_toolbar_btn_next" />
<org.chromium.chrome.browser.widget.TintedImageButton <org.chromium.chrome.browser.widget.TintedImageButton
android:id="@+id/close_find_button" android:id="@+id/close_find_button"
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
android:orientation="horizontal" android:orientation="horizontal"
android:paddingStart="@dimen/snippets_padding" android:paddingStart="@dimen/snippets_padding"
android:paddingEnd="@dimen/snippets_padding" android:paddingEnd="@dimen/snippets_padding"
android:paddingTop="@dimen/snippets_header_top_padding"
android:gravity="center_vertical"> android:gravity="center_vertical">
<TextView <TextView
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
android:layout_gravity="center_vertical|end" android:layout_gravity="center_vertical|end"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:contentDescription="@null" android:contentDescription="@null"
android:src="@drawable/ic_expanded" /> android:src="@drawable/ic_expand_more_black_24dp" />
</LinearLayout> </LinearLayout>
<TextView <TextView
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<org.chromium.chrome.browser.widget.TintedImageButton <org.chromium.chrome.browser.widget.TintedImageButton
android:id="@+id/expand_sheet_button" android:id="@+id/expand_sheet_button"
style="@style/ToolbarButton" style="@style/ToolbarButton"
android:src="@drawable/ic_collapsed" android:src="@drawable/ic_expand_less_black_24dp"
android:contentDescription="@string/accessibility_toolbar_btn_expand" android:contentDescription="@string/accessibility_toolbar_btn_expand"
android:visibility="gone" /> android:visibility="gone" />
......
...@@ -112,7 +112,8 @@ public class OfflineGroupHeaderView ...@@ -112,7 +112,8 @@ public class OfflineGroupHeaderView
} }
private void updateExpandIcon(boolean expanded) { private void updateExpandIcon(boolean expanded) {
mExpandImage.setImageResource(expanded ? R.drawable.ic_collapsed : R.drawable.ic_expanded); mExpandImage.setImageResource(expanded ? R.drawable.ic_expand_less_black_24dp
: R.drawable.ic_expand_more_black_24dp);
mExpandImage.setContentDescription( mExpandImage.setContentDescription(
getResources().getString(expanded ? R.string.accessibility_collapse_section_header getResources().getString(expanded ? R.string.accessibility_collapse_section_header
: R.string.accessibility_expand_section_header)); : R.string.accessibility_expand_section_header));
......
...@@ -65,9 +65,10 @@ public class RecentTabsGroupView extends RelativeLayout { ...@@ -65,9 +65,10 @@ public class RecentTabsGroupView extends RelativeLayout {
// Create drawable for expand/collapse arrow. // Create drawable for expand/collapse arrow.
LevelListDrawable collapseIcon = new LevelListDrawable(); LevelListDrawable collapseIcon = new LevelListDrawable();
collapseIcon.addLevel(DRAWABLE_LEVEL_COLLAPSED, DRAWABLE_LEVEL_COLLAPSED, collapseIcon.addLevel(DRAWABLE_LEVEL_COLLAPSED, DRAWABLE_LEVEL_COLLAPSED,
TintedDrawable.constructTintedDrawable(getResources(), R.drawable.ic_expanded)); TintedDrawable.constructTintedDrawable(
TintedDrawable collapse = getResources(), R.drawable.ic_expand_more_black_24dp));
TintedDrawable.constructTintedDrawable(getResources(), R.drawable.ic_collapsed); TintedDrawable collapse = TintedDrawable.constructTintedDrawable(
getResources(), R.drawable.ic_expand_less_black_24dp);
collapse.setTint( collapse.setTint(
ApiCompatibilityUtils.getColorStateList(getResources(), R.color.blue_mode_tint)); ApiCompatibilityUtils.getColorStateList(getResources(), R.color.blue_mode_tint));
collapseIcon.addLevel(DRAWABLE_LEVEL_EXPANDED, DRAWABLE_LEVEL_EXPANDED, collapse); collapseIcon.addLevel(DRAWABLE_LEVEL_EXPANDED, DRAWABLE_LEVEL_EXPANDED, collapse);
......
...@@ -118,8 +118,8 @@ public class SectionHeaderViewHolder extends NewTabPageViewHolder implements Vie ...@@ -118,8 +118,8 @@ public class SectionHeaderViewHolder extends NewTabPageViewHolder implements Vie
*/ */
private void updateIconDrawable() { private void updateIconDrawable() {
if (!mHeader.isExpandable()) return; if (!mHeader.isExpandable()) return;
mIconView.setImageResource( mIconView.setImageResource(mHeader.isExpanded() ? R.drawable.ic_expand_less_black_24dp
mHeader.isExpanded() ? R.drawable.ic_collapsed : R.drawable.ic_expanded); : R.drawable.ic_expand_more_black_24dp);
mIconView.setContentDescription(mIconView.getResources().getString(mHeader.isExpanded() mIconView.setContentDescription(mIconView.getResources().getString(mHeader.isExpanded()
? R.string.accessibility_collapse_section_header ? R.string.accessibility_collapse_section_header
: R.string.accessibility_expand_section_header)); : R.string.accessibility_expand_section_header));
......
...@@ -411,7 +411,7 @@ public abstract class PaymentRequestSection extends LinearLayout implements View ...@@ -411,7 +411,7 @@ public abstract class PaymentRequestSection extends LinearLayout implements View
private ImageView createAndAddChevron(ViewGroup parent) { private ImageView createAndAddChevron(ViewGroup parent) {
Resources resources = parent.getResources(); Resources resources = parent.getResources();
TintedDrawable chevron = TintedDrawable.constructTintedDrawable( TintedDrawable chevron = TintedDrawable.constructTintedDrawable(
resources, R.drawable.ic_expanded, R.color.payments_section_chevron); resources, R.drawable.ic_expand_more_black_24dp, R.color.payments_section_chevron);
ImageView view = new ImageView(parent.getContext()); ImageView view = new ImageView(parent.getContext());
view.setImageDrawable(chevron); view.setImageDrawable(chevron);
......
...@@ -270,7 +270,8 @@ public class SingleCategoryPreferences extends PreferenceFragment ...@@ -270,7 +270,8 @@ public class SingleCategoryPreferences extends PreferenceFragment
// Set the title and arrow icons for the header. // Set the title and arrow icons for the header.
allowedGroup.setGroupTitle(resourceId, numAllowed); allowedGroup.setGroupTitle(resourceId, numAllowed);
TintedDrawable icon = TintedDrawable.constructTintedDrawable(getResources(), TintedDrawable icon = TintedDrawable.constructTintedDrawable(getResources(),
mAllowListExpanded ? R.drawable.ic_expanded : R.drawable.ic_collapsed); mAllowListExpanded ? R.drawable.ic_expand_more_black_24dp
: R.drawable.ic_expand_less_black_24dp);
allowedGroup.setExpanded(mAllowListExpanded); allowedGroup.setExpanded(mAllowListExpanded);
allowedGroup.setIcon(icon); allowedGroup.setIcon(icon);
} }
...@@ -290,7 +291,8 @@ public class SingleCategoryPreferences extends PreferenceFragment ...@@ -290,7 +291,8 @@ public class SingleCategoryPreferences extends PreferenceFragment
: R.string.website_settings_blocked_group_heading; : R.string.website_settings_blocked_group_heading;
blockedGroup.setGroupTitle(resourceId, numBlocked); blockedGroup.setGroupTitle(resourceId, numBlocked);
TintedDrawable icon = TintedDrawable.constructTintedDrawable(getResources(), TintedDrawable icon = TintedDrawable.constructTintedDrawable(getResources(),
mBlockListExpanded ? R.drawable.ic_expanded : R.drawable.ic_collapsed); mBlockListExpanded ? R.drawable.ic_expand_more_black_24dp
: R.drawable.ic_expand_less_black_24dp);
blockedGroup.setExpanded(mBlockListExpanded); blockedGroup.setExpanded(mBlockListExpanded);
blockedGroup.setIcon(icon); blockedGroup.setIcon(icon);
} }
......
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