Exemplo n.º 1
0
        private void SetRecyclerViewAdapters()
        {
            try
            {
                MAdapter = new MoviesCommentAdapter(Activity, MRecycler, "Light", GlobalContext.MoviesId, "Comment")
                {
                    CommentList = new ObservableCollection <CommentsMoviesObject>()
                };

                if (!Methods.CheckConnectivity())
                {
                    Toast.MakeText(Activity, Activity.GetString(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short).Show();
                }
                else
                {
                    PollyController.RunRetryPolicyFunction(new List <Func <Task> > {
                        () => MAdapter.FetchMoviesApiComments(GlobalContext.MoviesId, "0")
                    });
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Exemplo n.º 2
0
        private void SwipeRefreshLayoutOnRefresh(object sender, EventArgs e)
        {
            try
            {
                MAdapter.CommentList.Clear();
                MAdapter.NotifyDataSetChanged();

                if (!Methods.CheckConnectivity())
                {
                    Toast.MakeText(Activity, Activity.GetString(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short).Show();
                }
                else
                {
                    PollyController.RunRetryPolicyFunction(new List <Func <Task> > {
                        () => MAdapter.FetchMoviesApiComments(GlobalContext.MoviesId, "0")
                    });
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }