OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.chrome.browser.ntp; |
| 6 |
| 7 import android.content.res.Resources; |
| 8 |
| 9 import org.chromium.base.ApiCompatibilityUtils; |
| 10 import org.chromium.chrome.R; |
| 11 import org.chromium.chrome.browser.ChromeFeatureList; |
| 12 |
| 13 /** |
| 14 * Utility class for figuring out which colors to use for the NTP. This class is
needed while we |
| 15 * transition the NTP to the new material design spec. |
| 16 */ |
| 17 public class NtpColorUtils { |
| 18 |
| 19 private NtpColorUtils() {} |
| 20 |
| 21 public static int getBackgroundColorResource(Resources res) { |
| 22 return (ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_SNIPPETS) |
| 23 || ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_MATE
RIAL_DESIGN)) |
| 24 ? ApiCompatibilityUtils.getColor(res, R.color.ntp_material_desig
n_bg) |
| 25 : ApiCompatibilityUtils.getColor(res, R.color.ntp_bg); |
| 26 } |
| 27 } |
OLD | NEW |