private static void UpdateLastIdMessage(List <MessageData> chatMessages)
        {
            try
            {
                foreach (var messageInfo in chatMessages)
                {
                    var typeModel = MainWindowActivity.MAdapter.GetTypeModel(messageInfo);
                    if (typeModel == MessageModelType.None)
                    {
                        continue;
                    }

                    var message = WoWonderTools.MessageFilter(messageInfo.PageId, messageInfo, typeModel);


                    message.ModelType = typeModel;

                    var checker = MainWindowActivity?.MAdapter.DifferList?.FirstOrDefault(a => a.MesData.Id == message.MessageHashId);
                    if (checker != null)
                    {
                        //checker.TypeView = typeModel;
                        checker.MesData = message;

                        if (AppSettings.LastChatSystem == SystemApiGetLastChat.New)
                        {
                            var updaterUser = GlobalContext?.LastChatTab?.MAdapter?.ChatList.FirstOrDefault(a => a.UserId == message.ToId);
                            if (updaterUser != null)
                            {
                                var index = GlobalContext.LastChatTab.MAdapter.ChatList.IndexOf(GlobalContext.LastChatTab.MAdapter.ChatList.FirstOrDefault(x => x.PageId == message.PageId));
                                if (index > -1)
                                {
                                    if (typeModel == MessageModelType.RightGif)
                                    {
                                        updaterUser.LastMessage.LastMessageClass.Text = GlobalContext?.GetText(Resource.String.Lbl_SendGifFile);
                                    }
                                    else if (typeModel == MessageModelType.RightText)
                                    {
                                        updaterUser.LastMessage.LastMessageClass.Text = !string.IsNullOrEmpty(message.Text) ? Methods.FunString.DecodeString(message.Text) : GlobalContext?.GetText(Resource.String.Lbl_SendMessage);
                                    }
                                    else if (typeModel == MessageModelType.RightSticker)
                                    {
                                        updaterUser.LastMessage.LastMessageClass.Text = GlobalContext?.GetText(Resource.String.Lbl_SendStickerFile);
                                    }
                                    else if (typeModel == MessageModelType.RightContact)
                                    {
                                        updaterUser.LastMessage.LastMessageClass.Text = GlobalContext?.GetText(Resource.String.Lbl_SendContactnumber);
                                    }
                                    else if (typeModel == MessageModelType.RightFile)
                                    {
                                        updaterUser.LastMessage.LastMessageClass.Text = GlobalContext?.GetText(Resource.String.Lbl_SendFile);
                                    }
                                    else if (typeModel == MessageModelType.RightVideo)
                                    {
                                        updaterUser.LastMessage.LastMessageClass.Text = GlobalContext?.GetText(Resource.String.Lbl_SendVideoFile);
                                    }
                                    else if (typeModel == MessageModelType.RightImage)
                                    {
                                        updaterUser.LastMessage.LastMessageClass.Text = GlobalContext?.GetText(Resource.String.Lbl_SendImageFile);
                                    }
                                    else if (typeModel == MessageModelType.RightAudio)
                                    {
                                        updaterUser.LastMessage.LastMessageClass.Text = GlobalContext?.GetText(Resource.String.Lbl_SendAudioFile);
                                    }

                                    GlobalContext.RunOnUiThread(() =>
                                    {
                                        try
                                        {
                                            GlobalContext?.LastChatTab?.MAdapter?.ChatList.Move(index, 0);
                                            GlobalContext?.LastChatTab?.MAdapter?.NotifyItemMoved(index, 0);
                                            GlobalContext?.LastChatTab?.MAdapter?.NotifyItemChanged(index, "WithoutBlob");
                                        }
                                        catch (Exception e)
                                        {
                                            Console.WriteLine(e);
                                        }
                                    });
                                }
                            }
                            else
                            {
                                GlobalContext?.RunOnUiThread(() =>
                                {
                                    try
                                    {
                                        if (PageData != null)
                                        {
                                            GlobalContext?.LastChatTab.MAdapter.ChatList.Insert(0, PageData);
                                            GlobalContext?.LastChatTab.MAdapter.NotifyItemInserted(0);
                                            GlobalContext?.LastChatTab.MRecycler.ScrollToPosition(GlobalContext.LastChatTab.MAdapter.ChatList.IndexOf(PageData));
                                        }
                                    }
                                    catch (Exception e)
                                    {
                                        Console.WriteLine(e);
                                    }
                                });
                            }
                        }
                        else
                        {
                            var updaterUser = GlobalContext?.LastPageChatsTab?.MAdapter?.LastPageList.FirstOrDefault(a => a.UserId == message.ToId);
                            if (updaterUser != null)
                            {
                                var index = GlobalContext.LastPageChatsTab.MAdapter.LastPageList.IndexOf(GlobalContext.LastPageChatsTab.MAdapter.LastPageList.FirstOrDefault(x => x.PageId == message.PageId));
                                if (index > -1)
                                {
                                    if (typeModel == MessageModelType.RightGif)
                                    {
                                        updaterUser.LastMessage.Text = GlobalContext?.GetText(Resource.String.Lbl_SendGifFile);
                                    }
                                    else if (typeModel == MessageModelType.RightText)
                                    {
                                        updaterUser.LastMessage.Text = !string.IsNullOrEmpty(message.Text) ? Methods.FunString.DecodeString(message.Text) : GlobalContext?.GetText(Resource.String.Lbl_SendMessage);
                                    }
                                    else if (typeModel == MessageModelType.RightSticker)
                                    {
                                        updaterUser.LastMessage.Text = GlobalContext?.GetText(Resource.String.Lbl_SendStickerFile);
                                    }
                                    else if (typeModel == MessageModelType.RightContact)
                                    {
                                        updaterUser.LastMessage.Text = GlobalContext?.GetText(Resource.String.Lbl_SendContactnumber);
                                    }
                                    else if (typeModel == MessageModelType.RightFile)
                                    {
                                        updaterUser.LastMessage.Text = GlobalContext?.GetText(Resource.String.Lbl_SendFile);
                                    }
                                    else if (typeModel == MessageModelType.RightVideo)
                                    {
                                        updaterUser.LastMessage.Text = GlobalContext?.GetText(Resource.String.Lbl_SendVideoFile);
                                    }
                                    else if (typeModel == MessageModelType.RightImage)
                                    {
                                        updaterUser.LastMessage.Text = GlobalContext?.GetText(Resource.String.Lbl_SendImageFile);
                                    }
                                    else if (typeModel == MessageModelType.RightAudio)
                                    {
                                        updaterUser.LastMessage.Text = GlobalContext?.GetText(Resource.String.Lbl_SendAudioFile);
                                    }

                                    GlobalContext.RunOnUiThread(() =>
                                    {
                                        try
                                        {
                                            GlobalContext?.LastPageChatsTab?.MAdapter?.LastPageList.Move(index, 0);
                                            GlobalContext?.LastPageChatsTab?.MAdapter?.NotifyItemMoved(index, 0);
                                            GlobalContext?.LastPageChatsTab?.MAdapter?.NotifyItemChanged(index, "WithoutBlob");
                                        }
                                        catch (Exception e)
                                        {
                                            Console.WriteLine(e);
                                        }
                                    });
                                }
                            }
                            else
                            {
                                GlobalContext?.RunOnUiThread(() =>
                                {
                                    try
                                    {
                                        if (DataProfilePage != null)
                                        {
                                            GlobalContext?.LastPageChatsTab?.MAdapter.LastPageList.Insert(0, DataProfilePage);
                                            GlobalContext?.LastPageChatsTab?.MAdapter.NotifyItemInserted(0);
                                            GlobalContext?.LastPageChatsTab?.MRecycler.ScrollToPosition(GlobalContext.LastPageChatsTab.MAdapter.LastPageList.IndexOf(DataProfilePage));
                                        }
                                    }
                                    catch (Exception e)
                                    {
                                        Console.WriteLine(e);
                                    }
                                });
                            }
                        }

                        GlobalContext?.RunOnUiThread(() =>
                        {
                            try
                            {
                                //Update data RecyclerView Messages.
                                if (message.ModelType != MessageModelType.RightSticker || message.ModelType != MessageModelType.RightImage || message.ModelType != MessageModelType.RightVideo)
                                {
                                    MainWindowActivity.Update_One_Messeges(checker.MesData);
                                }

                                if (SettingsPrefFragment.SSoundControl)
                                {
                                    Methods.AudioRecorderAndPlayer.PlayAudioFromAsset("Popup_SendMesseges.mp3");
                                }
                            }
                            catch (Exception e)
                            {
                                Console.WriteLine(e);
                            }
                        });
                    }

                    PageData        = null;
                    DataProfilePage = null;
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        private static void UpdateLastIdMessage(List <MessageData> chatMessages)
        {
            try
            {
                foreach (var messageInfo in chatMessages)
                {
                    var typeModel = Holders.GetTypeModel(messageInfo);
                    if (typeModel == MessageModelType.None)
                    {
                        continue;
                    }

                    var message = WoWonderTools.MessageFilter(messageInfo.GroupId, messageInfo, typeModel);

                    message.ModelType = typeModel;
                    message.SendFile  = false;

                    var checker = MainWindowActivity?.MAdapter.DifferList?.FirstOrDefault(a => a.MesData.Id == message.MessageHashId);
                    if (checker != null)
                    {
                        //checker.TypeView = typeModel;
                        checker.MesData  = message;
                        checker.Id       = Java.Lang.Long.ParseLong(message.Id);
                        checker.TypeView = typeModel;

                        checker.MesData.Id             = message.Id;
                        checker.MesData.FromId         = message.FromId;
                        checker.MesData.GroupId        = message.GroupId;
                        checker.MesData.ToId           = message.ToId;
                        checker.MesData.Text           = message.Text;
                        checker.MesData.Media          = message.Media;
                        checker.MesData.MediaFileName  = message.MediaFileName;
                        checker.MesData.MediaFileNames = message.MediaFileNames;
                        checker.MesData.Time           = message.Time;
                        checker.MesData.Seen           = message.Seen;
                        checker.MesData.DeletedOne     = message.DeletedOne;
                        checker.MesData.DeletedTwo     = message.DeletedTwo;
                        checker.MesData.SentPush       = message.SentPush;
                        checker.MesData.NotificationId = message.NotificationId;
                        checker.MesData.TypeTwo        = message.TypeTwo;
                        checker.MesData.Stickers       = message.Stickers;
                        checker.MesData.TimeText       = message.TimeText;
                        checker.MesData.Position       = message.Position;
                        checker.MesData.ModelType      = message.ModelType;
                        checker.MesData.FileSize       = message.FileSize;
                        checker.MesData.MediaDuration  = message.MediaDuration;
                        checker.MesData.MediaIsPlaying = message.MediaIsPlaying;
                        checker.MesData.ContactNumber  = message.ContactNumber;
                        checker.MesData.ContactName    = message.ContactName;
                        checker.MesData.ProductId      = message.ProductId;
                        checker.MesData.MessageUser    = message.MessageUser;
                        checker.MesData.Product        = message.Product;
                        checker.MesData.MessageHashId  = message.MessageHashId;
                        checker.MesData.Lat            = message.Lat;
                        checker.MesData.Lng            = message.Lng;
                        checker.MesData.SendFile       = false;

                        if (AppSettings.LastChatSystem == SystemApiGetLastChat.New)
                        {
                            var updaterUser = GlobalContext?.LastChatTab?.MAdapter?.ChatList.FirstOrDefault(a => a.UserId == message.ToId);
                            if (updaterUser != null)
                            {
                                var index = GlobalContext.LastChatTab.MAdapter.ChatList.IndexOf(GlobalContext.LastChatTab.MAdapter.ChatList.FirstOrDefault(x => x.GroupId == message.GroupId));
                                if (index > -1)
                                {
                                    if (typeModel == MessageModelType.RightGif)
                                    {
                                        updaterUser.LastMessage.LastMessageClass.Text = GlobalContext?.GetText(Resource.String.Lbl_SendGifFile);
                                    }
                                    else if (typeModel == MessageModelType.RightText)
                                    {
                                        updaterUser.LastMessage.LastMessageClass.Text = !string.IsNullOrEmpty(message.Text) ? Methods.FunString.DecodeString(message.Text) : GlobalContext?.GetText(Resource.String.Lbl_SendMessage);
                                    }
                                    else if (typeModel == MessageModelType.RightSticker)
                                    {
                                        updaterUser.LastMessage.LastMessageClass.Text = GlobalContext?.GetText(Resource.String.Lbl_SendStickerFile);
                                    }
                                    else if (typeModel == MessageModelType.RightContact)
                                    {
                                        updaterUser.LastMessage.LastMessageClass.Text = GlobalContext?.GetText(Resource.String.Lbl_SendContactnumber);
                                    }
                                    else if (typeModel == MessageModelType.RightFile)
                                    {
                                        updaterUser.LastMessage.LastMessageClass.Text = GlobalContext?.GetText(Resource.String.Lbl_SendFile);
                                    }
                                    else if (typeModel == MessageModelType.RightVideo)
                                    {
                                        updaterUser.LastMessage.LastMessageClass.Text = GlobalContext?.GetText(Resource.String.Lbl_SendVideoFile);
                                    }
                                    else if (typeModel == MessageModelType.RightImage)
                                    {
                                        updaterUser.LastMessage.LastMessageClass.Text = GlobalContext?.GetText(Resource.String.Lbl_SendImageFile);
                                    }
                                    else if (typeModel == MessageModelType.RightAudio)
                                    {
                                        updaterUser.LastMessage.LastMessageClass.Text = GlobalContext?.GetText(Resource.String.Lbl_SendAudioFile);
                                    }
                                    else if (typeModel == MessageModelType.RightMap)
                                    {
                                        updaterUser.LastMessage.LastMessageClass.Text = GlobalContext?.GetText(Resource.String.Lbl_SendLocationFile);
                                    }

                                    GlobalContext.RunOnUiThread(() =>
                                    {
                                        try
                                        {
                                            GlobalContext?.LastChatTab?.MAdapter?.ChatList.Move(index, 0);
                                            GlobalContext?.LastChatTab?.MAdapter?.NotifyItemMoved(index, 0);
                                            GlobalContext?.LastChatTab?.MAdapter?.NotifyItemChanged(index, "WithoutBlob");
                                        }
                                        catch (Exception e)
                                        {
                                            Console.WriteLine(e);
                                        }
                                    });
                                }
                            }
                            else
                            {
                                GlobalContext?.RunOnUiThread(() =>
                                {
                                    try
                                    {
                                        if (GroupData != null)
                                        {
                                            GlobalContext?.LastChatTab.MAdapter.ChatList.Insert(0, GroupData);
                                            GlobalContext?.LastChatTab.MAdapter.NotifyItemInserted(0);
                                            GlobalContext?.LastChatTab.MRecycler.ScrollToPosition(GlobalContext.LastChatTab.MAdapter.ChatList.IndexOf(GroupData));
                                        }
                                    }
                                    catch (Exception e)
                                    {
                                        Console.WriteLine(e);
                                    }
                                });
                            }
                        }
                        else
                        {
                            var updaterUser = GlobalContext?.LastGroupChatsTab?.MAdapter?.LastGroupList.FirstOrDefault(a => a.UserId == message.ToId);
                            if (updaterUser != null)
                            {
                                var index = GlobalContext.LastGroupChatsTab.MAdapter.LastGroupList.IndexOf(GlobalContext.LastGroupChatsTab.MAdapter.LastGroupList.FirstOrDefault(x => x.GroupId == message.GroupId));
                                if (index > -1)
                                {
                                    //if (typeModel == MessageModelType.RightGif)
                                    //    updaterUser.LastMessage.Text = GlobalContext?.GetText(Resource.String.Lbl_SendGifFile);
                                    //else if (typeModel == MessageModelType.RightText)
                                    //    updaterUser.LastMessage.Text = !string.IsNullOrEmpty(message.Text) ? Methods.FunString.DecodeString(message.Text) : GlobalContext?.GetText(Resource.String.Lbl_SendMessage);
                                    //else if (typeModel == MessageModelType.RightSticker)
                                    //    updaterUser.LastMessage.Text = GlobalContext?.GetText(Resource.String.Lbl_SendStickerFile);
                                    //else if (typeModel == MessageModelType.RightContact)
                                    //    updaterUser.LastMessage.Text = GlobalContext?.GetText(Resource.String.Lbl_SendContactnumber);
                                    //else if (typeModel == MessageModelType.RightFile)
                                    //    updaterUser.LastMessage.Text = GlobalContext?.GetText(Resource.String.Lbl_SendFile);
                                    //else if (typeModel == MessageModelType.RightVideo)
                                    //    updaterUser.LastMessage.Text = GlobalContext?.GetText(Resource.String.Lbl_SendVideoFile);
                                    //else if (typeModel == MessageModelType.RightImage)
                                    //    updaterUser.LastMessage.Text = GlobalContext?.GetText(Resource.String.Lbl_SendImageFile);
                                    //else if (typeModel == MessageModelType.RightAudio)
                                    //    updaterUser.LastMessage.Text = GlobalContext?.GetText(Resource.String.Lbl_SendAudioFile);

                                    //GlobalContext.RunOnUiThread(() =>
                                    //{
                                    //    try
                                    //    {
                                    //        GlobalContext?.LastGroupChatsTab?.MAdapter?.LastGroupList.Move(index, 0);
                                    //        GlobalContext?.LastGroupChatsTab?.MAdapter?.NotifyItemMoved(index, 0);
                                    //        GlobalContext?.LastGroupChatsTab?.MAdapter?.NotifyItemChanged(index, "WithoutBlob");
                                    //    }
                                    //    catch (Exception e)
                                    //    {
                                    //        Console.WriteLine(e);
                                    //    }
                                    //});
                                }
                            }
                            else
                            {
                                //GlobalContext?.RunOnUiThread(() =>
                                //{
                                //    try
                                //    {
                                //        GlobalContext?.LastGroupChatsTab?.MAdapter.LastGroupList.Insert(0, GroupData);
                                //        GlobalContext?.LastGroupChatsTab?.MAdapter.NotifyItemInserted(0);
                                //        GlobalContext?.LastGroupChatsTab?.MRecycler.ScrollToPosition(GlobalContext.LastGroupChatsTab.MAdapter.LastGroupList.IndexOf(GroupData));
                                //    }
                                //    catch (Exception e)
                                //    {
                                //        Console.WriteLine(e);
                                //    }
                                //});
                            }
                        }

                        GlobalContext?.RunOnUiThread(() =>
                        {
                            try
                            {
                                //Update data RecyclerView Messages.
                                if (message.ModelType != MessageModelType.RightSticker || message.ModelType != MessageModelType.RightImage || message.ModelType != MessageModelType.RightMap || message.ModelType != MessageModelType.RightVideo)
                                {
                                    MainWindowActivity.Update_One_Messeges(checker.MesData);
                                }

                                if (SettingsPrefFragment.SSoundControl)
                                {
                                    Methods.AudioRecorderAndPlayer.PlayAudioFromAsset("Popup_SendMesseges.mp3");
                                }
                            }
                            catch (Exception e)
                            {
                                Console.WriteLine(e);
                            }
                        });
                    }

                    GroupData = null;
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        private async void AddStory()
        {
            try
            {
                var modelStory = GlobalContextTabbed.LastStoriesTab.MAdapter;

                string time          = Methods.Time.TimeAgo(DateTime.Now, false);
                int    unixTimestamp = (int)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds;
                string time2         = unixTimestamp.ToString();

                var userData = ListUtils.MyProfileList.FirstOrDefault();

                //just pass file_path and type video or image
                var(apiStatus, respond) = await RequestsAsync.Story.Create_Story(DataPost.StoryTitle, DataPost.StoryDescription, DataPost.StoryFilePath, DataPost.StoryFileType);

                if (apiStatus == 200)
                {
                    if (respond is CreateStoryObject result)
                    {
                        Toast.MakeText(GlobalContextTabbed, GlobalContextTabbed.GetText(Resource.String.Lbl_Story_Added), ToastLength.Short).Show();

                        var check = modelStory.StoryList?.FirstOrDefault(a => a.UserId == UserDetails.UserId);
                        if (check != null)
                        {
                            if (DataPost.StoryFileType == "image")
                            {
                                var item = new GetUserStoriesObject.StoryObject.Story()
                                {
                                    UserId      = UserDetails.UserId,
                                    Id          = result.StoryId,
                                    Description = DataPost.StoryDescription,
                                    Title       = DataPost.StoryTitle,
                                    TimeText    = time,
                                    IsOwner     = true,
                                    Expire      = "",
                                    Posted      = time2,
                                    Thumbnail   = DataPost.StoryFilePath,
                                    UserData    = userData,
                                    Images      = new List <GetUserStoriesObject.StoryObject.Image>(),
                                    Videos      = new List <GetUserStoriesObject.StoryObject.Video>()
                                };

                                if (check.DurationsList == null)
                                {
                                    check.DurationsList = new List <long>()
                                    {
                                        AppSettings.StoryDuration
                                    }
                                }
                                ;
                                else
                                {
                                    check.DurationsList.Add(AppSettings.StoryDuration);
                                }

                                check.Stories.Add(item);
                            }
                            else
                            {
                                var item = new GetUserStoriesObject.StoryObject.Story()
                                {
                                    UserId      = UserDetails.UserId,
                                    Id          = result.StoryId,
                                    Description = DataPost.StoryDescription,
                                    Title       = DataPost.StoryTitle,
                                    TimeText    = time,
                                    IsOwner     = true,
                                    Expire      = "",
                                    Posted      = time2,
                                    Thumbnail   = DataPost.StoryThumbnail,
                                    UserData    = userData,
                                    Images      = new List <GetUserStoriesObject.StoryObject.Image>(),
                                    Videos      = new List <GetUserStoriesObject.StoryObject.Video>()
                                    {
                                        new GetUserStoriesObject.StoryObject.Video()
                                        {
                                            StoryId  = result.StoryId,
                                            Filename = DataPost.StoryFilePath,
                                            Id       = time2,
                                            Expire   = time2,
                                            Type     = "video",
                                        }
                                    }
                                };

                                var duration = WoWonderTools.GetDuration(DataPost.StoryFilePath);

                                if (check.DurationsList == null)
                                {
                                    check.DurationsList = new List <long>()
                                    {
                                        Long.ParseLong(duration)
                                    }
                                }
                                ;
                                else
                                {
                                    check.DurationsList.Add(Long.ParseLong(duration));
                                }

                                check.Stories.Add(item);
                            }
                        }
                        else
                        {
                            if (DataPost.StoryFileType == "image")
                            {
                                var item = new GetUserStoriesObject.StoryObject
                                {
                                    Type    = "image",
                                    Stories = new List <GetUserStoriesObject.StoryObject.Story>
                                    {
                                        new GetUserStoriesObject.StoryObject.Story()
                                        {
                                            UserId      = UserDetails.UserId,
                                            Id          = result.StoryId,
                                            Description = DataPost.StoryDescription,
                                            Title       = DataPost.StoryTitle,
                                            TimeText    = time,
                                            IsOwner     = true,
                                            Expire      = "",
                                            Posted      = time2,
                                            Thumbnail   = DataPost.StoryFilePath,
                                            UserData    = userData,
                                            Images      = new List <GetUserStoriesObject.StoryObject.Image>(),
                                            Videos      = new List <GetUserStoriesObject.StoryObject.Video>(),
                                        }
                                    },
                                    UserId                = userData?.UserId,
                                    Username              = userData?.Username,
                                    Email                 = userData?.Email,
                                    FirstName             = userData?.FirstName,
                                    LastName              = userData?.LastName,
                                    Avatar                = userData?.Avatar,
                                    Cover                 = userData?.Cover,
                                    BackgroundImage       = userData?.BackgroundImage,
                                    RelationshipId        = userData?.RelationshipId,
                                    Address               = userData?.Address,
                                    Working               = userData?.Working,
                                    Gender                = userData?.Gender,
                                    Facebook              = userData?.Facebook,
                                    Google                = userData?.Google,
                                    Twitter               = userData?.Twitter,
                                    Linkedin              = userData?.Linkedin,
                                    Website               = userData?.Website,
                                    Instagram             = userData?.Instagram,
                                    WebDeviceId           = userData?.WebDeviceId,
                                    Language              = userData?.Language,
                                    IpAddress             = userData?.IpAddress,
                                    PhoneNumber           = userData?.PhoneNumber,
                                    Timezone              = userData?.Timezone,
                                    Lat                   = userData?.Lat,
                                    Lng                   = userData?.Lng,
                                    About                 = userData?.About,
                                    Birthday              = userData?.Birthday,
                                    Registered            = userData?.Registered,
                                    Lastseen              = userData?.Lastseen,
                                    LastLocationUpdate    = userData?.LastLocationUpdate,
                                    Balance               = userData?.Balance,
                                    Verified              = userData?.Verified,
                                    Status                = userData?.Status,
                                    Active                = userData?.Active,
                                    Admin                 = userData?.Admin,
                                    IsPro                 = userData?.IsPro,
                                    ProType               = userData?.ProType,
                                    School                = userData?.School,
                                    Name                  = userData?.Name,
                                    AndroidMDeviceId      = userData?.AndroidMDeviceId,
                                    ECommented            = userData?.ECommented,
                                    AndroidNDeviceId      = userData?.AndroidMDeviceId,
                                    AvatarFull            = userData?.AvatarFull,
                                    BirthPrivacy          = userData?.BirthPrivacy,
                                    CanFollow             = userData?.CanFollow,
                                    ConfirmFollowers      = userData?.ConfirmFollowers,
                                    CountryId             = userData?.CountryId,
                                    EAccepted             = userData?.EAccepted,
                                    EFollowed             = userData?.EFollowed,
                                    EJoinedGroup          = userData?.EJoinedGroup,
                                    ELastNotif            = userData?.ELastNotif,
                                    ELiked                = userData?.ELiked,
                                    ELikedPage            = userData?.ELikedPage,
                                    EMentioned            = userData?.EMentioned,
                                    EProfileWallPost      = userData?.EProfileWallPost,
                                    ESentmeMsg            = userData?.ESentmeMsg,
                                    EShared               = userData?.EShared,
                                    EVisited              = userData?.EVisited,
                                    EWondered             = userData?.EWondered,
                                    EmailNotification     = userData?.EmailNotification,
                                    FollowPrivacy         = userData?.FollowPrivacy,
                                    FriendPrivacy         = userData?.FriendPrivacy,
                                    GenderText            = userData?.GenderText,
                                    InfoFile              = userData?.InfoFile,
                                    IosMDeviceId          = userData?.IosMDeviceId,
                                    IosNDeviceId          = userData?.IosNDeviceId,
                                    IsFollowing           = userData?.IsFollowing,
                                    IsFollowingMe         = userData?.IsFollowingMe,
                                    LastAvatarMod         = userData?.LastAvatarMod,
                                    LastCoverMod          = userData?.LastCoverMod,
                                    LastDataUpdate        = userData?.LastDataUpdate,
                                    LastFollowId          = userData?.LastFollowId,
                                    LastLoginData         = userData?.LastLoginData,
                                    LastseenStatus        = userData?.LastseenStatus,
                                    LastseenTimeText      = userData?.LastseenTimeText,
                                    LastseenUnixTime      = userData?.LastseenUnixTime,
                                    MessagePrivacy        = userData?.MessagePrivacy,
                                    NewEmail              = userData?.NewEmail,
                                    NewPhone              = userData?.NewPhone,
                                    NotificationSettings  = userData?.NotificationSettings,
                                    NotificationsSound    = userData?.NotificationsSound,
                                    OrderPostsBy          = userData?.OrderPostsBy,
                                    PaypalEmail           = userData?.PaypalEmail,
                                    PostPrivacy           = userData?.PostPrivacy,
                                    Referrer              = userData?.Referrer,
                                    ShareMyData           = userData?.ShareMyData,
                                    ShareMyLocation       = userData?.ShareMyLocation,
                                    ShowActivitiesPrivacy = userData?.ShowActivitiesPrivacy,
                                    TwoFactor             = userData?.TwoFactor,
                                    TwoFactorVerified     = userData?.TwoFactorVerified,
                                    Url                   = userData?.Url,
                                    VisitPrivacy          = userData?.VisitPrivacy,
                                    Vk             = userData?.Vk,
                                    Wallet         = userData?.Wallet,
                                    WorkingLink    = userData?.WorkingLink,
                                    Youtube        = userData?.Youtube,
                                    City           = userData?.City,
                                    Points         = userData?.Points,
                                    DailyPoints    = userData?.DailyPoints,
                                    State          = userData?.State,
                                    Zip            = userData?.Zip,
                                    IsAdmin        = userData?.IsAdmin,
                                    IsBlocked      = userData?.IsBlocked,
                                    MemberId       = userData?.MemberId,
                                    PointDayExpire = userData?.PointDayExpire,
                                    UserPlatform   = userData?.UserPlatform,
                                    Details        = new DetailsUnion()
                                    {
                                        DetailsClass = new Details(),
                                    },
                                };

                                if (item.DurationsList == null)
                                {
                                    item.DurationsList = new List <long>()
                                    {
                                        AppSettings.StoryDuration
                                    }
                                }
                                ;
                                else
                                {
                                    item.DurationsList.Add(AppSettings.StoryDuration);
                                }

                                modelStory.StoryList?.Add(item);
                            }
                            else
                            {
                                var item = new GetUserStoriesObject.StoryObject()
                                {
                                    Type    = "video",
                                    Stories = new List <GetUserStoriesObject.StoryObject.Story>()
                                    {
                                        new GetUserStoriesObject.StoryObject.Story()
                                        {
                                            UserId      = UserDetails.UserId,
                                            Id          = result.StoryId,
                                            Description = DataPost.StoryDescription,
                                            Title       = DataPost.StoryTitle,
                                            TimeText    = time,
                                            IsOwner     = true,
                                            Expire      = "",
                                            Posted      = time2,
                                            Thumbnail   = DataPost.StoryThumbnail,
                                            UserData    = userData,
                                            Images      = new List <GetUserStoriesObject.StoryObject.Image>(),
                                            Videos      = new List <GetUserStoriesObject.StoryObject.Video>()
                                            {
                                                new GetUserStoriesObject.StoryObject.Video()
                                                {
                                                    StoryId  = result.StoryId,
                                                    Filename = DataPost.StoryFilePath,
                                                    Id       = time2,
                                                    Expire   = time2,
                                                    Type     = "video",
                                                }
                                            }
                                        },
                                    },
                                    UserId                = userData?.UserId,
                                    Username              = userData?.Username,
                                    Email                 = userData?.Email,
                                    FirstName             = userData?.FirstName,
                                    LastName              = userData?.LastName,
                                    Avatar                = userData?.Avatar,
                                    Cover                 = userData?.Cover,
                                    BackgroundImage       = userData?.BackgroundImage,
                                    RelationshipId        = userData?.RelationshipId,
                                    Address               = userData?.Address,
                                    Working               = userData?.Working,
                                    Gender                = userData?.Gender,
                                    Facebook              = userData?.Facebook,
                                    Google                = userData?.Google,
                                    Twitter               = userData?.Twitter,
                                    Linkedin              = userData?.Linkedin,
                                    Website               = userData?.Website,
                                    Instagram             = userData?.Instagram,
                                    WebDeviceId           = userData?.WebDeviceId,
                                    Language              = userData?.Language,
                                    IpAddress             = userData?.IpAddress,
                                    PhoneNumber           = userData?.PhoneNumber,
                                    Timezone              = userData?.Timezone,
                                    Lat                   = userData?.Lat,
                                    Lng                   = userData?.Lng,
                                    About                 = userData?.About,
                                    Birthday              = userData?.Birthday,
                                    Registered            = userData?.Registered,
                                    Lastseen              = userData?.Lastseen,
                                    LastLocationUpdate    = userData?.LastLocationUpdate,
                                    Balance               = userData?.Balance,
                                    Verified              = userData?.Verified,
                                    Status                = userData?.Status,
                                    Active                = userData?.Active,
                                    Admin                 = userData?.Admin,
                                    IsPro                 = userData?.IsPro,
                                    ProType               = userData?.ProType,
                                    School                = userData?.School,
                                    Name                  = userData?.Name,
                                    AndroidMDeviceId      = userData?.AndroidMDeviceId,
                                    ECommented            = userData?.ECommented,
                                    AndroidNDeviceId      = userData?.AndroidMDeviceId,
                                    AvatarFull            = userData?.AvatarFull,
                                    BirthPrivacy          = userData?.BirthPrivacy,
                                    CanFollow             = userData?.CanFollow,
                                    ConfirmFollowers      = userData?.ConfirmFollowers,
                                    CountryId             = userData?.CountryId,
                                    EAccepted             = userData?.EAccepted,
                                    EFollowed             = userData?.EFollowed,
                                    EJoinedGroup          = userData?.EJoinedGroup,
                                    ELastNotif            = userData?.ELastNotif,
                                    ELiked                = userData?.ELiked,
                                    ELikedPage            = userData?.ELikedPage,
                                    EMentioned            = userData?.EMentioned,
                                    EProfileWallPost      = userData?.EProfileWallPost,
                                    ESentmeMsg            = userData?.ESentmeMsg,
                                    EShared               = userData?.EShared,
                                    EVisited              = userData?.EVisited,
                                    EWondered             = userData?.EWondered,
                                    EmailNotification     = userData?.EmailNotification,
                                    FollowPrivacy         = userData?.FollowPrivacy,
                                    FriendPrivacy         = userData?.FriendPrivacy,
                                    GenderText            = userData?.GenderText,
                                    InfoFile              = userData?.InfoFile,
                                    IosMDeviceId          = userData?.IosMDeviceId,
                                    IosNDeviceId          = userData?.IosNDeviceId,
                                    IsFollowing           = userData?.IsFollowing,
                                    IsFollowingMe         = userData?.IsFollowingMe,
                                    LastAvatarMod         = userData?.LastAvatarMod,
                                    LastCoverMod          = userData?.LastCoverMod,
                                    LastDataUpdate        = userData?.LastDataUpdate,
                                    LastFollowId          = userData?.LastFollowId,
                                    LastLoginData         = userData?.LastLoginData,
                                    LastseenStatus        = userData?.LastseenStatus,
                                    LastseenTimeText      = userData?.LastseenTimeText,
                                    LastseenUnixTime      = userData?.LastseenUnixTime,
                                    MessagePrivacy        = userData?.MessagePrivacy,
                                    NewEmail              = userData?.NewEmail,
                                    NewPhone              = userData?.NewPhone,
                                    NotificationSettings  = userData?.NotificationSettings,
                                    NotificationsSound    = userData?.NotificationsSound,
                                    OrderPostsBy          = userData?.OrderPostsBy,
                                    PaypalEmail           = userData?.PaypalEmail,
                                    PostPrivacy           = userData?.PostPrivacy,
                                    Referrer              = userData?.Referrer,
                                    ShareMyData           = userData?.ShareMyData,
                                    ShareMyLocation       = userData?.ShareMyLocation,
                                    ShowActivitiesPrivacy = userData?.ShowActivitiesPrivacy,
                                    TwoFactor             = userData?.TwoFactor,
                                    TwoFactorVerified     = userData?.TwoFactorVerified,
                                    Url                   = userData?.Url,
                                    VisitPrivacy          = userData?.VisitPrivacy,
                                    Vk             = userData?.Vk,
                                    Wallet         = userData?.Wallet,
                                    WorkingLink    = userData?.WorkingLink,
                                    Youtube        = userData?.Youtube,
                                    City           = userData?.City,
                                    Points         = userData?.Points,
                                    DailyPoints    = userData?.DailyPoints,
                                    State          = userData?.State,
                                    Zip            = userData?.Zip,
                                    IsAdmin        = userData?.IsAdmin,
                                    IsBlocked      = userData?.IsBlocked,
                                    MemberId       = userData?.MemberId,
                                    PointDayExpire = userData?.PointDayExpire,
                                    UserPlatform   = userData?.UserPlatform,
                                    Details        = new DetailsUnion()
                                    {
                                        DetailsClass = new Details(),
                                    },
                                };

                                var duration = WoWonderTools.GetDuration(DataPost.StoryFilePath);

                                if (item.DurationsList == null)
                                {
                                    item.DurationsList = new List <long>()
                                    {
                                        Long.ParseLong(duration)
                                    }
                                }
                                ;
                                else
                                {
                                    item.DurationsList.Add(Long.ParseLong(duration));
                                }

                                modelStory.StoryList?.Add(item);
                            }
                        }

                        modelStory.NotifyDataSetChanged();
                        GlobalContextTabbed.LastStoriesTab.ShowEmptyPage();

                        if (SettingsPrefFragment.SSoundControl)
                        {
                            Methods.AudioRecorderAndPlayer.PlayAudioFromAsset("PopNotificationPost.mp3");
                        }
                    }
                }
                else
                {
                    Methods.DisplayReportResult(GlobalContextTabbed, respond);
                }

                RemoveNotification();
            }
            catch (Exception e)
            {
                RemoveNotification();
                Console.WriteLine(e);
            }
        }
Beispiel #4
0
        public void MoreCommentPostClick(CommentObject item)
        {
            try
            {
                if (Methods.CheckConnectivity())
                {
                    TypeDialog    = "MoreComment";
                    CommentObject = item;

                    var arrayAdapter = new List <string>();
                    var dialogList   = new MaterialDialog.Builder(MainContext).Theme(AppSettings.SetTabDarkTheme ? Theme.Dark : Theme.Light);

                    arrayAdapter.Add(Context.GetString(Resource.String.Lbl_CopeText));

                    if (CommentObject?.IsCommentOwner != null && (bool)CommentObject?.IsCommentOwner || CommentObject?.CommentUserData?.Id == UserDetails.UserId)
                    {
                        arrayAdapter.Add(Context.GetString(Resource.String.Lbl_Edit));
                        arrayAdapter.Add(Context.GetString(Resource.String.Lbl_Delete));
                    }

                    dialogList.Title(Context.GetString(Resource.String.Lbl_More));
                    dialogList.Items(arrayAdapter);
                    dialogList.PositiveText(MainContext.GetText(Resource.String.Lbl_Close)).OnNegative(this);
                    dialogList.AlwaysCallSingleChoiceCallback();
                    dialogList.ItemsCallback(this).Build().Show();
                }
                else
                {
                    Toast.MakeText(MainContext, MainContext.GetText(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short).Show();
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
Beispiel #5
0
        private void OnUnLikeButtonClick(object sender, EventArgs e)
        {
            try
            {
                if (Methods.CheckConnectivity())
                {
                    if (UserDetails.IsLogin)
                    {
                        dynamic dataComments = Type == "video" ? ActivityContext?.CommentsFragment?.MAdapter?.CommentList?.FirstOrDefault(a => a.Id == Comment.Id) : ShowArticleActivity.MAdapter?.CommentList?.FirstOrDefault(a => a.Id == Comment.Id);

                        if (dataComments != null)
                        {
                            if (UnLikeButton.Tag.ToString() == "1")
                            {
                                UnLikeiconView.SetColorFilter(Color.ParseColor("#777777"));

                                UnLikeButton.Tag = "0";
                                dataComments.IsDislikedComment = 0;

                                if (!UnLikeNumber.Text.Contains("K") && !UnLikeNumber.Text.Contains("M"))
                                {
                                    double x = Convert.ToDouble(UnLikeNumber.Text);
                                    if (x > 0)
                                    {
                                        x--;
                                    }
                                    else
                                    {
                                        x = 0;
                                    }
                                    UnLikeNumber.Text     = x.ToString(CultureInfo.InvariantCulture);
                                    dataComments.DisLikes = Convert.ToInt32(x);
                                }
                            }
                            else
                            {
                                UnLikeiconView.SetColorFilter(Color.ParseColor(AppSettings.MainColor));

                                UnLikeButton.Tag = "1";
                                dataComments.IsDislikedComment = 1;

                                if (!UnLikeNumber.Text.Contains("K") && !UnLikeNumber.Text.Contains("M"))
                                {
                                    double x = Convert.ToDouble(UnLikeNumber.Text);
                                    x++;
                                    UnLikeNumber.Text     = x.ToString(CultureInfo.InvariantCulture);
                                    dataComments.DisLikes = Convert.ToInt32(x);
                                }
                            }

                            if (LikeButton.Tag.ToString() == "1")
                            {
                                LikeiconView.SetColorFilter(Color.ParseColor("#777777"));

                                LikeButton.Tag = "0";
                                dataComments.IsLikedComment = 0;

                                if (!LikeNumber.Text.Contains("K") && !LikeNumber.Text.Contains("M"))
                                {
                                    double x = Convert.ToDouble(LikeNumber.Text);
                                    if (x > 0)
                                    {
                                        x--;
                                    }
                                    else
                                    {
                                        x = 0;
                                    }

                                    LikeNumber.Text    = x.ToString(CultureInfo.InvariantCulture);
                                    dataComments.Likes = Convert.ToInt32(x);
                                }
                            }
                            PollyController.RunRetryPolicyFunction(new List <Func <Task> > {
                                () => RequestsAsync.Comments.Add_likeOrDislike_Comment_Http(dataComments.Id.ToString(), false)
                            });
                        }
                    }
                    else
                    {
                        PopupDialogController dialog = new PopupDialogController(ActivityContext, null, "Login");
                        dialog.ShowNormalDialog(ActivityContext.GetText(Resource.String.Lbl_Warning),
                                                ActivityContext.GetText(Resource.String.Lbl_Please_sign_in_Dislike),
                                                ActivityContext.GetText(Resource.String.Lbl_Yes),
                                                ActivityContext.GetText(Resource.String.Lbl_No));
                    }
                }
                else
                {
                    Toast.MakeText(ActivityContext, ActivityContext.GetText(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short).Show();
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }