//Refresh
        private void SwipeRefreshLayoutOnRefresh(object sender, EventArgs e)
        {
            try
            {
                MAdapter.FundingList.Clear();
                MAdapter.NotifyDataSetChanged();

                MainScrollEvent.IsLoading = false;

                if (Methods.CheckConnectivity())
                {
                    PollyController.RunRetryPolicyFunction(new List <Func <Task> > {
                        () => ContextFunding.GetMyFunding()
                    });
                }
                else
                {
                    Toast.MakeText(Context, Context.GetText(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Long)?.Show();
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
        private void SetData()
        {
            try
            {
                if (ListUtils.FundingList.Count > 0)
                {
                    MAdapter.FundingList = ListUtils.FundingList;
                    MAdapter.NotifyDataSetChanged();
                }

                if (MAdapter.ItemCount > 0)
                {
                    MRecycler.Visibility        = ViewStates.Visible;
                    EmptyStateLayout.Visibility = ViewStates.Gone;
                }

                SwipeRefreshLayout.Refreshing = false;
                SwipeRefreshLayout.Enabled    = false;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));

                string offset = MAdapter.FundingList.LastOrDefault()?.Id.ToString() ?? "0";

                StartApiService(offset);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                SwipeRefreshLayout.Refreshing = false;
                SwipeRefreshLayout.Enabled    = false;
                SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7"));
            }
        }
        //Refresh
        private void SwipeRefreshLayoutOnRefresh(object sender, EventArgs e)
        {
            try
            {
                MAdapter.FundingList.Clear();
                MAdapter.NotifyDataSetChanged();

                MainScrollEvent.IsLoading = false;

                StartApiService();
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
Пример #4
0
 public void RefreshData()
 {
     FundingAdapters.NotifyDataSetChanged();
 }