public NotificationMessageDescription(I18NString Title, I18NString Description, NotificationVisibility Visibility, IEnumerable <NotificationTag> Tags, IEnumerable <NotificationMessageType> Messages) { #region Initial checks if (Title.IsNullOrEmpty()) { throw new ArgumentNullException(nameof(Title), "The given multi-language headline string must not be null or empty!"); } if (Description.IsNullOrEmpty()) { throw new ArgumentNullException(nameof(Description), "The given multi-language description string must not be null or empty!"); } if (Messages.IsNullOrEmpty()) { throw new ArgumentNullException(nameof(Messages), "The given enumeration of notification messages must not be null or empty!"); } #endregion this.Title = Title; this.Description = Description; this.Visibility = Visibility; this.Tags = Tags ?? new NotificationTag[0]; this.Messages = Messages; }
// Creates a new notification with a different visibility level. public Notification CreateNotification(NotificationVisibility visibility) { var builder = new Notification.Builder(Activity) .SetContentTitle("Notification for Visibility metadata"); builder.SetVisibility(visibility); builder.SetContentText(string.Format("Visibility : {0}", NotificationVisibilities.GetDescription(visibility))); builder.SetSmallIcon(NotificationVisibilities.GetNotificationIconId(visibility)); return(builder.Build()); }
// Creates a new notification with a different visibility level. public Notification CreateNotification(NotificationVisibility visibility) { var builder = new Notification.Builder (Activity) .SetContentTitle ("Notification for Visibility metadata"); builder.SetVisibility (visibility); builder.SetContentText (string.Format ("Visibility : {0}", NotificationVisibilities.GetDescription(visibility))); builder.SetSmallIcon (NotificationVisibilities.GetNotificationIconId (visibility)); return builder.Build (); }
public AndroidBackgroundServiceHostBuilder WithNotification(string channelId, string channelName, NotificationImportance notificationImportance, NotificationVisibility notificationVisibility, int icon, string title, string content) { ChannelId = channelId; ChannelName = channelName; NotificationImportance = notificationImportance; NotificationVisibility = notificationVisibility; Icon = icon; Title = title; Content = content; return(this); }
public NotificationMessageDescription(I18NString Title, I18NString Description, NotificationVisibility Visibility, NotificationMessageType Message) : this(Title, Description, Visibility, new NotificationTag[0], new NotificationMessageType[] { Message }) { }
public NotificationMessageDescription(I18NString Title, I18NString Description, NotificationVisibility Visibility, IEnumerable <NotificationTag> Tags, NotificationMessageType Message) : this(Title, Description, Visibility, Tags, new NotificationMessageType[] { Message }) { }
public static int GetNotificationIconId(NotificationVisibility val) { switch (val) { case NotificationVisibility.Public: return(Resource.Drawable.ic_public_notification); case NotificationVisibility.Private: return(Resource.Drawable.ic_private_notification); case NotificationVisibility.Secret: return(Resource.Drawable.ic_secret_notification); default: return(Resource.Drawable.ic_public_notification); } }
public NotificationGroup(NotificationGroup_Id Id, I18NString Title, I18NString Description, NotificationVisibility Visibility, IEnumerable <NotificationMessageDescription> Notifications) { #region Initial checks if (Id.IsNullOrEmpty) { throw new ArgumentNullException(nameof(Id), "The given notification group identification must not be null or empty!"); } if (Title.IsNullOrEmpty()) { throw new ArgumentNullException(nameof(Title), "The given multi-language headline string must not be null or empty!"); } if (Description == null) { throw new ArgumentNullException(nameof(Description), "The given multi-language description string must not be null or empty!"); } if (Notifications.IsNullOrEmpty()) { throw new ArgumentNullException(nameof(Notifications), "The given enumeration of notifications must not be null or empty!"); } #endregion this.Id = Id; this.Title = Title; this.Description = Description; this.Visibility = Visibility; this.notifications = Notifications != null ? new List <NotificationMessageDescription>(Notifications) : new List <NotificationMessageDescription>(); }
public void ShowNotificationClicked(NotificationVisibility v) { incrementalNotificationId++; notificationManager.Notify(incrementalNotificationId, CreateNotification(v)); Toast.MakeText(Activity, "Show Notification clicked", ToastLength.Short).Show(); }
public static string GetDescription(NotificationVisibility val) { return(val.ToString()); }
public static int GetVisibility(NotificationVisibility val) { return((int)val); }
/// <summary> /// Sets, whether or not notifications posted to this channel are shown on the lock Screen in full or redacted form. /// </summary> public NotificationChannelRequestBuilder WithLockScreenVisibility(NotificationVisibility lockScreenVisibility) { _channelRequest.LockScreenVisibility = lockScreenVisibility; return(this); }
public void ShowNotificationClicked(NotificationVisibility v) { incrementalNotificationId++; notificationManager.Notify (incrementalNotificationId, CreateNotification (v)); Toast.MakeText (Activity, "Show Notification clicked", ToastLength.Short).Show (); }
public static int GetNotificationIconId(NotificationVisibility val) { switch (val) { case NotificationVisibility.Public: return Resource.Drawable.ic_public_notification; case NotificationVisibility.Private: return Resource.Drawable.ic_private_notification; case NotificationVisibility.Secret: return Resource.Drawable.ic_secret_notification; default: return Resource.Drawable.ic_public_notification; } }
public static string GetDescription(NotificationVisibility val) { return val.ToString(); }
public static int GetVisibility(NotificationVisibility val) { return (int)val; }