| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.compositor.layouts; | 5 package org.chromium.chrome.browser.compositor.layouts; |
| 6 | 6 |
| 7 import android.annotation.SuppressLint; |
| 7 import android.content.res.Configuration; | 8 import android.content.res.Configuration; |
| 8 import android.content.res.Resources; | 9 import android.content.res.Resources; |
| 9 import android.graphics.Color; | 10 import android.graphics.Color; |
| 10 import android.graphics.drawable.ColorDrawable; | 11 import android.graphics.drawable.ColorDrawable; |
| 11 import android.graphics.drawable.Drawable; | 12 import android.graphics.drawable.Drawable; |
| 12 import android.test.mock.MockResources; | 13 import android.test.mock.MockResources; |
| 13 import android.util.DisplayMetrics; | 14 import android.util.DisplayMetrics; |
| 14 import android.util.SparseArray; | 15 import android.util.SparseArray; |
| 15 import android.util.SparseBooleanArray; | 16 import android.util.SparseBooleanArray; |
| 16 import android.util.SparseIntArray; | 17 import android.util.SparseIntArray; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 return mBooleans.get(id); | 110 return mBooleans.get(id); |
| 110 } | 111 } |
| 111 | 112 |
| 112 @Override | 113 @Override |
| 113 public String getString(int id) { | 114 public String getString(int id) { |
| 114 final String value = mStrings.get(id); | 115 final String value = mStrings.get(id); |
| 115 return value != null ? value.toString() : mValidResources.getString(id); | 116 return value != null ? value.toString() : mValidResources.getString(id); |
| 116 } | 117 } |
| 117 | 118 |
| 118 @Override | 119 @Override |
| 120 // TODO(crbug.com/635567): Fix this properly. |
| 121 @SuppressLint("ResourceType") |
| 119 public int getColor(int id) { | 122 public int getColor(int id) { |
| 120 return getInteger(id); | 123 return getInteger(id); |
| 121 } | 124 } |
| 122 | 125 |
| 123 @Override | 126 @Override |
| 127 // TODO(crbug.com/635567): Fix this properly. |
| 128 @SuppressLint("ResourceType") |
| 124 public int getColor(int id, Theme theme) { | 129 public int getColor(int id, Theme theme) { |
| 125 return getInteger(id); | 130 return getInteger(id); |
| 126 } | 131 } |
| 127 | 132 |
| 128 @Override | 133 @Override |
| 129 public Drawable getDrawable(int id) { | 134 public Drawable getDrawable(int id) { |
| 130 return mDrawable; | 135 return mDrawable; |
| 131 } | 136 } |
| 132 | 137 |
| 133 @Override | 138 @Override |
| 134 public Drawable getDrawable(int id, Resources.Theme theme) { | 139 public Drawable getDrawable(int id, Resources.Theme theme) { |
| 135 return mDrawable; | 140 return mDrawable; |
| 136 } | 141 } |
| 137 } | 142 } |
| OLD | NEW |