本文整理汇总了Java中android.app.Notification.VISIBILITY_PUBLIC属性的典型用法代码示例。如果您正苦于以下问题:Java Notification.VISIBILITY_PUBLIC属性的具体用法?Java Notification.VISIBILITY_PUBLIC怎么用?Java Notification.VISIBILITY_PUBLIC使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.app.Notification
的用法示例。
在下文中一共展示了Notification.VISIBILITY_PUBLIC属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: NotificationChannelData
NotificationChannelData(Map<String, Object> channel) {
id = (String) channel.get("id");
name = (String) channel.get("name");
description = (String) channel.get("description");
groupId = (String) channel.get("groupId");
importance = (int) CollectionUtil.getOrDefault(channel, "importance",
importance);
enableLights = (boolean) CollectionUtil.getOrDefault(channel, "enable_lights", enableLights);
lightColor = (int) CollectionUtil.getOrDefault(channel, "light_color", lightColor);
enableVibration = (boolean) CollectionUtil.getOrDefault(channel, "enable_vibration",
enableVibration);
lockscreenVisibility = (int) CollectionUtil.getOrDefault(channel, "lockscreen_visibility",
lockscreenVisibility);
bypassDnd = (boolean) CollectionUtil.getOrDefault(channel, "bypass_dnd", bypassDnd);
showBadge = (boolean) CollectionUtil.getOrDefault(channel, "show_badge", showBadge);
try {
List<Number> pattern = CollectionUtil.uncheckedCast(
CollectionUtil.getOrDefault(channel, "vibration_pattern", null));
if (pattern != null) {
vibrationPattern = new long[pattern.size()];
Iterator<Number> iterator = pattern.iterator();
for (int i = 0; i < vibrationPattern.length; i++) {
Number next = iterator.next();
if (next != null) {
vibrationPattern[i] = next.longValue();
}
}
}
} catch (Exception e) {
Log.w("Failed to parse vibration pattern.");
}
// Sanity checks.
if (importance < NotificationManager.IMPORTANCE_NONE &&
importance > NotificationManager.IMPORTANCE_MAX) {
importance = NotificationManager.IMPORTANCE_DEFAULT;
}
if (lockscreenVisibility < Notification.VISIBILITY_SECRET &&
lockscreenVisibility > Notification.VISIBILITY_PUBLIC) {
lockscreenVisibility = Notification.VISIBILITY_PUBLIC;
}
}