Fix wrong input parameter
authorMyungki Lee <mk5004.lee@samsung.com>
Fri, 19 May 2017 01:34:07 +0000 (10:34 +0900)
committerSon seungha <seungha.son@samsung.com>
Tue, 23 May 2017 02:41:02 +0000 (02:41 +0000)
 ProgressCategory.PendingBar is same to Percent in native capi.
 There is no pendingbar in capi enum value, binding the pendingbar to
 native api is an error

Signed-off-by: Seungha Son <seungha.son@samsung.com>
Change-Id: Ia8fc6cb1d370cf5de9067a8fe5eb037e63a76182

src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationProgressBinder.cs
src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationProgressArgsBinder.cs

index adc0ab4..6afd5c5 100755 (executable)
@@ -23,20 +23,22 @@ namespace Tizen.Applications.Notifications
             double current, max;
 
             Notification.ProgressType progress = notification.Progress;
-            Interop.Notification.SetProgressType(notification.Handle, progress.Category);
 
             if (progress.Category == ProgressCategory.PendingBar)
             {
+                Interop.Notification.SetProgressType(notification.Handle, ProgressCategory.Percent);
                 current = 0;
                 max = 0;
             }
             else if (progress.Category == ProgressCategory.Percent)
             {
+                Interop.Notification.SetProgressType(notification.Handle, progress.Category);
                 current = progress.ProgressCurrent / 100;
                 max = progress.ProgressMax;
             }
             else
             {
+                Interop.Notification.SetProgressType(notification.Handle, progress.Category);
                 current = progress.ProgressCurrent;
                 max = progress.ProgressMax;
             }
@@ -70,4 +72,4 @@ namespace Tizen.Applications.Notifications
             }
         }
     }
-}
\ No newline at end of file
+}
index 2eca359..8611503 100755 (executable)
@@ -35,6 +35,9 @@ namespace Tizen.Applications.NotificationEventListener
                 if (category == ProgressCategory.Percent)
                 {
                     current *= 100;
+
+                    if (current == 0 && max == 0)
+                        category = ProgressCategory.PendingBar;
                 }
 
                 eventargs.Progress = new NotificationEventArgs.ProgressArgs();
@@ -44,4 +47,4 @@ namespace Tizen.Applications.NotificationEventListener
             }
         }
     }
-}
\ No newline at end of file
+}