Пример #1
0
        private void RetrieveNotificationFromStatusBar()
        {
            statusBarNotifications = new List <StatusBarNotification>();
            foreach (var notification in GetActiveNotifications()?.ToList())
            {
                //var test6 = notification.Notification.Extras.Get(Notification.ExtraMediaSession) as MediaSession.Token;

                //if (test6 != null)
                //{
                //    MediaController mediaController = new MediaController(this, test6);

                //    mediaController.RegisterCallback(MusicController.GetInstance());
                //}

                if ((notification.IsOngoing == false || notification.Notification.Flags.HasFlag(NotificationFlags.NoClear)) && notification.IsClearable == true)
                {
                    statusBarNotifications.Add(notification);
                    //var test1 = notification.Notification.Extras.GetString(Notification.ExtraTemplate);
                    //var test2 = notification.Notification.Extras;
                    //var test3 = notification.Notification.Flags;
                    //var test4 = notification.Notification.Extras.GetCharSequence(Notification.ExtraSummaryText);
                    //var test5 = notification.Notification.Extras.GetCharSequenceArray(Notification.ExtraTextLines);
                    //GetRemoteInput(notification);
                }
            }

            catcherHelper = new CatcherHelper(statusBarNotifications);
        }
Пример #2
0
        private void RetrieveNotificationFromStatusBar()
        {
            statusBarNotifications = new List <StatusBarNotification>();
            foreach (var notification in GetActiveNotifications()?.ToList())
            {
                //var test6 = notification.Notification.Extras.Get(Notification.ExtraMediaSession) as MediaSession.Token;

                //if (test6 != null)
                //{
                //    MediaController mediaController = new MediaController(this, test6);

                //    mediaController.RegisterCallback(MusicController.GetInstance());
                //}

                //var test1 = notification.Notification.Extras.GetString(Notification.ExtraTemplate);
                //var test2 = notification.Notification.Extras;
                //var test3 = notification.Notification.Flags;
                //var test4 = notification.Notification.Extras.GetCharSequence(Notification.ExtraSummaryText);
                //var test5 = notification.Notification.Extras.GetCharSequenceArray(Notification.ExtraTextLines);
                //var test6 = notification.Notification.Extras.Get("android.wearable.EXTENSIONS");
                //var test7 = notification.Notification.Extras.KeySet();
                //var test8 = notification.Notification.Extras.Get("android.people.list");
                //var test10= notification.Notification.Extras.Get("android.messagingUser");
                //var test11= notification.Notification.Extras.Get("android.messagingStyleUser");
                //var test12= notification.Notification.Extras.Get("android.messages");
                //var test13 = notification.Notification.Extras.GetParcelableArray("android.messages");
                //if(test13 != null)
                //foreach (Bundle item in test13)
                //{
                //    var test14 = item.KeySet();
                //    var moreExtras = item.Get("extras");
                //    var sender_person = item.Get("sender_person");
                //    var sender = item.Get("sender");
                //    var text = item.Get("text");
                //    var time = item.Get("time");
                //        var uri = item.Get("uri");
                //        var type = item.Get("type");
                //}


                if (notification.Notification.Flags.HasFlag(NotificationFlags.GroupSummary) == false) //Don't grab summary notifications yet. hotfix.
                {
                    statusBarNotifications.Add(notification);
                    lastPostedNotification = notification;
                }
            }

            catcherHelper = new CatcherHelper(statusBarNotifications);
        }
Пример #3
0
        private void RetrieveNotificationFromStatusBar()
        {
            statusBarNotifications = new List <StatusBarNotification>();
            foreach (var notification in GetActiveNotifications().ToList())
            {
                if ((notification.IsOngoing == false || notification.Notification.Flags.HasFlag(NotificationFlags.NoClear)) && notification.IsClearable == true)
                {
                    statusBarNotifications.Add(notification);

                    //GetRemoteInput(notification);
                }
            }

            catcherHelper = new CatcherHelper(statusBarNotifications);
        }
Пример #4
0
 private void WidgetStatusPublisher_OnWidgetStatusChanged(object sender, WidgetStatusEventArgs e)
 {
     if (e.WidgetName == "MusicFragment")
     {
         if (e.Show == true)
         {
             if (maincontainer != null)
             {
                 maincontainer.Visibility = ViewStates.Invisible;
             }
         }
     }
     if (e.WidgetName == "NotificationFragment" && e.WidgetAskingForShowing == "MusicFragment" && e.AdditionalInfo != null)
     {
         ShowNotification(CatcherHelper.GetOpenNotification((string)e.AdditionalInfo));
     }
 }
Пример #5
0
 private void BtnLaunchNotification_Click(object sender, EventArgs e)
 {
     if (configurationManager.RetrieveAValue(ConfigurationParameters.LaunchNotification))
     {
         KeyguardHelper.RequestDismissKeyguard(Activity);
         CatcherHelper.GetOpenNotification(openNotificationId)?.ClickNotification();
     }
     else
     {
         if (MusicController.MediaSessionAssociatedWThisNotification(openNotificationId))
         {
             WidgetStatusPublisher.RequestShow(new WidgetStatusEventArgs
             {
                 Active                 = false,
                 Show                   = true,
                 WidgetName             = "NotificationFragment",
                 WidgetAskingForShowing = "MusicFragment",
                 AdditionalInfo         = openNotificationId
             });
         }
     }
 }