// Function
 public void Add(Classes.UserContacts.User userFollower)
 {
     try
     {
         var check = mMyContactsList.FirstOrDefault(a => a.user_id == userFollower.user_id);
         if (check == null)
         {
             mMyContactsList.Add(userFollower);
             NotifyItemInserted(mMyContactsList.IndexOf(mMyContactsList.Last()));
         }
     }
     catch (Exception exception)
     {
         Crashes.TrackError(exception);
     }
 }
        private void ReloadData(int startId)
        {
            m_AllTasks.Clear();
            foreach (var task in DataManager.GetClearedTasks(SortOption.Newest))
            {
                m_AllTasks.Add(task);
            }


            RunOnUiThread(() =>
            {
                ListAdapter = new ClearedTaskAdapter(this, m_AllTasks);
                if (ListView.Visibility == ViewStates.Gone)
                {
                    ListView.Visibility = ViewStates.Visible;
                    ListView.StartAnimation(AnimationUtils.LoadAnimation(this, Resource.Animation.fadein));
                }
            });

            if (startId == 0)
            {
                return;
            }

            var firstTask = m_AllTasks.FirstOrDefault(t => t.ID == startId);

            if (firstTask == null)
            {
                return;
            }

            var itemIndex = m_AllTasks.IndexOf(firstTask);

            RunOnUiThread(() => ListView.SetSelection(itemIndex));
        }
 // Function
 public void Add(Get_User_Data_Object.Followers item)
 {
     try
     {
         var check = mMyFollowersList.FirstOrDefault(a => a.user_id == item.user_id);
         if (check == null)
         {
             mMyFollowersList.Add(item);
             NotifyItemInserted(mMyFollowersList.IndexOf(mMyFollowersList.Last()));
         }
     }
     catch (Exception exception)
     {
         Crashes.TrackError(exception);
     }
 }
        private void ReloadData(int startId)
        {
            m_AllTasks.Clear();
            foreach (var task in DataManager.GetTasks(Settings.SortBy))
            {
                m_AllTasks.Add(task);
            }


#if DEBUG
            if (m_AllTasks.Count == 0)
            {
                m_AllTasks = new JavaList <TaskModel>();
                foreach (var item in m_FakeData)
                {
                    var task = new TaskModel {
                        Task = item
                    };
                    task.ID = DataManager.SaveTask(task);
                    m_AllTasks.Add(task);
                }
            }
#endif
            RunOnUiThread(() =>
            {
                ListAdapter = new TaskAdapter(this, m_AllTasks);
                if (ListView.Visibility == ViewStates.Gone)
                {
                    ListView.Visibility = ViewStates.Visible;
                    ListView.StartAnimation(AnimationUtils.LoadAnimation(this, Resource.Animation.fadein));
                }
            });


            SetChecks();

            SetActionBar();

            if (startId == 0)
            {
                return;
            }

            var firstTask = m_AllTasks.FirstOrDefault(t => t.ID == startId);
            if (firstTask == null)
            {
                return;
            }

            var itemIndex = m_AllTasks.IndexOf(firstTask);
            RunOnUiThread(() => ListView.SetSelection(itemIndex));
        }
Beispiel #5
0
 // Function
 public void Add(Classes.UserContacts.User userFollower)
 {
     try
     {
         var check = mMyContactsList.FirstOrDefault(a => a.UserId == userFollower.UserId);
         if (check == null)
         {
             mMyContactsList.Add(userFollower);
             NotifyItemInserted(mMyContactsList.IndexOf(mMyContactsList.Last()));
         }
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
     }
 }