Commit ae4f2afe authored by Tomasz Wiszkowski's avatar Tomasz Wiszkowski Committed by Commit Bot

Use the TextSecondaryThick for group headers

This change improves clarity of the suggestion headers by updating
the text style used to render the group title.

Bug: 1123740
Change-Id: I77c9b89adbc8f4cd5477deef022db3912d9d1ae0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2556215
Commit-Queue: Tomasz Wiszkowski <ender@google.com>
Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#830609}
parent f8fb2ff1
...@@ -56,7 +56,7 @@ public class HeaderView extends SimpleHorizontalLayoutView { ...@@ -56,7 +56,7 @@ public class HeaderView extends SimpleHorizontalLayoutView {
mHeaderText.setEllipsize(TruncateAt.END); mHeaderText.setEllipsize(TruncateAt.END);
mHeaderText.setAllCaps(true); mHeaderText.setAllCaps(true);
TextViewCompat.setTextAppearance( TextViewCompat.setTextAppearance(
mHeaderText, ChromeColors.getMediumTextSecondaryStyle(false)); mHeaderText, ChromeColors.getTextMediumThickSecondaryStyle(false));
mHeaderText.setMinHeight(context.getResources().getDimensionPixelSize( mHeaderText.setMinHeight(context.getResources().getDimensionPixelSize(
R.dimen.omnibox_suggestion_header_height)); R.dimen.omnibox_suggestion_header_height));
mHeaderText.setGravity(Gravity.CENTER_VERTICAL); mHeaderText.setGravity(Gravity.CENTER_VERTICAL);
......
...@@ -24,8 +24,8 @@ public class HeaderViewBinder { ...@@ -24,8 +24,8 @@ public class HeaderViewBinder {
} else if (propertyKey == SuggestionCommonProperties.OMNIBOX_THEME) { } else if (propertyKey == SuggestionCommonProperties.OMNIBOX_THEME) {
final boolean useDarkColors = !OmniboxResourceProvider.isDarkMode( final boolean useDarkColors = !OmniboxResourceProvider.isDarkMode(
model.get(SuggestionCommonProperties.OMNIBOX_THEME)); model.get(SuggestionCommonProperties.OMNIBOX_THEME));
TextViewCompat.setTextAppearance( TextViewCompat.setTextAppearance(view.getTextView(),
view.getTextView(), ChromeColors.getMediumTextSecondaryStyle(!useDarkColors)); ChromeColors.getTextMediumThickSecondaryStyle(!useDarkColors));
ApiCompatibilityUtils.setImageTintList(view.getIconView(), ApiCompatibilityUtils.setImageTintList(view.getIconView(),
ChromeColors.getPrimaryIconTint(view.getContext(), !useDarkColors)); ChromeColors.getPrimaryIconTint(view.getContext(), !useDarkColors));
} else if (propertyKey == SuggestionCommonProperties.LAYOUT_DIRECTION) { } else if (propertyKey == SuggestionCommonProperties.LAYOUT_DIRECTION) {
......
...@@ -59,15 +59,15 @@ public class ChromeColors { ...@@ -59,15 +59,15 @@ public class ChromeColors {
} }
/** /**
* Returns the medium text secondary style based on the given parameter. * Returns the text medium thick secondary style based on the given parameter.
* *
* @param forceLightTextColor When true, returns the light-mode medium text secondary style; * @param forceLightTextColor When true, returns the light-mode medium text secondary style;
* otherwise returns adaptive medium text secondary style. * otherwise returns adaptive medium text secondary style.
* @return The medium text secondary style. * @return The medium text secondary style.
*/ */
public static int getMediumTextSecondaryStyle(boolean forceLightTextColor) { public static int getTextMediumThickSecondaryStyle(boolean forceLightTextColor) {
return forceLightTextColor ? R.style.TextAppearance_TextMedium_Secondary_Light return forceLightTextColor ? R.style.TextAppearance_TextMediumThick_Secondary_Light
: R.style.TextAppearance_TextMedium_Secondary; : R.style.TextAppearance_TextMediumThick_Secondary;
} }
/** /**
......
...@@ -234,6 +234,9 @@ ...@@ -234,6 +234,9 @@
<style name="TextAppearance.TextSmall.Primary.Light" tools:ignore="UnusedResources"> <style name="TextAppearance.TextSmall.Primary.Light" tools:ignore="UnusedResources">
<item name="android:textColor">@color/default_text_color_light_list</item> <item name="android:textColor">@color/default_text_color_light_list</item>
</style> </style>
<style name="TextAppearance.TextMediumThick.Secondary.Light" tools:ignore="UnusedResources">
<item name="android:textColor">@color/default_text_color_light_list</item>
</style>
<style name="TextAppearance.TextLarge.Secondary.Light" tools:ignore="UnusedResources"> <style name="TextAppearance.TextLarge.Secondary.Light" tools:ignore="UnusedResources">
<item name="android:textColor">@color/default_text_color_secondary_light_list</item> <item name="android:textColor">@color/default_text_color_secondary_light_list</item>
......
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