Exemplo n.º 1
0
        private void DestroyBasic()
        {
            try
            {
                RewardedVideo?.Destroy();

                MAdapter      = null;
                ImageUser     = null;
                ImageBlog     = null;
                MRecycler     = null;
                TxtUsername   = null;
                TxtTime       = null;
                TxtTitle      = null;
                TxtViews      = null;
                TxtHtml       = null;
                BtnMore       = null;
                ArticleData   = null;
                MAdapter      = null;
                MRecycler     = null;
                TxtComment    = null;
                ArticlesId    = null;
                Instance      = null;
                ReplyFragment = null;
                DataWebHtml   = null;
                RewardedVideo = null;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Exemplo n.º 2
0
        private void SetRecyclerViewAdapters()
        {
            try
            {
                MAdapter = new ArticlesCommentAdapter(this, MRecycler, "Light", ArticlesId, "Comment")
                {
                    CommentList = new ObservableCollection <CommentsArticlesObject>()
                };

                if (!Methods.CheckConnectivity())
                {
                    Toast.MakeText(this, GetString(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short).Show();
                }
                else
                {
                    PollyController.RunRetryPolicyFunction(new List <Func <Task> > {
                        () => MAdapter.FetchBlogsApiComments(ArticlesId, "0")
                    });
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Exemplo n.º 3
0
        private void DestroyBasic()
        {
            try
            {
                RewardedVideo?.Destroy();

                MAdapter      = null !;
                ImageUser     = null !;
                ImageBlog     = null !;
                MRecycler     = null !;
                TxtUsername   = null !;
                TxtTime       = null !;
                TxtTitle      = null !;
                TxtViews      = null !;
                TxtHtml       = null !;
                BtnMore       = null !;
                ArticleData   = null !;
                MAdapter      = null !;
                MRecycler     = null !;
                TxtComment    = null !;
                ArticlesId    = null !;
                Instance      = null !;
                ReplyFragment = null !;
                DataWebHtml   = null !;
                RewardedVideo = null !;
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
        private void LoadCommentArticle()
        {
            try
            {
                switch (ArticlesObject)
                {
                case null:
                    return;
                }

                CommentLayout.LayoutResource = Resource.Layout.Style_Comment;
                CommentLayoutView            = CommentLayout.Inflate();

                var holder = new ArticlesCommentAdapterViewHolder(CommentLayoutView, MAdapterArticles, new ArticlesCommentClickListener(this, "Reply"))
                {
                    ReplyTextView = { Visibility = ViewStates.Gone }
                };

                //Load data same as comment adapter
                var commentAdapter = new ArticlesCommentAdapter(this, "Reply");
                commentAdapter.LoadCommentData(ArticlesObject, holder);

                ReplyCountTextView.Text = ArticlesObject.Replies?.Count > 0 ? ArticlesObject.Replies.Count + " " + GetString(Resource.String.Lbl_Replies) : GetString(Resource.String.Lbl_Replies);
                TxtComment.Text         = "@" + ArticlesObject?.UserData?.Username + " " ?? "";

                StartApiService();
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
        private void SetRecyclerViewAdapters()
        {
            try
            {
                MAdapter = new ArticlesCommentAdapter(this, "Comment")
                {
                    CommentList = new ObservableCollection <CommentsArticlesObject>()
                };

                LayoutManager = new LinearLayoutManager(this);
                MRecycler.SetLayoutManager(LayoutManager);
                MRecycler.HasFixedSize = true;
                MRecycler.SetItemViewCacheSize(10);
                MRecycler.GetLayoutManager().ItemPrefetchEnabled = true;
                var sizeProvider = new FixedPreloadSizeProvider(10, 10);
                var preLoader    = new RecyclerViewPreloader <CommentsArticlesObject>(this, MAdapter, sizeProvider, 10);
                MRecycler.AddOnScrollListener(preLoader);
                MRecycler.SetAdapter(MAdapter);

                RecyclerViewOnScrollListener xamarinRecyclerViewOnScrollListener = new RecyclerViewOnScrollListener(LayoutManager);
                MainScrollEvent = xamarinRecyclerViewOnScrollListener;
                MainScrollEvent.LoadMoreEvent += MainScrollEventOnLoadMoreEvent;
                MRecycler.AddOnScrollListener(xamarinRecyclerViewOnScrollListener);
                MainScrollEvent.IsLoading = false;
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
Exemplo n.º 6
0
        private void SetRecyclerViewAdapters()
        {
            try
            {
                switch (Type)
                {
                case "Article":
                {
                    MAdapterArticles = new ArticlesCommentAdapter(Activity, MRecycler, "Light", ArticlesObject.BlogId, "Reply")
                    {
                        CommentList = new ObservableCollection <CommentsArticlesObject>()
                    };

                    if (!Methods.CheckConnectivity())
                    {
                        Toast.MakeText(Activity, Activity.GetString(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short).Show();
                    }
                    else
                    {
                        PollyController.RunRetryPolicyFunction(new List <Func <Task> > {
                                () => MAdapterArticles.FetchBlogsApiReply(IdComment, "0")
                            });
                    }
                    break;
                }

                case "Movies":
                {
                    MAdapterMovies = new MoviesCommentAdapter(Activity, MRecycler, "Light", MoviesObject.MovieId, "Reply")
                    {
                        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> > {
                                () => MAdapterMovies.FetchMoviesApiReply(IdComment, "0")
                            });
                    }
                    break;
                }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }