diff options
author | Seungha Son <seungha.son@samsung.com> | 2017-05-19 08:40:53 +0900 |
---|---|---|
committer | Seungha Son <seungha.son@samsung.com> | 2017-05-23 13:25:38 +0900 |
commit | d89f16c0f373d0c3f2a589e67045e70b892adf17 (patch) | |
tree | 04dfd31ece8b6802fd10c335750671a798d54856 | |
parent | 1968080e64415edfbb1b1d2245ab39dc2f98c3ff (diff) | |
download | application-d89f16c0f373d0c3f2a589e67045e70b892adf17.tar.gz application-d89f16c0f373d0c3f2a589e67045e70b892adf17.tar.bz2 application-d89f16c0f373d0c3f2a589e67045e70b892adf17.zip |
Fix binding NotificationDisplayAppList in Indicatory style
Signed-off-by: Seungha Son <seungha.son@samsung.com>
Change-Id: Ia8ed3b1814fe67cb51ed30f2d661704360da6197
2 files changed, 18 insertions, 11 deletions
diff --git a/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationStyleBinder.cs b/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationStyleBinder.cs index 8c5014b..b7eee0d 100755 --- a/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationStyleBinder.cs +++ b/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationStyleBinder.cs @@ -25,28 +25,35 @@ namespace Tizen.Applications.Notifications int flag; NotificationError ret = NotificationError.None; Notification.IndicatorStyle style = (Notification.IndicatorStyle)notification.GetStyle("Indicator"); + Interop.Notification.GetApplist(notification.Handle, out flag); - ret = Interop.Notification.SetText(notification.Handle, NotificationText.FirstMainText, style.SubText, null, -1); - if (ret != NotificationError.None) + if (string.IsNullOrEmpty(style.SubText) == false) { - throw NotificationErrorFactory.GetException(ret, "unable to set indicator text"); + ret = Interop.Notification.SetText(notification.Handle, NotificationText.FirstMainText, style.SubText, null, -1); + if (ret != NotificationError.None) + { + throw NotificationErrorFactory.GetException(ret, "unable to set indicator text"); + } + flag |= (int)NotificationDisplayApplist.Ticker; } - ret = Interop.Notification.SetImage(notification.Handle, NotificationImage.IconForIndicator, style.IconPath); - if (ret != NotificationError.None) + if (string.IsNullOrEmpty(style.IconPath) == false) { - throw NotificationErrorFactory.GetException(ret, "unable to set indicator image"); + ret = Interop.Notification.SetImage(notification.Handle, NotificationImage.IconForIndicator, style.IconPath); + if (ret != NotificationError.None) + { + throw NotificationErrorFactory.GetException(ret, "unable to set indicator image"); + } + flag |= (int)NotificationDisplayApplist.Indicator; } - - Interop.Notification.GetApplist(notification.Handle, out flag); - Interop.Notification.SetApplist(notification.Handle, flag | (int)NotificationDisplayApplist.Indicator | (int)NotificationDisplayApplist.Ticker); + Interop.Notification.SetApplist(notification.Handle, flag); } internal static void BindSafeHandle(Notification notification) { int appList; Interop.Notification.GetApplist(notification.Handle, out appList); - if ((appList & ((int)NotificationDisplayApplist.Ticker | (int)NotificationDisplayApplist.Indicator)) != 0) + if ((appList & (int)NotificationDisplayApplist.Ticker) != 0 || (appList & (int)NotificationDisplayApplist.Indicator) != 0) { string path, text; Notification.IndicatorStyle indicator = new Notification.IndicatorStyle(); diff --git a/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationStyleArgsBinder.cs b/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationStyleArgsBinder.cs index fb94bec..d897dcf 100755 --- a/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationStyleArgsBinder.cs +++ b/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationStyleArgsBinder.cs @@ -64,7 +64,7 @@ namespace Tizen.Applications.NotificationEventListener lockStyle.Thumbnail = path; } - if ((styleList & ((int)NotificatioDisplayApplist.Ticker | (int)NotificatioDisplayApplist.Indicator)) != 0) + if ((styleList & (int)NotificatioDisplayApplist.Ticker) != 0 || (styleList & (int)NotificatioDisplayApplist.Indicator) != 0) { NotificationEventArgs.IndicatorStyleArgs indicatorStyle = new NotificationEventArgs.IndicatorStyleArgs(); eventargs.Style.Add(indicatorStyle.Key, indicatorStyle); |