//FriendRequests
        private void MAdapterOnAddButtonItemClick(object sender, NotificationsAdapterClickEventArgs e)
        {
            try
            {
                if (e.Position < 0)
                {
                    return;
                }

                var item = MAdapter.GetItem(e.Position);
                if (item != null)
                {
                    if (Methods.CheckConnectivity())
                    {
                        ListUtils.RequestsList.Remove(item);
                        MAdapter.NotificationsList.Remove(item);

                        ShowEmptyPage(true);

                        PollyController.RunRetryPolicyFunction(new List <Func <Task> > {
                            () => RequestsAsync.Friends.ApproveFiendRequestAsync(item.Id.ToString())
                        });                                                                                                                                        // true >> Accept
                    }
                    else
                    {
                        Toast.MakeText(Activity, Activity.GetString(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short).Show();
                    }
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
Esempio n. 2
0
        //Open user profile
        private void MAdapterOnItemClick(object sender, NotificationsAdapterClickEventArgs e)
        {
            try
            {
                if (e.Position > -1)
                {
                    var item = MAdapter.GetItem(e.Position);
                    if (item != null)
                    {
                        string eventPage;
                        if (item.Type == "got_new_match")
                        {
                            eventPage = "HideButton";
                        }
                        else if (item.Type == "like")
                        {
                            eventPage = "likeAndClose";
                        }
                        else
                        {
                            eventPage = "Close";
                        }

                        QuickDateTools.OpenProfile(Activity, eventPage, item.Notifier, e.Image);
                    }
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
 // Open Profile user
 private void MAdapterOnItemImageClick(object sender, AvatarNotificationsAdapterClickEventArgs e)
 {
     try
     {
         if (e.Position >= 0)
         {
             var item = MAdapter.GetItem(e.Position);
             if (item != null)
             {
                 AppTools.OpenProfile(Activity, item.UserData.UserId.ToString(), item.UserData);
             }
         }
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
     }
 }
 //Open user profile
 private void MAdapterOnItemClick(object sender, NotificationsAdapterClickEventArgs e)
 {
     try
     {
         if (e.Position > -1)
         {
             var item = MAdapter.GetItem(e.Position);
             if (item != null)
             {
                 GlobalContext.OpenProfile(item.UserData.Id, item.UserData);
             }
         }
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
     }
 }
 //Open user profile
 private void MAdapterOnItemClick(object sender, NotificationsAdapterClickEventArgs e)
 {
     try
     {
         if (e.Position > -1)
         {
             var item = MAdapter.GetItem(e.Position);
             if (item != null)
             {
                 EventClickNotification(Activity, item);
             }
         }
     }
     catch (Exception exception)
     {
         Methods.DisplayReportResultTrack(exception);
     }
 }
        //Open user profile
        private void MAdapterOnItemClick(object sender, NotificationsAdapterClickEventArgs e)
        {
            try
            {
                if (e.Position > -1)
                {
                    var item = MAdapter.GetItem(e.Position);
                    if (item != null)
                    {
                        if (item.Type == "following" || item.Type == "visited_profile" || item.Type == "accepted_request")
                        {
                            WoWonderTools.OpenProfile(Activity, item.Notifier.UserId, item.Notifier);
                        }
                        else if (item.Type == "liked_page" || item.Type == "invited_page" || item.Type == "accepted_invite")
                        {
                            var intent = new Intent(Context, typeof(PageProfileActivity));
                            //intent.PutExtra("PageObject", JsonConvert.SerializeObject(item));
                            intent.PutExtra("PageId", item.PageId);
                            Context.StartActivity(intent);
                        }
                        else if (item.Type == "joined_group" || item.Type == "accepted_join_request" || item.Type == "added_you_to_group")
                        {
                            var intent = new Intent(Context, typeof(GroupProfileActivity));
                            //intent.PutExtra("GroupObject", JsonConvert.SerializeObject(item));
                            intent.PutExtra("GroupId", item.GroupId);
                            Context.StartActivity(intent);
                        }
                        else if (item.Type == "comment" || item.Type == "wondered_post" ||
                                 item.Type == "wondered_comment" || item.Type == "reaction" ||
                                 item.Type == "wondered_reply_comment" || item.Type == "comment_mention" ||
                                 item.Type == "comment_reply_mention" ||
                                 item.Type == "liked_post" || item.Type == "liked_comment" ||
                                 item.Type == "liked_reply_comment" || item.Type == "post_mention" ||
                                 item.Type == "share_post" || item.Type == "shared_your_post" || item.Type == "comment_reply" ||
                                 item.Type == "also_replied" || item.Type == "profile_wall_post")
                        {
                            var intent = new Intent(Context, typeof(ViewFullPostActivity));
                            intent.PutExtra("Id", item.PostId);
                            // intent.PutExtra("DataItem", JsonConvert.SerializeObject(item));
                            Context.StartActivity(intent);
                        }
                        else if (item.Type == "going_event")
                        {
                            var intent = new Intent(Context, typeof(EventViewActivity));
                            intent.PutExtra("EventView", JsonConvert.SerializeObject(item.Event));
                            intent.PutExtra("Id", item.EventId);
                            Context.StartActivity(intent);
                        }
                        else if (item.Type == "viewed_story")
                        {
                            //"url": "https:\/\/demo.wowonder.com\/timeline&u=Matan&story=true&story_id=1946",
                            //var id = item.Url.Split("/").Last().Split("&story_id=").Last();

                            GetUserStoriesObject.StoryObject dataMyStory = GlobalContext?.NewsFeedTab?.PostFeedAdapter?.HolderStory?.StoryAdapter?.StoryList?.FirstOrDefault(o => o.UserId == UserDetails.UserId);
                            if (dataMyStory != null)
                            {
                                Intent intent = new Intent(Context, typeof(ViewStoryActivity));
                                intent.PutExtra("UserId", dataMyStory.UserId);
                                intent.PutExtra("DataItem", JsonConvert.SerializeObject(dataMyStory));
                                Context.StartActivity(intent);
                            }
                        }
                        else if (item.Type == "requested_to_join_group")
                        {
                            var intent = new Intent(Context, typeof(JoinRequestActivity));
                            intent.PutExtra("GroupId", item.GroupId);
                            Context.StartActivity(intent);
                        }
                        else if (item.Type == "memory")
                        {
                            var intent = new Intent(Context, typeof(MemoriesActivity));
                            Context.StartActivity(intent);
                        }
                        else
                        {
                            WoWonderTools.OpenProfile(Activity, item.Notifier.UserId, item.Notifier);
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }