void ReleaseDesignerOutlets() { if (BtnFacebook != null) { BtnFacebook.Dispose(); BtnFacebook = null; } if (BtnGoogle != null) { BtnGoogle.Dispose(); BtnGoogle = null; } if (BtnTwitter != null) { BtnTwitter.Dispose(); BtnTwitter = null; } if (BtnLinkedIn != null) { BtnLinkedIn.Dispose(); BtnLinkedIn = null; } if (ImgVUser != null) { ImgVUser.Dispose(); ImgVUser = null; } if (LblDescription != null) { LblDescription.Dispose(); LblDescription = null; } if (LblName != null) { LblName.Dispose(); LblName = null; } }
private void LoadDataUser(UserDataObject data) { try { //Cover GlideImageLoader.LoadImage(this, data.Cover, ImageUserCover, ImageStyle.CenterCrop, ImagePlaceholders.Drawable); //profile_picture GlideImageLoader.LoadImage(this, data.Avatar, ImageUserProfile, ImageStyle.CircleCrop, ImagePlaceholders.Drawable); TextSanitizer sanitizer = new TextSanitizer(TxtAbout, this); sanitizer.Load(WoWonderTools.GetAboutFinal(data)); TxtFullname.Text = WoWonderTools.GetNameFinal(data); TxtUserName.Text = "@" + data.Username; if (data.Details.DetailsClass != null) { var following = Methods.FunString.FormatPriceValue(Convert.ToInt32(data.Details.DetailsClass?.FollowingCount)); var followers = Methods.FunString.FormatPriceValue(Convert.ToInt32(data.Details.DetailsClass?.FollowersCount)); if (AppSettings.ConnectivitySystem == 1) { TxtFollowing.Visibility = ViewStates.Visible; TxtFollowingCount.Visibility = ViewStates.Visible; TxtFollowers.Visibility = ViewStates.Visible; TxtFollowersCount.Visibility = ViewStates.Visible; TxtFollowing.Text = GetText(Resource.String.Lbl_Following); TxtFollowingCount.Text = following; TxtFollowers.Text = GetText(Resource.String.Lbl_Followers); TxtFollowersCount.Text = followers; } else { TxtFollowing.Visibility = ViewStates.Visible; TxtFollowingCount.Visibility = ViewStates.Visible; TxtFollowers.Visibility = ViewStates.Gone; TxtFollowersCount.Visibility = ViewStates.Gone; TxtFollowing.Text = GetText(Resource.String.Lbl_Friends); TxtFollowingCount.Text = following; } } switch (data.IsFollowing) { // My Friend case "1": AddFriendOrFollowButton.Visibility = ViewStates.Visible; AddFriendOrFollowButton.SetColor(Color.ParseColor(AppSettings.MainColor)); AddFriendOrFollowButton.SetImageResource(Resource.Drawable.ic_tick); AddFriendOrFollowButton.Tag = "friends"; break; // Request case "2": AddFriendOrFollowButton.Visibility = ViewStates.Visible; AddFriendOrFollowButton.SetColor(Color.ParseColor(AppSettings.MainColor)); AddFriendOrFollowButton.SetImageResource(Resource.Drawable.ic_requestAdd); AddFriendOrFollowButton.Tag = "request"; break; //Not Friend case "0": AddFriendOrFollowButton.Visibility = ViewStates.Visible; AddFriendOrFollowButton.SetColor(Color.ParseColor("#8c8a8a")); AddFriendOrFollowButton.SetImageResource(Resource.Drawable.ic_add); AddFriendOrFollowButton.Tag = "Add"; break; } if (Methods.FunString.StringNullRemover(data.Gender) != "Empty") { TxtGenderText.Text = data.Gender.ToLower() switch { "male" => GetText(Resource.String.Radio_Male), "female" => GetText(Resource.String.Radio_Female), _ => data.Gender }; GenderLiner.Visibility = ViewStates.Visible; } else { GenderLiner.Visibility = ViewStates.Gone; } if (Methods.FunString.StringNullRemover(data.Address) != "Empty") { LocationLiner.Visibility = ViewStates.Visible; TxtLocationText.Text = data.Address; } else { LocationLiner.Visibility = ViewStates.Gone; } if (AppSettings.EnableShowPhoneNumber) { if (Methods.FunString.StringNullRemover(data.PhoneNumber) != "Empty") { MobileLiner.Visibility = ViewStates.Visible; TxtMobileText.Text = data.PhoneNumber; } else { MobileLiner.Visibility = ViewStates.Gone; } } else { MobileLiner.Visibility = ViewStates.Gone; } if (Methods.FunString.StringNullRemover(data.Website) != "Empty") { WebsiteLiner.Visibility = ViewStates.Visible; TxtWebsiteText.Text = data.Website; } else { WebsiteLiner.Visibility = ViewStates.Gone; } if (Methods.FunString.StringNullRemover(data.Working) != "Empty") { WorkLiner.Visibility = ViewStates.Visible; TxtWorkText.Text = data.Working; } else { WorkLiner.Visibility = ViewStates.Gone; } if (Methods.FunString.StringNullRemover(data.Facebook) == "Empty") { BtnFacebook.Enabled = false; BtnFacebook.SetColor(Color.ParseColor("#8c8a8a")); } else { BtnFacebook.Enabled = true; } if (Methods.FunString.StringNullRemover(data.Google) == "Empty") { BtnGoogle.Enabled = false; BtnGoogle.SetColor(Color.ParseColor("#8c8a8a")); } else { BtnGoogle.Enabled = true; } if (Methods.FunString.StringNullRemover(data.Twitter) == "Empty") { BtnTwitter.Enabled = false; BtnTwitter.SetColor(Color.ParseColor("#8c8a8a")); } else { BtnTwitter.Enabled = true; } if (Methods.FunString.StringNullRemover(data.Youtube) == "Empty") { BtnYoutube.Enabled = false; BtnYoutube.SetColor(Color.ParseColor("#8c8a8a")); } else { BtnYoutube.Enabled = true; } if (Methods.FunString.StringNullRemover(data.Vk) == "Empty") { BtnVk.Enabled = false; BtnVk.SetColor(Color.ParseColor("#8c8a8a")); } else { BtnVk.Enabled = true; } if (Methods.FunString.StringNullRemover(data.Instagram) == "Empty") { BtnInstegram.Enabled = false; BtnInstegram.SetColor(Color.ParseColor("#8c8a8a")); } else { BtnInstegram.Enabled = true; } } catch (Exception e) { Console.WriteLine(e); } }