// 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)); }
// 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); } }
public void OnPageSelected(int position) { try { if (position >= 0) { Page_position = position; if (position == 0) // News_Feed_Tab { if (Settings.Show_ADMOB_Native) { MyBottomSheetCallBack.Ad_BottomSheet(News_Feed_Tab.FragmentManager); } } else if (position == 1) // Notifications_Tab { var dataTab = Models.FirstOrDefault(a => a.Title == GetText(Resource.String.Lbl_Notifcations)); dataTab?.HideBadge(); if (News_Feed_Fragment.Is_RunApi) { Notifications_Tab.Get_GeneralData_Api(false).ConfigureAwait(false); } if (News_Feed_Tab.swipeRefreshLayout.Refreshing) { News_Feed_Tab.swipeRefreshLayout.Refreshing = false; } if (Settings.Show_ADMOB_Native) { MyBottomSheetCallBack.Ad_BottomSheet(Notifications_Tab.FragmentManager); } } else if (position == 2) // Trending_Tab { var dataTab = Models.FirstOrDefault(a => a.Title == GetText(Resource.String.Lbl_Trending)); dataTab?.HideBadge(); ProUsersAdapter.NotifyDataSetChanged(); if (Settings.Show_LastActivities) { Task.Run(() => { Trending_Tab.Get_Activities(); }); } if (Settings.Show_ADMOB_Native) { MyBottomSheetCallBack.Ad_BottomSheet(Trending_Tab.FragmentManager); } } else if (position == 3) // More_Tab { if (Settings.Show_ADMOB_Native) { MyBottomSheetCallBack.Ad_BottomSheet(More_Tab.FragmentManager); } } else { } } } catch (Exception exception) { Crashes.TrackError(exception); } }
private void NavigationTabBarOnStartTabSelected(object sender, NavigationTabBar.StartTabSelectedEventArgs e) { try { switch (e.P1) { case 0: PageNumber = 0; ShowFragment0(); Context?.TracksCounter?.CheckTracksCounter(); break; case 1: if (AppSettings.ShowTrending) { PageNumber = 1; ShowFragment1(); Context?.TracksCounter?.CheckTracksCounter(); AdsGoogle.Ad_Interstitial(Context); } else { PageNumber = 2; NavigationTabBar.Model tabNotifications = Models.FirstOrDefault(a => a.Title == Context.GetText(Resource.String.Lbl_Notifications)); tabNotifications?.HideBadge(); ShowFragment2(); Context?.TracksCounter?.CheckTracksCounter(); AdsGoogle.Ad_RewardedVideo(Context); } break; case 2: PageNumber = 2; if (AppSettings.ShowTrending) { NavigationTabBar.Model tabNotifications = Models.FirstOrDefault(a => a.Title == Context.GetText(Resource.String.Lbl_Notifications)); tabNotifications?.HideBadge(); ShowFragment2(); Context?.TracksCounter?.CheckTracksCounter(); AdsGoogle.Ad_Interstitial(Context); } else { PageNumber = 3; NavigationTabBar.Model tabMessages = Models.FirstOrDefault(a => a.Title == Context.GetText(Resource.String.Lbl_messages)); tabMessages?.HideBadge(); Context.ShowChat(); } break; case 3: if (AppSettings.ShowTrending) { PageNumber = 3; NavigationTabBar.Model tabMessages = Models.FirstOrDefault(a => a.Title == Context.GetText(Resource.String.Lbl_messages)); tabMessages?.HideBadge(); Context.ShowChat(); } else { PageNumber = 4; ShowFragment4(); } break; case 4: PageNumber = 4; ShowFragment4(); break; default: PageNumber = 0; ShowFragment0(); break; } } catch (Exception exception) { Console.WriteLine(exception); } }
public void NavigationTabBarOnStartTabSelected(object sender, NavigationTabBar.StartTabSelectedEventArgs e) { try { switch (e.P1) { case 0: PageNumber = 0; ShowFragment0(); AdsGoogle.Ad_Interstitial(Context); break; case 1: PageNumber = 1; ShowFragment1(); AdsGoogle.Ad_Interstitial(Context); break; case 2: PageNumber = 2; Context.RunOnUiThread(() => { try { if (!Context.CircleMenu.IsOpened) { Context.CircleMenu.Visibility = ViewStates.Visible; Context.CircleMenu.OpenMenu(); } else { Context.CircleMenu.CloseMenu(); Context.CircleMenu.Visibility = ViewStates.Gone; } } catch (Exception exception) { Console.WriteLine(exception); } }); break; case 3: PageNumber = 3; var dataTab = Models.FirstOrDefault(a => a.Title == Context.GetText(Resource.String.Lbl_Notifications)); dataTab?.HideBadge(); ShowFragment3(); AdsGoogle.Ad_RewardedVideo(Context); break; case 4: PageNumber = 4; ShowFragment4(); AdsGoogle.Ad_RewardedVideo(Context); break; default: PageNumber = 0; ShowFragment0(); break; } } catch (Exception exception) { Console.WriteLine(exception); } }