void ReleaseDesignerOutlets() { if (ImageView != null) { ImageView.Dispose(); ImageView = null; } if (ClassificationLabel != null) { ClassificationLabel.Dispose(); ClassificationLabel = null; } if (CameraButton != null) { CameraButton.Dispose(); CameraButton = null; } if (GalleryButton != null) { GalleryButton.Dispose(); GalleryButton = null; } }
public override void ViewDidLoad() { base.ViewDidLoad(); GalleryButton.SetCommand(ViewModel.GalleryCommand); CameraButton.SetCommand(ViewModel.CameraCommand); }
private GalleryButton BuildGalleryButton(object data, BuildContext bc, string strElmDims) { GalleryElementDimensions elmDims; // If elmDims is null, try to get the value from data if (string.IsNullOrEmpty(strElmDims)) { JSObject attrs = DataNodeWrapper.GetNodeAttributes(data); strElmDims = DataNodeWrapper.GetAttribute(attrs, DataNodeWrapper.ELEMENTDIMENSIONS); } // If elmDims is still null (no value defined in data), default to 32x32 if (string.IsNullOrEmpty(strElmDims)) { elmDims = GalleryElementDimensions.Size32by32; } else { elmDims = Gallery.ConvertStringToGalleryElementDimensions(strElmDims); } GalleryButtonProperties properties = DataNodeWrapper.GetNodeAttributes(data).To <GalleryButtonProperties>(); GalleryButton gb = new GalleryButton(Root, properties.Id, properties, elmDims); return(gb); }
public void With_Should_Add_Current_GalleryButton_And_Set_Parent() { var actual = new GalleryButton("MyGalleryButton"); _sut.With(() => actual); Assert.IsTrue(_sut._galleryButtons.Contains(actual)); Assert.AreEqual(actual.Parent,_sut); }
/// <summary> /// Sets gallery button attributes. /// </summary> private void SetGalleryButtonAtrributes() { //get current view dimensions GalleryButton.SizeToFit(); var screenHeight = View.Frame.Height - Constants.NavBarHeight; var screenWidth = View.Frame.Width; SetButtonProperties(GalleryButton); //adjust the button position after every rotation GalleryButton.Frame = new CGRect( 0, screenHeight / SharedConstants.NumberOfImageUploadComponents + Constants.NavBarHeight, screenWidth, screenHeight / SharedConstants.NumberOfImageUploadComponents); GalleryButton.SetImage(GalleryButton.ImageView.Image.ImageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal), UIControlState.Normal); var btnScaler = GalleryButton.ImageView.Frame.Height / 2 - Constants.UploadBtnVerticalOffset; GalleryButton.ImageEdgeInsets = new UIEdgeInsets( -btnScaler, (GalleryButton.Frame.Width - GalleryButton.ImageView.Frame.Width + Constants.UploadBtnHorizontalOffset) / 2, btnScaler, (GalleryButton.Frame.Width - GalleryButton.ImageView.Frame.Width - Constants.UploadBtnHorizontalOffset) / 2); GalleryButton.TitleEdgeInsets = new UIEdgeInsets(btnScaler, -GalleryButton.ImageView.Frame.Width, -btnScaler, 0); GalleryButton.ContentEdgeInsets = new UIEdgeInsets( btnScaler, 0, btnScaler, 0); }
void ReleaseDesignerOutlets() { if (GalleryButton != null) { GalleryButton.Dispose(); GalleryButton = null; } if (PhotoUploadButton != null) { PhotoUploadButton.Dispose(); PhotoUploadButton = null; } }
void ReleaseDesignerOutlets() { if (CameraButton != null) { CameraButton.Dispose(); CameraButton = null; } if (ChatBackground != null) { ChatBackground.Dispose(); ChatBackground = null; } if (ChatScrollView != null) { ChatScrollView.Dispose(); ChatScrollView = null; } if (GalleryButton != null) { GalleryButton.Dispose(); GalleryButton = null; } if (LoadingIndicatorView != null) { LoadingIndicatorView.Dispose(); LoadingIndicatorView = null; } if (SendButton != null) { SendButton.Dispose(); SendButton = null; } if (SmileyButton != null) { SmileyButton.Dispose(); SmileyButton = null; } if (TextField != null) { TextField.Dispose(); TextField = null; } }
void ReleaseDesignerOutlets() { if (AudioButton != null) { AudioButton.Dispose(); AudioButton = null; } if (flashButton != null) { flashButton.Dispose(); flashButton = null; } if (GalleryButton != null) { GalleryButton.Dispose(); GalleryButton = null; } if (liveCameraStreamView != null) { liveCameraStreamView.Dispose(); liveCameraStreamView = null; } if (SwitchCameraButton != null) { SwitchCameraButton.Dispose(); SwitchCameraButton = null; } if (TakePhotoButton != null) { TakePhotoButton.Dispose(); TakePhotoButton = null; } }
public void Setup() { _sut = GalleryButton.Create("MyGalleryButton", ElementDimension.Size16by16); }
public void SetGalleryText(GalleryButton but) { selGallery = but.transform.GetSiblingIndex(); UpdateGalleryText(); }
public void Indexer_Should_Return_GalleryButton() { var actual = new GalleryButton("MyGalleryButton"); _sut._galleryButtons.Add(actual); Assert.AreEqual(actual, _sut["MyGalleryButton"]); }
public override void ViewWillLayoutSubviews() { base.ViewWillLayoutSubviews(); CameraButton.Layer.CornerRadius = CameraButton.Layer.Frame.Size.Width / 2; CameraButton.BackgroundColor = UIColor.FromRGB(0x5A, 0x86, 0x22); // 5A8622 dark-green CameraButton.SetTitleColor(UIColor.FromRGB(0xCF, 0xEF, 0xa7), UIControlState.Normal); // CFEFA7 light-green CameraButton.ClipsToBounds = true; //CameraButton.setImage(UIImage(named: "your-image"), for: .normal) CameraButton.TranslatesAutoresizingMaskIntoConstraints = false; GalleryButton.Layer.CornerRadius = GalleryButton.Layer.Frame.Size.Width / 2; GalleryButton.BackgroundColor = UIColor.FromRGB(0x5A, 0x86, 0x22); // 5A8622 dark-green GalleryButton.SetTitleColor(UIColor.FromRGB(0xCF, 0xEF, 0xa7), UIControlState.Normal); // CFEFA7 light-green GalleryButton.ClipsToBounds = true; //GalleryButton.setImage(UIImage(named: "your-image"), for: .normal) GalleryButton.TranslatesAutoresizingMaskIntoConstraints = false; CloseButton.Layer.CornerRadius = CloseButton.Layer.Frame.Size.Width / 2; CloseButton.BackgroundColor = UIColor.FromRGB(0x5A, 0x86, 0x22); // 5A8622 dark-green CloseButton.SetTitleColor(UIColor.FromRGB(0xCF, 0xEF, 0xa7), UIControlState.Normal); // CFEFA7 light-green CloseButton.ClipsToBounds = true; //CloseButton.setImage(UIImage(named: "your-image"), for: .normal) CloseButton.TranslatesAutoresizingMaskIntoConstraints = false; SaveButton.Layer.CornerRadius = SaveButton.Layer.Frame.Size.Width / 2; SaveButton.BackgroundColor = UIColor.FromRGB(0x5A, 0x86, 0x22); // 5A8622 dark-green SaveButton.SetTitleColor(UIColor.FromRGB(0xCF, 0xEF, 0xa7), UIControlState.Normal); // CFEFA7 light-green SaveButton.ClipsToBounds = true; //SaveButton.setImage(UIImage(named: "your-image"), for: .normal) SaveButton.TranslatesAutoresizingMaskIntoConstraints = false; ClassificationLabel.TranslatesAutoresizingMaskIntoConstraints = false; var safeGuide = View.SafeAreaLayoutGuide; NSLayoutConstraint.ActivateConstraints(new NSLayoutConstraint[] { CloseButton.TrailingAnchor.ConstraintEqualTo(safeGuide.TrailingAnchor, -23), CloseButton.BottomAnchor.ConstraintEqualTo(safeGuide.BottomAnchor, -13), CloseButton.WidthAnchor.ConstraintEqualTo(60), CloseButton.HeightAnchor.ConstraintEqualTo(60) }); NSLayoutConstraint.ActivateConstraints(new NSLayoutConstraint[] { CameraButton.TrailingAnchor.ConstraintEqualTo(CloseButton.LeadingAnchor, -23), CameraButton.BottomAnchor.ConstraintEqualTo(safeGuide.BottomAnchor, -13), CameraButton.WidthAnchor.ConstraintEqualTo(60), CameraButton.HeightAnchor.ConstraintEqualTo(60) }); NSLayoutConstraint.ActivateConstraints(new NSLayoutConstraint[] { GalleryButton.TrailingAnchor.ConstraintEqualTo(CameraButton.LeadingAnchor, -23), GalleryButton.BottomAnchor.ConstraintEqualTo(safeGuide.BottomAnchor, -13), GalleryButton.WidthAnchor.ConstraintEqualTo(60), GalleryButton.HeightAnchor.ConstraintEqualTo(60) }); NSLayoutConstraint.ActivateConstraints(new NSLayoutConstraint[] { SaveButton.TrailingAnchor.ConstraintEqualTo(GalleryButton.LeadingAnchor, -23), SaveButton.BottomAnchor.ConstraintEqualTo(safeGuide.BottomAnchor, -13), SaveButton.WidthAnchor.ConstraintEqualTo(60), SaveButton.HeightAnchor.ConstraintEqualTo(60) }); var marginGuide = View.LayoutMarginsGuide; NSLayoutConstraint.ActivateConstraints(new NSLayoutConstraint[] { ClassificationLabel.LeadingAnchor.ConstraintEqualTo(marginGuide.LeadingAnchor), ClassificationLabel.TrailingAnchor.ConstraintEqualTo(marginGuide.TrailingAnchor), ClassificationLabel.BottomAnchor.ConstraintEqualTo(CloseButton.TopAnchor, -13), ClassificationLabel.HeightAnchor.ConstraintEqualTo(120) }); }
private void AccessibilityHandler() { GalleryButton.SetNeedsLayout(); PhotoUploadButton.SetNeedsLayout(); }