Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilder.java

Issue 2826223002: Hide Chrome actions in notifications shown for WebAPKs (Closed)
Patch Set: Update CustomNotificationBuilder. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 } 225 }
226 226
227 view.setTextViewText(R.id.button, action.title); 227 view.setTextViewText(R.id.button, action.title);
228 view.setOnClickPendingIntent(R.id.button, action.intent); 228 view.setOnClickPendingIntent(R.id.button, action.intent);
229 bigView.addView(R.id.buttons, view); 229 bigView.addView(R.id.buttons, view);
230 } 230 }
231 } 231 }
232 232
233 private void configureSettingsButton(RemoteViews bigView) { 233 private void configureSettingsButton(RemoteViews bigView) {
234 if (mSettingsAction == null) { 234 if (mSettingsAction == null) {
235 bigView.setViewVisibility(R.id.origin_settings_icon, View.GONE);
236 int padding =
237 dpToPx(BUTTON_ICON_PADDING_DP, mContext.getResources().getDi splayMetrics());
238 bigView.setViewPadding(R.id.origin, padding, 0, padding, 0);
Peter Beverloo 2017/04/20 19:08:29 Hmmm could you make a screenshot of what you see?
Xi Han 2017/04/20 20:14:20 Change the padding to 0, 0, 8, 0. Only leave the p
235 return; 239 return;
236 } 240 }
237 bigView.setOnClickPendingIntent(R.id.origin, mSettingsAction.intent); 241 bigView.setOnClickPendingIntent(R.id.origin, mSettingsAction.intent);
238 if (useMaterial()) { 242 if (useMaterial()) {
239 bigView.setInt(R.id.origin_settings_icon, "setColorFilter", BUTTON_I CON_COLOR_MATERIAL); 243 bigView.setInt(R.id.origin_settings_icon, "setColorFilter", BUTTON_I CON_COLOR_MATERIAL);
240 } 244 }
241 } 245 }
242 246
243 /** 247 /**
244 * Shows the work profile badge if it is needed. 248 * Shows the work profile badge if it is needed.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 } 321 }
318 322
319 /** 323 /**
320 * Whether to use the Material look and feel or fall back to Holo. 324 * Whether to use the Material look and feel or fall back to Holo.
321 */ 325 */
322 @VisibleForTesting 326 @VisibleForTesting
323 static boolean useMaterial() { 327 static boolean useMaterial() {
324 return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP; 328 return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
325 } 329 }
326 } 330 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698