Exemplo n.º 1
0
        private void AddOrRemoveEvent(bool addEvent)
        {
            try
            {
                // true +=  // false -=
                if (addEvent)
                {
                    BtnComment.Click       += BtnCommentOnClick;
                    BtnShare.Click         += BtnShareOnClick;
                    BtnCountLike.Click     += BtnCountLikeOnClick;
                    BtnCountWoWonder.Click += BtnCountWoWonderOnClick;
                    InfoImageLiner.Click   += MainLayoutOnClick;
                    MainLayout.Click       += MainLayoutOnClick;

                    if (AppSettings.PostButton == PostButtonSystem.Wonder || AppSettings.PostButton == PostButtonSystem.DisLike)
                    {
                        BtnWonder.Click += BtnWonderOnClick;
                    }

                    LikeButton.Click += (sender, args) => LikeButton.ClickLikeAndDisLike(new GlobalClickEventArgs
                    {
                        NewsFeedClass = PostData,
                        View          = TxtCountLike,
                    }, null, "MultiImagesPostViewerActivity");

                    if (AppSettings.PostButton == PostButtonSystem.ReactionDefault || AppSettings.PostButton == PostButtonSystem.ReactionSubShine)
                    {
                        LikeButton.LongClick += (sender, args) => LikeButton.LongClickDialog(new GlobalClickEventArgs
                        {
                            NewsFeedClass = PostData,
                            View          = TxtCountLike,
                        }, null, "MultiImagesPostViewerActivity");
                    }
                }
                else
                {
                    BtnComment.Click       -= BtnCommentOnClick;
                    BtnShare.Click         -= BtnShareOnClick;
                    BtnCountLike.Click     -= BtnCountLikeOnClick;
                    BtnCountWoWonder.Click -= BtnCountWoWonderOnClick;
                    InfoImageLiner.Click   -= MainLayoutOnClick;
                    MainLayout.Click       -= MainLayoutOnClick;

                    if (AppSettings.PostButton == PostButtonSystem.Wonder || AppSettings.PostButton == PostButtonSystem.DisLike)
                    {
                        BtnWonder.Click -= BtnWonderOnClick;
                    }

                    LikeButton.Click += null !;
                    if (AppSettings.PostButton == PostButtonSystem.ReactionDefault || AppSettings.PostButton == PostButtonSystem.ReactionSubShine)
                    {
                        LikeButton.LongClick -= null !;
                    }
                }
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
        private void AddOrRemoveEvent(bool addEvent)
        {
            try
            {
                // true +=  // false -=
                if (addEvent)
                {
                    BtnComment.Click          += BtnCommentOnClick;
                    BtnShare.Click            += BtnShareOnClick;
                    BtnCountLike.Click        += BtnCountLikeOnClick;
                    BtnCountObeeNetwork.Click += BtnCountObeeNetworkOnClick;
                    InfoImageLiner.Click      += MainLayoutOnClick;
                    MainLayout.Click          += MainLayoutOnClick;

                    if (AppSettings.PostButton == PostButtonSystem.Wonder || AppSettings.PostButton == PostButtonSystem.DisLike)
                    {
                        BtnWonder.Click += BtnWonderOnClick;
                    }

                    LikeButton.Click += (sender, args) => LikeButton.ClickLikeAndDisLike(new GlobalClickEventArgs()
                    {
                        NewsFeedClass = PostData,
                        View          = TxtCountLike,
                    }, null, "MultiImagesPostViewerActivity");

                    if (AppSettings.PostButton == PostButtonSystem.Reaction)
                    {
                        LikeButton.LongClick += (sender, args) => LikeButton.LongClickDialog(new GlobalClickEventArgs()
                        {
                            NewsFeedClass = PostData,
                            View          = TxtCountLike,
                        }, null, "MultiImagesPostViewerActivity");
                    }
                }
                else
                {
                    BtnComment.Click          -= BtnCommentOnClick;
                    BtnShare.Click            -= BtnShareOnClick;
                    BtnCountLike.Click        -= BtnCountLikeOnClick;
                    BtnCountObeeNetwork.Click -= BtnCountObeeNetworkOnClick;
                    InfoImageLiner.Click      -= MainLayoutOnClick;
                    MainLayout.Click          -= MainLayoutOnClick;

                    if (AppSettings.PostButton == PostButtonSystem.Wonder || AppSettings.PostButton == PostButtonSystem.DisLike)
                    {
                        BtnWonder.Click -= BtnWonderOnClick;
                    }

                    LikeButton.Click += null;
                    if (AppSettings.PostButton == PostButtonSystem.Reaction)
                    {
                        LikeButton.LongClick -= null;
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        private void AddOrRemoveEvent(bool addEvent)
        {
            try
            {
                // true +=  // false -=
                if (addEvent)
                {
                    BtnContact.Click                += BtnContactOnClick;
                    UserImageAvatar.Click           += UserImageAvatarOnClick;
                    TxtProductCardName.Click        += UserImageAvatarOnClick;
                    ImageMore.Click                 += ImageMoreOnClick;
                    IconBack.Click                  += IconBackOnClick;
                    TxtProductDescription.LongClick += TxtProductDescriptionOnLongClick;
                    BtnComment.Click                += BtnCommentOnClick;

                    if (AppSettings.PostButton == PostButtonSystem.Wonder || AppSettings.PostButton == PostButtonSystem.DisLike)
                    {
                        BtnWonder.Click += BtnWonderOnClick;
                    }

                    LikeButton.Click += (sender, args) => LikeButton.ClickLikeAndDisLike(new GlobalClickEventArgs
                    {
                        NewsFeedClass = PostData,
                    }, null, "ProductViewActivity");

                    if (AppSettings.PostButton == PostButtonSystem.ReactionDefault || AppSettings.PostButton == PostButtonSystem.ReactionSubShine)
                    {
                        LikeButton.LongClick += (sender, args) => LikeButton.LongClickDialog(new GlobalClickEventArgs
                        {
                            NewsFeedClass = PostData,
                        }, null, "ProductViewActivity");
                    }
                }
                else
                {
                    BtnContact.Click                -= BtnContactOnClick;
                    UserImageAvatar.Click           -= UserImageAvatarOnClick;
                    TxtProductCardName.Click        -= UserImageAvatarOnClick;
                    ImageMore.Click                 -= ImageMoreOnClick;
                    IconBack.Click                  -= IconBackOnClick;
                    TxtProductDescription.LongClick -= TxtProductDescriptionOnLongClick;
                    BtnComment.Click                -= BtnCommentOnClick;

                    if (AppSettings.PostButton == PostButtonSystem.Wonder || AppSettings.PostButton == PostButtonSystem.DisLike)
                    {
                        BtnWonder.Click -= BtnWonderOnClick;
                    }

                    LikeButton.Click += null !;
                    if (AppSettings.PostButton == PostButtonSystem.ReactionDefault || AppSettings.PostButton == PostButtonSystem.ReactionSubShine)
                    {
                        LikeButton.LongClick -= null !;
                    }
                }
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
Exemplo n.º 4
0
        public void OnClick(View v)
        {
            try
            {
                var postType = PostFunctions.GetAdapterType(PostObject);

                if (v.Id == Username.Id)
                {
                    PostClickListener.ProfilePostClick(new ProfileClickEventArgs {
                        NewsFeedClass = PostObject, View = MainView
                    }, "NewsFeedClass", "Username");
                }
                else if (v.Id == UserAvatar.Id)
                {
                    PostClickListener.ProfilePostClick(new ProfileClickEventArgs {
                        NewsFeedClass = PostObject, View = MainView
                    }, "NewsFeedClass", "UserAvatar");
                }
                else if (v.Id == MoreIcon.Id)
                {
                    PostClickListener.MorePostIconClick(new GlobalClickEventArgs {
                        NewsFeedClass = PostObject, View = MainView
                    });
                }
                else if (v.Id == LikeButton.Id)
                {
                    LikeButton.ClickLikeAndDisLike(new GlobalClickEventArgs {
                        NewsFeedClass = PostObject, View = MainView
                    }, null);
                }
                else if (v.Id == CommentLinearLayout.Id)
                {
                    PostClickListener.CommentPostClick(new GlobalClickEventArgs {
                        NewsFeedClass = PostObject, View = MainView
                    });
                }
                else if (v.Id == ShareLinearLayout.Id)
                {
                    PostClickListener.SharePostClick(new GlobalClickEventArgs {
                        NewsFeedClass = PostObject, View = MainView
                    }, postType);
                }
                else if (v.Id == SecondReactionButton.Id)
                {
                    PostClickListener.SecondReactionButtonClick(new GlobalClickEventArgs {
                        NewsFeedClass = PostObject, View = MainView
                    });
                }
                else if (v.Id == LikeCount.Id)
                {
                    PostClickListener.DataItemPostClick(new GlobalClickEventArgs {
                        NewsFeedClass = PostObject, View = MainView
                    });
                }
                else if (v.Id == CommentCount.Id)
                {
                    PostClickListener.CommentPostClick(new GlobalClickEventArgs {
                        NewsFeedClass = PostObject, View = MainView
                    });
                }
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }