Example #1
0
        public override void OnNotificationRemoved(StatusBarNotification sbn)
        {
            int indice = listaNotificaciones.IndexOf(listaNotificaciones.FirstOrDefault(o => o.Id == sbn.Id));

            if (indice >= 0)
            {
                listaNotificaciones.RemoveAt(indice);
            }
            if (adapter != null && LockScreenActivity.lockScreenInstance != null)
            {
                LockScreenActivity.lockScreenInstance.RunOnUiThread(() => adapter.NotifyItemRemoved(indice));
                Log.Info("Remoción, tamaño lista:  ", listaNotificaciones.Count.ToString());
            }
        }
Example #2
0
        public void OnNotificationRemoved(StatusBarNotification sbn)
        {
            int position = GetNotificationPosition(sbn);

            if (position >= 0)
            {
                statusBarNotifications.RemoveAt(position);
                using (var h = new Handler(Looper.MainLooper))
                    h.Post(() => { notificationAdapter.NotifyItemRemoved(position); });
            }

            if (statusBarNotifications.Count == 0)
            {
                OnNotificationListSizeChanged(new NotificationListSizeChangedEventArgs
                {
                    ThereAreNotifications = false
                });
                thereAreNotifications = false;
            }
        }