コード例 #1
0
 private void AlertFinishRoutine()
 {
     DependencyService.Get <MessageBoxService>().ShowAlert(
         $"{Routine.Name} 루틴 완료!",
         $"총 소요 시간 : {CreateTimeToString.TakenTimeToString(ElapsedTime)}",
         async() =>
     {
         await CloseAllNavigationPage();
         DependencyService.Get <INotifySetter>().CancelFinishHabitNotify();
     });
 }
コード例 #2
0
 private void AskIfYouWantStart()
 {
     DependencyService.Get <MessageBoxService>().ShowConfirm(
         $"{Routine.Name} 루틴 시작",
         $"예상 소요 시간 {CreateTimeToString.TakenTimeToString(Routine.TotalTime)}",
         async() =>
     {
         await PopRoutineActionPage();
     },
         () =>
     {
         IsCounting = true;
     });
 }
コード例 #3
0
        private Notification CreateForNotifyFinishHabit(Routine routine, TimeSpan ElapsedTime)
        {
            var    context = Application.Context;
            string title   = $"{routine.Name} 완료";
            string message = $"{CreateTimeToString.TakenTimeToString(ElapsedTime)} 경과";

            var notificationBuilder = new NotificationCompat.Builder(context, NOTIFICATION_CHANNEL_ID);
            var notification        = notificationBuilder.SetOngoing(false)
                                      .SetSmallIcon(Resource.Drawable.ic_miracle_routine_mini)
                                      .SetContentTitle(title)
                                      .SetContentText(message)
                                      .SetPriority((int)NotificationImportance.High)
                                      .SetVisibility(NotificationCompat.VisibilityPublic)
                                      .SetVibrate(vibrationPattern)
                                      .SetContentIntent(OpenAppIntent())
                                      .SetAutoCancel(true)
                                      .Build();

            return(notification);
        }