void ReleaseDesignerOutlets() { if (FavoritesTableView != null) { FavoritesTableView.Dispose(); FavoritesTableView = null; } if (ListSegmentedControl != null) { ListSegmentedControl.Dispose(); ListSegmentedControl = null; } if (UserImageView != null) { UserImageView.Dispose(); UserImageView = null; } if (UserLabel != null) { UserLabel.Dispose(); UserLabel = null; } }
void ReleaseDesignerOutlets() { if (UserImageView != null) { UserImageView.Dispose(); UserImageView = null; } if (UserTagLabel != null) { UserTagLabel.Dispose(); UserTagLabel = null; } if (UsernameLabel != null) { UsernameLabel.Dispose(); UsernameLabel = null; } if (FollowButton != null) { FollowButton.Dispose(); FollowButton = null; } }
private void SetDataToView() { // user information if (!string.IsNullOrEmpty(App.CurrentUserEnvironment.User.UserPicture)) { var bytes = Convert.FromBase64String(App.CurrentUserEnvironment.User.UserPicture); UserImageView.SetImageBitmap(BitmapFactory.DecodeByteArray(bytes, 0, bytes.Length)); } else { UserImageView.SetImageResource(Resource.Drawable.DefaultUser); } FirstNameEditText.Text = App.CurrentUserEnvironment.User.FirstName; LastNameEditText.Text = App.CurrentUserEnvironment.User.LastName; EmailEditText.Text = App.CurrentUserEnvironment.User.Email; SaveButton.Enabled = false; /*if (!string.IsNullOrEmpty(App.CurrentUserEnvironment.User.PhoneNumber)) * { * var phoneNumber = App.CurrentUserEnvironment.User.PhoneNumber.Split('|'); * if (phoneNumber != null && phoneNumber.Length == 2) * { * var countries = CustomComponents.CountryCode.Country.GetCustomMasterCountryList(CodeCountryLayout); * if (phoneNumber[0].Contains("+")) phoneNumber[0] = phoneNumber[0].Substring(1, phoneNumber[0].Length - 1); * CodeCountryLayout.SetSelectedCountry(countries.Find(f => f.PhoneCode == phoneNumber[0])); * PhoneNumberEditText.Text = phoneNumber[1]; * } * }*/ //PhoneNumberEditText.SetFilters(new IInputFilter[] { new InputFilterLengthFilter(NumberOfDigitPhoneNumber()) }); }
void ReleaseDesignerOutlets() { if (OwnerImageView != null) { OwnerImageView.Dispose(); OwnerImageView = null; } if (CaptionLabel != null) { CaptionLabel.Dispose(); CaptionLabel = null; } if (ContentLabel != null) { ContentLabel.Dispose(); ContentLabel = null; } if (FollowersImageVIew != null) { FollowersImageVIew.Dispose(); FollowersImageVIew = null; } if (FollowersLabel != null) { FollowersLabel.Dispose(); FollowersLabel = null; } if (ForksImageView != null) { ForksImageView.Dispose(); ForksImageView = null; } if (ForksLabel != null) { ForksLabel.Dispose(); ForksLabel = null; } if (UserImageView != null) { UserImageView.Dispose(); UserImageView = null; } if (UserLabel != null) { UserLabel.Dispose(); UserLabel = null; } }
public override void ViewDidLoad() { base.ViewDidLoad(); SetPickerToView(); App.Locator.Parameter.OnUserChanged += Parameter_OnUserChanged; AboutButton.TouchUpInside += AboutButton_TouchUpInside; LogOutButton.TouchUpInside += LogOutButton_TouchUpInside; ModifyUserImageButton.TouchUpInside += ModifyUserImageButton_TouchUpInside; UserImageView.AddGestureRecognizer(new UITapGestureRecognizer(() => { ModifyUserImageButton_TouchUpInside(null, null); })); SaveButton.TouchUpInside += SaveButton_TouchUpInside; UpdatePasswordButton.TouchUpInside += UpdatePasswordButton_TouchUpInside; App.RemainingRequestChanged += OnRemainingRequestChanged; }
/// <summary> /// Take a picture from the camera or the library /// </summary> private void PickImageFromCameraOrGallery_Click(object sender, EventArgs e) { var lastImage = UserImageView.GetHashCode(); var options = new[] { Resources.GetString(Resource.String.addSeekios_takePicture), Resources.GetString(Resource.String.addSeekios_gallery), Resources.GetString(Resource.String.addSeekios_clearImage) }; var builder = new AlertDialog.Builder(this, Resource.Style.Theme_AppCompat_Light_Dialog); builder.SetTitle(Resource.String.addSeekios_modifyPicture); builder.SetItems(options, (innersender, innerargs) => { if (innerargs.Which == 0) { _isFromGallery = false; if (_cameraService != null) { _cameraService.TakePictureFromCamera(); } EnableSaveButton(); } else if (innerargs.Which == 1) { _isFromGallery = true; if (_cameraService != null) { _cameraService.TakePictureFromGallery(Resources.GetString(Resource.String.addSeekios_addPicture)); } EnableSaveButton(); } else if (innerargs.Which == 2) { var image = Resource.Drawable.DefaultUser; var drawable = Resources.GetDrawable(image); using (Bitmap bitmap = ((BitmapDrawable)drawable).Bitmap) using (var stream = new System.IO.MemoryStream()) { bitmap.Compress(Bitmap.CompressFormat.Jpeg, 100, stream); var bitMapData = stream.ToArray(); App.Locator.Parameter.UserPicture = bitMapData; } UserImageView.SetImageResource(image); EnableSaveButton(); } }); builder.Show(); }
void ReleaseDesignerOutlets() { if (DescriptionLabel != null) { DescriptionLabel.Dispose(); DescriptionLabel = null; } if (LikeButton != null) { LikeButton.Dispose(); LikeButton = null; } if (LikesCountLabel != null) { LikesCountLabel.Dispose(); LikesCountLabel = null; } if (PostImageView != null) { PostImageView.Dispose(); PostImageView = null; } if (UserImageView != null) { UserImageView.Dispose(); UserImageView = null; } if (UserTagLabel != null) { UserTagLabel.Dispose(); UserTagLabel = null; } if (DeleteButton != null) { DeleteButton.Dispose(); DeleteButton = null; } }
void ReleaseDesignerOutlets() { if (UserEmailLabel != null) { UserEmailLabel.Dispose(); UserEmailLabel = null; } if (UserImageView != null) { UserImageView.Dispose(); UserImageView = null; } if (UsernameLabel != null) { UsernameLabel.Dispose(); UsernameLabel = null; } }
/// <summary> /// Callback to pick the picture between the camera or the gallery /// </summary> protected override void OnActivityResult(int requestCode, Result resultCode, Intent data) { base.OnActivityResult(requestCode, resultCode, data); Bitmap bitmap = null; if (resultCode == Result.Ok && _isFromGallery && data != null && data.Data != null) { if (_cameraService != null) { bitmap = _cameraService.GetPictureFromGallery(data.Data); } } else if (resultCode == Result.Ok) { if (_cameraService != null) { bitmap = _cameraService.GetPictureFromCamera(); } } if (bitmap != null) { // Update the seekios image UserImageView.SetImageBitmap(bitmap); bitmap.Dispose(); // Put the image in the ViewModel for the update in bdd if (_cameraService != null) { App.Locator.Parameter.UserPicture = _cameraService.PictureBinary; } GC.Collect(); } }
void InitUI() { // Adjust constraints as needed PhotoImageViewHeightConstraint.Constant = ViewModel.ShowImage ? _photoImageViewDefaultHeightConstraint : 0; // Map values to UI elements BodyTextView.Text = null; BodyTextView.Text = ViewModel.Text; BodyTextViewHeightConstraint.Constant = BodyTextView.SizeThatFits(new CGSize(BodyTextView.Frame.Width, nfloat.MaxValue)).Height; TimeLabel.Text = ViewModel.ShowDateTime ? ViewModel.DisplayDateTime : string.Empty; NameLabel.SetHighlightText(ViewModel.UserName, ViewModel.UserName.IndexOf("@"), UIColor.LightGray); LikeButton.SetTitle(ViewModel.LikeButtonText, UIControlState.Normal); LikeButton.SetTitleColor(ViewModel.LikeButtonTextColor.ToUIColor(), UIControlState.Normal); CommentButton.SetTitle(ViewModel.CommentButtonText, UIControlState.Normal); CommentButton.SetTitleColor(ViewModel.CommentButtonTextColor.ToUIColor(), UIControlState.Normal); ShareButton.SetTitle(ViewModel.ShareButtonText, UIControlState.Normal); ShareButton.SetTitleColor(ViewModel.ShareButtonTextColor.ToUIColor(), UIControlState.Normal); if (ViewModel.ShowImage) { ActivityIndicator.StartAnimating(); } else { ActivityIndicator.StopAnimating(); } SocialTypeImageView.Image = UIImage.FromBundle(ViewModel.SocialMediaImage); SocialTypeImageView.Hidden = !ViewModel.ShowSocialMediaImage; UserImageView.SetImage( url: new NSUrl(ViewModel.UserImageUrl), placeholder: UIImage.FromBundle(ViewModel.UserImagePlaceholder) ); if (ViewModel.ShowImage) { PhotoImageView.SetImage( url: new NSUrl(ViewModel.ImageUrl), completionHandler: ((UIImage image, NSError error, SDImageCacheType cacheType, NSUrl imageUrl) => { ActivityIndicator.StopAnimating(); }) ); } else { PhotoImageView.Image = null; } if (ViewModel.ShowTimeline) { ContainerViewLeadingConstraint.Constant = _containerViewTimelineLeadingConstraint; TimelineView.Hidden = false; } else { ContainerViewLeadingConstraint.Constant = _containerViewDefaultLeadingConstraint; TimelineView.Hidden = true; } CommentButton.Hidden = !ViewModel.ShowCommentButton; ShareButton.Hidden = !ViewModel.ShowShareButton; // TODO: Remove this when we're ready to support sharing ShareButton.Hidden = true; }
void ReleaseDesignerOutlets() { if (AddPostButton != null) { AddPostButton.Dispose(); AddPostButton = null; } if (EditUserButton != null) { EditUserButton.Dispose(); EditUserButton = null; } if (FriendsButton != null) { FriendsButton.Dispose(); FriendsButton = null; } if (HomeButton != null) { HomeButton.Dispose(); HomeButton = null; } if (ProfileButton != null) { ProfileButton.Dispose(); ProfileButton = null; } if (UserBioLabel != null) { UserBioLabel.Dispose(); UserBioLabel = null; } if (UserFollowersLabel != null) { UserFollowersLabel.Dispose(); UserFollowersLabel = null; } if (UserFollowingLabel != null) { UserFollowingLabel.Dispose(); UserFollowingLabel = null; } if (UserImageView != null) { UserImageView.Dispose(); UserImageView = null; } if (UsernameLabel != null) { UsernameLabel.Dispose(); UsernameLabel = null; } if (UserPostsCollectionView != null) { UserPostsCollectionView.Dispose(); UserPostsCollectionView = null; } if (UserPostsLabel != null) { UserPostsLabel.Dispose(); UserPostsLabel = null; } if (UserTagLabel != null) { UserTagLabel.Dispose(); UserTagLabel = null; } if (LogoutButton != null) { LogoutButton.Dispose(); LogoutButton = null; } }
public override void ViewDidLoad() { base.ViewDidLoad(); // button click seekios tutorial SeekiosTutorialButton.AddGestureRecognizer(new UITapGestureRecognizer(() => { NavigationService.LeftMenuView.RevealViewController().RightRevealToggleAnimated(true); App.Locator.LeftMenu.GoToListTutorial(); })); // button click my consomation HistoriqueConsommationButton.AddGestureRecognizer(new UITapGestureRecognizer(() => { NavigationService.LeftMenuView.RevealViewController().RightRevealToggleAnimated(true); App.Locator.Credits.GoToCreditHistoric(); })); // button click on add a seekios AddSeekiosButton.AddGestureRecognizer(new UITapGestureRecognizer(() => { NavigationService.LeftMenuView.RevealViewController().RightRevealToggleAnimated(true); App.Locator.LeftMenu.GoToAddSeekios(); })); // button click on map all seekios MapButton.AddGestureRecognizer(new UITapGestureRecognizer(() => { if (App.CurrentUserEnvironment.LsSeekios.Count == 0) { AlertControllerHelper.ShowAlert(Application.LocalizedString("ZeroSeekios") , Application.LocalizedString("NeedAtLeastOneSeekios") , Application.LocalizedString("Close")); } else { if (App.CurrentUserEnvironment.LsSeekios.All(a => a.LastKnownLocation_latitude == App.DefaultLatitude && a.LastKnownLocation_longitude == App.DefaultLongitude)) { if (App.CurrentUserEnvironment.LsSeekios.Count == 1) { AlertControllerHelper.ShowAlert(Application.LocalizedString("NoPosition") , Application.LocalizedString("OneSeekiosNewlyAdded") , Application.LocalizedString("Close")); } else { AlertControllerHelper.ShowAlert(Application.LocalizedString("NoPosition") , Application.LocalizedString("PluralSeekiosNewlyAdded") , Application.LocalizedString("Close")); } } else { NavigationService.LeftMenuView.RevealViewController().RightRevealToggleAnimated(true); App.Locator.LeftMenu.GoToSeekiosMapAllSeekios(); } } })); // button click on feedback FeedbackButton.AddGestureRecognizer(new UITapGestureRecognizer(() => { var feedbackManager = BITHockeyManager.SharedHockeyManager.FeedbackManager; feedbackManager.ShowFeedbackListView(); feedbackManager.ShowFeedbackComposeView(); NavigationService.LeftMenuView.RevealViewController().RightRevealToggleAnimated(true); })); // button click on Parameter UserImageView.UserInteractionEnabled = true; UserImageView.AddGestureRecognizer(new UITapGestureRecognizer(() => { NavigationService.LeftMenuView.RevealViewController().RightRevealToggleAnimated(true); App.Locator.LeftMenu.GoToParameter(); })); EmailUser.AddGestureRecognizer(new UITapGestureRecognizer(() => { NavigationService.LeftMenuView.RevealViewController().RightRevealToggleAnimated(true); App.Locator.LeftMenu.GoToParameter(); })); NameUser.AddGestureRecognizer(new UITapGestureRecognizer(() => { NavigationService.LeftMenuView.RevealViewController().RightRevealToggleAnimated(true); App.Locator.LeftMenu.GoToParameter(); })); SettingsImageView.AddGestureRecognizer(new UITapGestureRecognizer(() => { NavigationService.LeftMenuView.RevealViewController().RightRevealToggleAnimated(true); App.Locator.LeftMenu.GoToParameter(); })); CreditsTitleLabel.AddGestureRecognizer(new UITapGestureRecognizer(() => { NavigationService.LeftMenuView.RevealViewController().RightRevealToggleAnimated(true); App.Locator.LeftMenu.GoToParameter(); })); CreditsLabel.AddGestureRecognizer(new UITapGestureRecognizer(() => { NavigationService.LeftMenuView.RevealViewController().RightRevealToggleAnimated(true); App.Locator.LeftMenu.GoToParameter(); })); }
void ReleaseDesignerOutlets() { if (BackButton != null) { BackButton.Dispose(); BackButton = null; } if (ButtomKisitlamaa != null) { ButtomKisitlamaa.Dispose(); ButtomKisitlamaa = null; } if (ChatArkaHazne != null) { ChatArkaHazne.Dispose(); ChatArkaHazne = null; } if (ChatTableView != null) { ChatTableView.Dispose(); ChatTableView = null; } if (FavButton != null) { FavButton.Dispose(); FavButton = null; } if (GonderButton != null) { GonderButton.Dispose(); GonderButton = null; } if (HazirMesajlarScroll != null) { HazirMesajlarScroll.Dispose(); HazirMesajlarScroll = null; } if (HeaderView != null) { HeaderView.Dispose(); HeaderView = null; } if (HediyeButton != null) { HediyeButton.Dispose(); HediyeButton = null; } if (MesajBGVieww != null) { MesajBGVieww.Dispose(); MesajBGVieww = null; } if (MesajText != null) { MesajText.Dispose(); MesajText = null; } if (UserImageView != null) { UserImageView.Dispose(); UserImageView = null; } if (UserNameLabel != null) { UserNameLabel.Dispose(); UserNameLabel = null; } }