Пример #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            try
            {
                base.OnCreate(savedInstanceState);
                SetTheme(AppSettings.SetTabDarkTheme ? Resource.Style.MyTheme_Dark_Base : Resource.Style.MyTheme_Base);

                Methods.App.FullScreenApp(this);

                // Create your application here
                SetContentView(Resource.Layout.ArticlesViewLayout);

                Instance = this;

                ArticlesId = Intent.GetStringExtra("Id") ?? "";

                //Get Value And Set Toolbar
                InitComponent();
                InitToolbar();
                SetRecyclerViewAdapters();

                GetDataArticles();

                RewardedVideo = AdsFacebook.InitRewardVideo(this);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Пример #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)
            {
                Console.WriteLine(e);
            }
        }
Пример #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);
            }
        }
Пример #4
0
 public MyWebViewClient(ArticlesViewActivity mActivity)
 {
     Activity = mActivity;
 }
        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);
            }
        }