Commit dd308ef2 authored by Daniel Park's avatar Daniel Park Committed by Commit Bot

[Chrome Modern] Updates colors for recent tabs page background

Other visual changes coming in later CLs

Bug: 820648
Change-Id: I1ac47a4f45af906cf1ba53f3304dd2d55bc1c684
Reviewed-on: https://chromium-review.googlesource.com/959145
Commit-Queue: Ted Choc <tedchoc@chromium.org>
Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544159}
parent 84f77307
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
package org.chromium.chrome.browser.ntp; package org.chromium.chrome.browser.ntp;
import android.app.Activity; import android.app.Activity;
import android.content.res.Resources;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.graphics.Color; import android.graphics.Color;
import android.os.SystemClock; import android.os.SystemClock;
...@@ -25,6 +26,8 @@ import org.chromium.chrome.browser.NativePage; ...@@ -25,6 +26,8 @@ import org.chromium.chrome.browser.NativePage;
import org.chromium.chrome.browser.UrlConstants; import org.chromium.chrome.browser.UrlConstants;
import org.chromium.chrome.browser.compositor.layouts.content.InvalidationAwareThumbnailProvider; import org.chromium.chrome.browser.compositor.layouts.content.InvalidationAwareThumbnailProvider;
import org.chromium.chrome.browser.metrics.StartupMetrics; import org.chromium.chrome.browser.metrics.StartupMetrics;
import org.chromium.chrome.browser.util.ColorUtils;
import org.chromium.chrome.browser.util.FeatureUtilities;
import org.chromium.chrome.browser.util.ViewUtils; import org.chromium.chrome.browser.util.ViewUtils;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
...@@ -82,10 +85,11 @@ public class RecentTabsPage ...@@ -82,10 +85,11 @@ public class RecentTabsPage
public RecentTabsPage(ChromeActivity activity, RecentTabsManager recentTabsManager) { public RecentTabsPage(ChromeActivity activity, RecentTabsManager recentTabsManager) {
mActivity = activity; mActivity = activity;
mRecentTabsManager = recentTabsManager; mRecentTabsManager = recentTabsManager;
Resources resources = activity.getResources();
mTitle = activity.getResources().getString(R.string.recent_tabs); mTitle = resources.getString(R.string.recent_tabs);
mThemeColor = ApiCompatibilityUtils.getColor( mThemeColor = ColorUtils.getDefaultThemeColor(
activity.getResources(), R.color.default_primary_color); resources, FeatureUtilities.isChromeModernDesignEnabled(), false);
mRecentTabsManager.setUpdatedCallback(this); mRecentTabsManager.setUpdatedCallback(this);
LayoutInflater inflater = LayoutInflater.from(activity); LayoutInflater inflater = LayoutInflater.from(activity);
mView = (ViewGroup) inflater.inflate(R.layout.recent_tabs_page, null); mView = (ViewGroup) inflater.inflate(R.layout.recent_tabs_page, null);
...@@ -102,13 +106,15 @@ public class RecentTabsPage ...@@ -102,13 +106,15 @@ public class RecentTabsPage
ApplicationStatus.registerStateListenerForActivity(this, activity); ApplicationStatus.registerStateListenerForActivity(this, activity);
// {@link #mInForeground} will be updated once the view is attached to the window. // {@link #mInForeground} will be updated once the view is attached to the window.
View recentTabsRoot = mView.findViewById(R.id.recent_tabs_root);
if (FeatureUtilities.isChromeModernDesignEnabled()) {
recentTabsRoot.setBackgroundColor(mThemeColor);
}
if (activity.getBottomSheet() != null) { if (activity.getBottomSheet() != null) {
View recentTabsRoot = mView.findViewById(R.id.recent_tabs_root);
ApiCompatibilityUtils.setPaddingRelative(recentTabsRoot, ApiCompatibilityUtils.setPaddingRelative(recentTabsRoot,
ApiCompatibilityUtils.getPaddingStart(recentTabsRoot), 0, ApiCompatibilityUtils.getPaddingStart(recentTabsRoot), 0,
ApiCompatibilityUtils.getPaddingEnd(recentTabsRoot), ApiCompatibilityUtils.getPaddingEnd(recentTabsRoot),
activity.getResources().getDimensionPixelSize( resources.getDimensionPixelSize(R.dimen.bottom_control_container_height));
R.dimen.bottom_control_container_height));
} }
onUpdated(); onUpdated();
......
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