當前位置: 首頁>>代碼示例>>Java>>正文


Java NotificationManagerProxy類代碼示例

本文整理匯總了Java中org.chromium.chrome.browser.notifications.NotificationManagerProxy的典型用法代碼示例。如果您正苦於以下問題:Java NotificationManagerProxy類的具體用法?Java NotificationManagerProxy怎麽用?Java NotificationManagerProxy使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


NotificationManagerProxy類屬於org.chromium.chrome.browser.notifications包,在下文中一共展示了NotificationManagerProxy類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createBroadcastNotification

import org.chromium.chrome.browser.notifications.NotificationManagerProxy; //導入依賴的package包/類
/**
 * Surfaces a notification to the user that the Physical Web is broadcasting.
 * The notification specifies the URL that is being broadcast. It cannot be swiped away,
 * but broadcasting can be terminated with the stop button on the notification.
 */
private void createBroadcastNotification(String displayUrl) {
    Context context = getApplicationContext();
    PendingIntent stopPendingIntent = PendingIntent.getBroadcast(
            context, 0, new Intent(STOP_SERVICE), PendingIntent.FLAG_UPDATE_CURRENT);
    NotificationManagerProxy notificationManager = new NotificationManagerProxyImpl(
            (NotificationManager) getSystemService(NOTIFICATION_SERVICE));
    ChromeNotificationBuilder notificationBuilder =
            NotificationBuilderFactory
                    .createChromeNotificationBuilder(
                            true /* preferCompat */, ChannelDefinitions.CHANNEL_ID_BROWSER)
                    .setSmallIcon(R.drawable.ic_image_white_24dp)
                    .setContentTitle(getString(R.string.physical_web_broadcast_notification))
                    .setContentText(displayUrl)
                    .setOngoing(true)
                    .addAction(android.R.drawable.ic_menu_close_clear_cancel,
                            getString(R.string.physical_web_stop_broadcast), stopPendingIntent);
    notificationManager.notify(
            NotificationConstants.NOTIFICATION_ID_PHYSICAL_WEB, notificationBuilder.build());
    NotificationUmaTracker.getInstance().onNotificationShown(
            NotificationUmaTracker.PHYSICAL_WEB, ChannelDefinitions.CHANNEL_ID_BROWSER);
}
 
開發者ID:mogoweb,項目名稱:365browser,代碼行數:27,代碼來源:PhysicalWebBroadcastService.java

示例2: overrideNotificationManagerForTesting

import org.chromium.chrome.browser.notifications.NotificationManagerProxy; //導入依賴的package包/類
@VisibleForTesting
void overrideNotificationManagerForTesting(
        NotificationManagerProxy notificationManager) {
    mNotificationManager = notificationManager;
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:6,代碼來源:UrlManager.java

示例3: ChannelsInitializer

import org.chromium.chrome.browser.notifications.NotificationManagerProxy; //導入依賴的package包/類
public ChannelsInitializer(
        NotificationManagerProxy notificationManagerProxy, Resources resources) {
    mNotificationManager = notificationManagerProxy;
    mResources = resources;
}
 
開發者ID:mogoweb,項目名稱:365browser,代碼行數:6,代碼來源:ChannelsInitializer.java

示例4: disableUrlBroadcasting

import org.chromium.chrome.browser.notifications.NotificationManagerProxy; //導入依賴的package包/類
/** Turns off URL broadcasting. */
private void disableUrlBroadcasting() {
    NotificationManagerProxy notificationManager = new NotificationManagerProxyImpl(
            (NotificationManager) getSystemService(NOTIFICATION_SERVICE));
    notificationManager.cancel(NotificationConstants.NOTIFICATION_ID_PHYSICAL_WEB);
}
 
開發者ID:mogoweb,項目名稱:365browser,代碼行數:7,代碼來源:PhysicalWebBroadcastService.java


注:本文中的org.chromium.chrome.browser.notifications.NotificationManagerProxy類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。