private void LoadPassedData(GroupClass result) { try { GlideImageLoader.LoadImage(this, result.Avatar, UserProfileImage, ImageStyle.CenterCrop, ImagePlaceholders.Color); Glide.With(this).Load(result.Cover.Replace(" ", "")).Apply(new RequestOptions().Placeholder(Resource.Drawable.Cover_image).Error(Resource.Drawable.Cover_image)).Into(CoverImage); TxtGroupUsername.Text = "@" + result.Username; TxtGroupName.Text = Methods.FunString.DecodeString(result.Name); CategoryText.Text = Methods.FunString.DecodeString(result.Category); if (result.UserId == UserDetails.UserId) { result.IsOwner = true; } if (result.IsOwner) { BtnJoin.BackgroundTintList = ColorStateList.ValueOf(Color.ParseColor(AppSettings.MainColor)); BtnJoin.Text = GetText(Resource.String.Lbl_Edit); BtnJoin.SetTextColor(Color.White); BtnJoin.Tag = "MyGroup"; BtnMore.BackgroundTintList = ColorStateList.ValueOf(Color.ParseColor(AppSettings.MainColor)); BtnMore.ImageTintList = ColorStateList.ValueOf(Color.White); } else { BtnJoin.BackgroundTintList = result.IsJoined == "yes" || result.IsJoined == "true" ? ColorStateList.ValueOf(Color.ParseColor("#efefef")) : ColorStateList.ValueOf(Color.ParseColor(AppSettings.MainColor)); BtnJoin.Text = GetText(result.IsJoined == "yes" || result.IsJoined == "true" ? Resource.String.Btn_Joined : Resource.String.Btn_Join_Group); BtnJoin.SetTextColor(result.IsJoined == "yes" || result.IsJoined == "true" ? Color.Black : Color.White); BtnMore.BackgroundTintList = result.IsJoined == "yes" || result.IsJoined == "true" ? ColorStateList.ValueOf(Color.ParseColor("#efefef")) : ColorStateList.ValueOf(Color.ParseColor(AppSettings.MainColor)); BtnMore.ImageTintList = result.IsJoined == "yes" || result.IsJoined == "true" ? ColorStateList.ValueOf(Color.Black) : ColorStateList.ValueOf(Color.White); BtnJoin.Tag = "UserGroup"; } if (result.IsOwner || result.IsJoined == "yes" || result.IsJoined == "true") { var checkSection = PostFeedAdapter.ListDiffer.FirstOrDefault(a => a.TypeView == PostModelType.AddPostBox); if (checkSection == null) { Combiner.AddPostBoxPostView("Group", -1, new PostDataObject() { GroupRecipient = result }); if (AppSettings.ShowSearchForPosts) { Combiner.SearchForPostsView("Group", new PostDataObject() { GroupRecipient = result }); } PostFeedAdapter.NotifyItemInserted(PostFeedAdapter.ListDiffer.Count - 1); } } PrivacyText.Text = GetText(result.Privacy == "1" ? Resource.String.Radio_Public : Resource.String.Radio_Private); if (result.Privacy != "1") { IconPrivacy.SetImageResource(Resource.Drawable.ic_private); } if (result.IsOwner) { EditAvatarImageGroup.Visibility = ViewStates.Visible; TxtEditGroupInfo.Visibility = ViewStates.Visible; } else { EditAvatarImageGroup.Visibility = ViewStates.Gone; TxtEditGroupInfo.Visibility = ViewStates.Gone; } if (result.Privacy == "1" || result.IsOwner) { PollyController.RunRetryPolicyFunction(new List <Func <Task> > { () => MainRecyclerView.FetchNewsFeedApiPosts() }); } else { if (PostFeedAdapter.ListDiffer.FirstOrDefault(a => a.IsDefaultFeedPost) != null) { var emptyStateChecker = PostFeedAdapter.ListDiffer.FirstOrDefault(a => a.TypeView == PostModelType.EmptyState); if (emptyStateChecker != null && PostFeedAdapter.ListDiffer.Count > 1) { PostFeedAdapter.ListDiffer.Remove(emptyStateChecker); } } else { var emptyStateChecker = PostFeedAdapter.ListDiffer.FirstOrDefault(a => a.TypeView == PostModelType.EmptyState); if (emptyStateChecker == null) { PostFeedAdapter.ListDiffer.Add(new AdapterModelsClass { TypeView = PostModelType.EmptyState, Id = 744747447 }); } } PostFeedAdapter.NotifyDataSetChanged(); } } catch (Exception e) { Console.WriteLine(e); } }