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.notifications; | 5 package org.chromium.chrome.browser.notifications; |
6 | 6 |
7 import android.app.Notification; | 7 import android.app.Notification; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.content.res.Resources; | 9 import android.content.res.Resources; |
10 import android.graphics.Bitmap; | 10 import android.graphics.Bitmap; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 bigView.setViewVisibility(R.id.small_icon_footer, View.VISIBLE); | 116 bigView.setViewVisibility(R.id.small_icon_footer, View.VISIBLE); |
117 } | 117 } |
118 | 118 |
119 NotificationCompat.Builder builder = new NotificationCompat.Builder(mCon
text); | 119 NotificationCompat.Builder builder = new NotificationCompat.Builder(mCon
text); |
120 builder.setTicker(mTickerText); | 120 builder.setTicker(mTickerText); |
121 builder.setSmallIcon(mSmallIconId); | 121 builder.setSmallIcon(mSmallIconId); |
122 builder.setContentIntent(mContentIntent); | 122 builder.setContentIntent(mContentIntent); |
123 builder.setDeleteIntent(mDeleteIntent); | 123 builder.setDeleteIntent(mDeleteIntent); |
124 builder.setDefaults(mDefaults); | 124 builder.setDefaults(mDefaults); |
125 builder.setVibrate(mVibratePattern); | 125 builder.setVibrate(mVibratePattern); |
| 126 builder.setWhen(mTimestamp); |
126 builder.setContent(compactView); | 127 builder.setContent(compactView); |
127 | 128 |
128 // Some things are duplicated in the builder to ensure the notification
shows correctly on | 129 // Some things are duplicated in the builder to ensure the notification
shows correctly on |
129 // Wear devices and custom lock screens. | 130 // Wear devices and custom lock screens. |
130 builder.setContentTitle(mTitle); | 131 builder.setContentTitle(mTitle); |
131 builder.setContentText(mBody); | 132 builder.setContentText(mBody); |
132 builder.setSubText(mOrigin); | 133 builder.setSubText(mOrigin); |
133 builder.setLargeIcon(mLargeIcon); | 134 builder.setLargeIcon(mLargeIcon); |
134 for (Action action : mActions) { | 135 for (Action action : mActions) { |
135 builder.addAction(action); | 136 builder.addAction(action); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, value, di
splayMetrics)); | 271 TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, value, di
splayMetrics)); |
271 } | 272 } |
272 | 273 |
273 /** | 274 /** |
274 * Whether to use the Material look and feel or fall back to Holo. | 275 * Whether to use the Material look and feel or fall back to Holo. |
275 */ | 276 */ |
276 private static boolean useMaterial() { | 277 private static boolean useMaterial() { |
277 return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP; | 278 return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP; |
278 } | 279 } |
279 } | 280 } |
OLD | NEW |