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 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);
            }
        }
Exemplo n.º 3
0
        //Event Menu >> Reply
        public void CommentReplyClick(CommentsArticlesObject item)
        {
            try
            {
                // show dialog :
                ReplyFragment = new ReplyCommentBottomSheet();

                Bundle bundle = new Bundle();
                bundle.PutString("Type", "Article");
                bundle.PutString("Id", ArticlesId);
                bundle.PutString("Object", JsonConvert.SerializeObject(item));

                ReplyFragment.Arguments = bundle;

                ReplyFragment.Show(SupportFragmentManager, ReplyFragment.Tag);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Exemplo n.º 4
0
        //Event Menu >> Reply
        public void CommentReplyClick(CommentsMoviesObject item)
        {
            try
            {
                // show dialog :
                ReplyFragment = new ReplyCommentBottomSheet();

                Bundle bundle = new Bundle();
                bundle.PutString("Type", "Movies");
                bundle.PutString("Id", MoviesId);
                bundle.PutString("Object", JsonConvert.SerializeObject(item));

                ReplyFragment.Arguments = bundle;

                ReplyFragment.Show(SupportFragmentManager, ReplyFragment.Tag);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
Exemplo n.º 5
0
        private void CommentsAdapterOnReplyClick(object sender, CommentAdapterClickEventArgs e)
        {
            try
            {
                var item = e.Class;
                if (item != null)
                {
                    // show dialog :
                    ReplyCommentBottomSheet replyFragment = new ReplyCommentBottomSheet();
                    Bundle bundle = new Bundle();

                    bundle.PutString("Type", "Article");
                    bundle.PutString("Object", JsonConvert.SerializeObject(item));
                    replyFragment.Arguments = bundle;

                    replyFragment.Show(SupportFragmentManager, replyFragment.Tag);
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
        public void OnClick(MaterialDialog p0, DialogAction p1)
        {
            try
            {
                switch (TypeDialog)
                {
                case "DeleteComment" when p1 == DialogAction.Positive:
                    MainContext?.RunOnUiThread(() =>
                    {
                        try
                        {
                            switch (TypeClass)
                            {
                            case "Comment":
                                {
                                    //TypeClass
                                    var adapterGlobal = ArticlesViewActivity.GetInstance()?.MAdapter;
                                    var dataGlobal    = adapterGlobal?.CommentList?.FirstOrDefault(a => a.Id == CommentObject?.Id);
                                    if (dataGlobal != null)
                                    {
                                        var index = adapterGlobal.CommentList.IndexOf(dataGlobal);
                                        switch (index)
                                        {
                                        case > -1:
                                            adapterGlobal.CommentList.RemoveAt(index);
                                            adapterGlobal.NotifyItemRemoved(index);
                                            break;
                                        }
                                    }

                                    if (!Methods.CheckConnectivity())
                                    {
                                        Toast.MakeText(MainContext, MainContext.GetString(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short)?.Show();
                                    }
                                    else
                                    {
                                        PollyController.RunRetryPolicyFunction(new List <Func <Task> > {
                                            () => RequestsAsync.Article.DeleteCommentAsync(CommentObject.BlogId, CommentObject.Id)
                                        });
                                    }
                                    break;
                                }

                            case "Reply":
                                {
                                    //TypeClass
                                    var adapterGlobal = ReplyCommentBottomSheet.GetInstance()?.MAdapterArticles;
                                    var dataGlobal    = adapterGlobal?.CommentList?.FirstOrDefault(a => a.Id == CommentObject?.Id);
                                    if (dataGlobal != null)
                                    {
                                        var index = adapterGlobal.CommentList.IndexOf(dataGlobal);
                                        switch (index)
                                        {
                                        case > -1:
                                            adapterGlobal.CommentList.RemoveAt(index);
                                            adapterGlobal.NotifyItemRemoved(index);
                                            break;
                                        }
                                    }

                                    if (!Methods.CheckConnectivity())
                                    {
                                        Toast.MakeText(MainContext, MainContext.GetString(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short)?.Show();
                                    }
                                    else
                                    {
                                        PollyController.RunRetryPolicyFunction(new List <Func <Task> > {
                                            () => RequestsAsync.Article.DeleteCommentAsync(CommentObject.BlogId, CommentObject.Id, "reply_delete")
                                        });
                                    }
                                    break;
                                }
                            }

                            Toast.MakeText(MainContext, MainContext.GetText(Resource.String.Lbl_CommentSuccessfullyDeleted), ToastLength.Short)?.Show();
                        }
                        catch (Exception e)
                        {
                            Methods.DisplayReportResultTrack(e);
                        }
                    });
                    break;

                case "DeleteComment":
                {
                    if (p1 == DialogAction.Negative)
                    {
                        p0.Dismiss();
                    }

                    break;
                }

                default:
                {
                    if (p1 == DialogAction.Positive)
                    {
                    }
                    else if (p1 == DialogAction.Negative)
                    {
                        p0.Dismiss();
                    }

                    break;
                }
                }
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }