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

Use Compat mechanism to setTextAppearance.

This addresses the setTextApearance version limitations.
Unclear how this passed presubmit.

Related change: https://crrev.com/c/2191195

Bug: 1082222
Change-Id: Ida9588ecdac4324c0cd54aac19b00614b9826b40
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2202957
Commit-Queue: Ender <ender@google.com>
Commit-Queue: Ted Choc <tedchoc@chromium.org>
Auto-Submit: Ender <ender@google.com>
Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#768976}
parent a3edc690
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
package org.chromium.chrome.browser.omnibox.suggestions.header; package org.chromium.chrome.browser.omnibox.suggestions.header;
import androidx.core.view.ViewCompat; import androidx.core.view.ViewCompat;
import androidx.core.widget.TextViewCompat;
import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.chrome.R; import org.chromium.chrome.R;
...@@ -21,8 +22,8 @@ public class HeaderViewBinder { ...@@ -21,8 +22,8 @@ public class HeaderViewBinder {
view.getTextView().setText(model.get(HeaderViewProperties.TITLE)); view.getTextView().setText(model.get(HeaderViewProperties.TITLE));
} else if (propertyKey == SuggestionCommonProperties.USE_DARK_COLORS) { } else if (propertyKey == SuggestionCommonProperties.USE_DARK_COLORS) {
final boolean useDarkColors = model.get(SuggestionCommonProperties.USE_DARK_COLORS); final boolean useDarkColors = model.get(SuggestionCommonProperties.USE_DARK_COLORS);
view.getTextView().setTextAppearance( TextViewCompat.setTextAppearance(
ChromeColors.getMediumTextSecondaryStyle(!useDarkColors)); view.getTextView(), ChromeColors.getMediumTextSecondaryStyle(!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) {
......
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