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.ntp; | 5 package org.chromium.chrome.browser.ntp; |
6 | 6 |
7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.graphics.Canvas; | 9 import android.graphics.Canvas; |
10 import android.os.Build; | 10 import android.os.Build; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 mGestureDetector = new GestureDetector( | 53 mGestureDetector = new GestureDetector( |
54 getContext(), new GestureDetector.SimpleOnGestureListener() { | 54 getContext(), new GestureDetector.SimpleOnGestureListener() { |
55 @Override | 55 @Override |
56 public boolean onSingleTapUp(MotionEvent e) { | 56 public boolean onSingleTapUp(MotionEvent e) { |
57 boolean retVal = super.onSingleTapUp(e); | 57 boolean retVal = super.onSingleTapUp(e); |
58 requestFocus(); | 58 requestFocus(); |
59 return retVal; | 59 return retVal; |
60 } | 60 } |
61 }); | 61 }); |
| 62 setBackgroundColor(NtpColorUtils.getBackgroundColorResource(getResources
())); |
62 } | 63 } |
63 | 64 |
64 /** | 65 /** |
65 * Enables drawing a shadow at the bottom of the view when the view's conten
t extends beyond | 66 * Enables drawing a shadow at the bottom of the view when the view's conten
t extends beyond |
66 * the bottom of the view. This is exactly the same as a fading edge, except
that the shadow | 67 * the bottom of the view. This is exactly the same as a fading edge, except
that the shadow |
67 * color can have an alpha component, whereas a fading edge color must be op
aque. | 68 * color can have an alpha component, whereas a fading edge color must be op
aque. |
68 * | 69 * |
69 * @param shadowColor The color of the shadow, e.g. 0x11000000. | 70 * @param shadowColor The color of the shadow, e.g. 0x11000000. |
70 */ | 71 */ |
71 public void enableBottomShadow(int shadowColor) { | 72 public void enableBottomShadow(int shadowColor) { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 if (mFadingShadow != null) { | 154 if (mFadingShadow != null) { |
154 setVerticalFadingEdgeEnabled(true); | 155 setVerticalFadingEdgeEnabled(true); |
155 float shadowStrength = getBottomFadingEdgeStrength(); | 156 float shadowStrength = getBottomFadingEdgeStrength(); |
156 float shadowHeight = getVerticalFadingEdgeLength(); | 157 float shadowHeight = getVerticalFadingEdgeLength(); |
157 setVerticalFadingEdgeEnabled(false); | 158 setVerticalFadingEdgeEnabled(false); |
158 mFadingShadow.drawShadow(this, canvas, FadingShadow.POSITION_BOTTOM, | 159 mFadingShadow.drawShadow(this, canvas, FadingShadow.POSITION_BOTTOM, |
159 shadowHeight, shadowStrength); | 160 shadowHeight, shadowStrength); |
160 } | 161 } |
161 } | 162 } |
162 } | 163 } |
OLD | NEW |